Skip to content

Commit

Permalink
C++/CLI - Replace NULL with nullptr
Browse files Browse the repository at this point in the history
Issue #3636
  • Loading branch information
amaitland committed Jul 31, 2021
1 parent b24cd8e commit a18637f
Show file tree
Hide file tree
Showing 50 changed files with 83 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ namespace CefSharp

//when refreshing the browser this is sometimes null, in this case return true and log message
//https://github.com/cefsharp/CefSharp/pull/2446
if (promiseData == NULL)
if (promiseData == nullptr)
{
LOG(WARNING) << "JavascriptAsyncMethodHandler::Execute promiseData returned NULL";
LOG(WARNING) << "JavascriptAsyncMethodHandler::Execute promiseData returned nullptr";

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ namespace CefSharp

//when refreshing the browser this is sometimes null, in this case return true and log message
//https://github.com/cefsharp/CefSharp/pull/2446
if (promiseData == NULL)
if (promiseData == nullptr)
{
LOG(WARNING) << "BindObjectAsyncHandler::Execute promiseData returned NULL";
LOG(WARNING) << "BindObjectAsyncHandler::Execute promiseData returned nullptr";

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace CefSharp

if (createCefSharpObj)
{
auto cefSharpObj = CefV8Value::CreateObject(NULL, NULL);
auto cefSharpObj = CefV8Value::CreateObject(nullptr, nullptr);
cefSharpObj->SetValue(kBindObjectAsync, bindObjAsyncFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE);
cefSharpObj->SetValue(kDeleteBoundObject, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE);
cefSharpObj->SetValue(kRemoveObjectFromCache, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE);
Expand All @@ -170,7 +170,7 @@ namespace CefSharp

if (createCefSharpObjCamelCase)
{
auto cefSharpObjCamelCase = CefV8Value::CreateObject(NULL, NULL);
auto cefSharpObjCamelCase = CefV8Value::CreateObject(nullptr, nullptr);
cefSharpObjCamelCase->SetValue(kBindObjectAsyncCamelCase, bindObjAsyncFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE);
cefSharpObjCamelCase->SetValue(kDeleteBoundObjectCamelCase, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE);
cefSharpObjCamelCase->SetValue(kRemoveObjectFromCacheCamelCase, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE);
Expand Down Expand Up @@ -613,7 +613,7 @@ namespace CefSharp
if (_registerBoundObjectRegistry->TryGetAndRemoveMethodCallback(callbackId, callback))
{
//Response object has no Accessor or Interceptor
auto response = CefV8Value::CreateObject(NULL, NULL);
auto response = CefV8Value::CreateObject(nullptr, nullptr);

response->SetValue("Count", CefV8Value::CreateInt(javascriptObjects->Count), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace CefSharp
if (type == JavascriptObject::typeid)
{
JavascriptObject^ javascriptObject = (JavascriptObject^)obj;
CefRefPtr<CefV8Value> cefObject = CefV8Value::CreateObject(NULL, NULL);
CefRefPtr<CefV8Value> cefObject = CefV8Value::CreateObject(nullptr, nullptr);

for (int i = 0; i < javascriptObject->Properties->Count; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace CefSharp
);

//V8Value that represents this javascript object - only one per complex type
auto javascriptObject = CefV8Value::CreateObject(_jsPropertyHandler.get(), NULL);
auto javascriptObject = CefV8Value::CreateObject(_jsPropertyHandler.get(), nullptr);
auto objectName = StringUtils::ToNative(object->JavascriptName);
v8Value->SetValue(objectName, javascriptObject, V8_PROPERTY_ATTRIBUTE_NONE);

Expand Down
4 changes: 2 additions & 2 deletions CefSharp.BrowserSubprocess.Core/SubProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace CefSharp

CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer());

return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), NULL);
return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), nullptr);
}

virtual void OnBrowserCreated(CefBrowserWrapper^ cefBrowserWrapper)
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace CefSharp

CefRefPtr<CefApp> app = new SubProcessApp(schemes);

return CefExecuteProcess(cefMainArgs, app, NULL);
return CefExecuteProcess(cefMainArgs, app, nullptr);
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.BrowserSubprocess.Core/Wrapper/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace CefSharp

!Frame()
{
_frame = NULL;
_frame = nullptr;
}

~Frame()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.BrowserSubprocess.Core/Wrapper/V8Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace CefSharp

!V8Context()
{
_context = NULL;
_context = nullptr;
}

~V8Context()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/BrowserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace CefSharp
delete _browserSettings;
}

_browserSettings = NULL;
_browserSettings = nullptr;
_isDisposed = true;
}

Expand Down
8 changes: 4 additions & 4 deletions CefSharp.Core.Runtime/Cef.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ namespace CefSharp
cefApp));
CefMainArgs main_args;

auto success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get(), NULL);
auto success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get(), nullptr);

_initialized = success;
_multiThreadedMessageLoop = cefSettings->MultiThreadedMessageLoop;
Expand Down Expand Up @@ -325,7 +325,7 @@ namespace CefSharp
//TODO: Look at ways to expose an instance of CefApp
//CefRefPtr<CefSharpApp> app(new CefSharpApp(nullptr, nullptr));

return CefExecuteProcess(cefMainArgs, NULL, NULL);
return CefExecuteProcess(cefMainArgs, nullptr, nullptr);
}

/// <summary>Add an entry to the cross-origin whitelist.</summary>
Expand Down Expand Up @@ -448,7 +448,7 @@ namespace CefSharp
/// <returns>A the global cookie manager or null if the RequestContext has not yet been initialized.</returns>
static ICookieManager^ GetGlobalCookieManager(ICompletionCallback^ callback)
{
CefRefPtr<CefCompletionCallback> c = callback == nullptr ? NULL : new CefCompletionCallbackAdapter(callback);
CefRefPtr<CefCompletionCallback> c = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback);

auto cookieManager = CefCookieManager::GetGlobalManager(c);
if (cookieManager.get())
Expand Down Expand Up @@ -806,7 +806,7 @@ namespace CefSharp
/// will be executed asynchronously once registration is complete</param>
static void RegisterWidevineCdm(String^ path, [Optional] IRegisterCdmCallback^ callback)
{
CefRefPtr<CefRegisterCdmCallbackAdapter> adapter = NULL;
CefRefPtr<CefRegisterCdmCallbackAdapter> adapter = nullptr;

if (callback != nullptr)
{
Expand Down
6 changes: 3 additions & 3 deletions CefSharp.Core.Runtime/CookieManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace CefSharp
{
ThrowIfDisposed();

CefRefPtr<CefDeleteCookiesCallback> wrapper = callback == nullptr ? NULL : new CefDeleteCookiesCallbackAdapter(callback);
CefRefPtr<CefDeleteCookiesCallback> wrapper = callback == nullptr ? nullptr : new CefDeleteCookiesCallbackAdapter(callback);

return _cookieManager->DeleteCookies(StringUtils::ToNative(url), StringUtils::ToNative(name), wrapper);
}
Expand All @@ -35,7 +35,7 @@ namespace CefSharp
{
ThrowIfDisposed();

CefRefPtr<CefSetCookieCallback> wrapper = callback == nullptr ? NULL : new CefSetCookieCallbackAdapter(callback);
CefRefPtr<CefSetCookieCallback> wrapper = callback == nullptr ? nullptr : new CefSetCookieCallbackAdapter(callback);

CefCookie c;
StringUtils::AssignNativeFromClr(c.name, cookie->Name);
Expand Down Expand Up @@ -81,7 +81,7 @@ namespace CefSharp
{
ThrowIfDisposed();

CefRefPtr<CefCompletionCallback> wrapper = callback == nullptr ? NULL : new CefCompletionCallbackAdapter(callback);
CefRefPtr<CefCompletionCallback> wrapper = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback);

return _cookieManager->FlushStore(wrapper);
}
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/CookieManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace CefSharp
{
if (this == nullptr)
{
return NULL;
return nullptr;
}
return _cookieManager.get();
}
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.Core.Runtime/DragData.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace CefSharp
{
if (this == nullptr)
{
return NULL;
return nullptr;
}
return _wrappedDragData.get();
}
Expand Down Expand Up @@ -211,7 +211,7 @@ namespace CefSharp
{
if (stream == nullptr)
{
return (Int64)_wrappedDragData->GetFileContents(NULL);
return (Int64)_wrappedDragData->GetFileContents(nullptr);
}

auto writeHandler = new CefWriteHandlerWrapper(stream);
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefAuthCallbackWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace CefSharp

!CefAuthCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefAuthCallbackWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace CefSharp

!CefBeforeDownloadCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefBeforeDownloadCallbackWrapper()
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int CefBrowserHostWrapper::ExecuteDevToolsMethod(int messageId, String^ method,

if (paramaters == nullptr)
{
return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), NULL);
return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), nullptr);
}

auto val = TypeConversion::ToNative(paramaters);
Expand All @@ -248,7 +248,7 @@ int CefBrowserHostWrapper::ExecuteDevToolsMethod(int messageId, String^ method,

if (String::IsNullOrEmpty(paramsAsJson))
{
return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), NULL);
return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), nullptr);
}

auto val = CefParseJSON(StringUtils::ToNative(paramsAsJson), cef_json_parser_options_t::JSON_PARSER_RFC);
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace CefSharp

!CefBrowserHostWrapper()
{
_browserHost = NULL;
_browserHost = nullptr;
}

~CefBrowserHostWrapper()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefCallbackWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace CefSharp

!CefCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefCallbackWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace CefSharp

!CefCertificateCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefCertificateCallbackWrapper()
Expand All @@ -46,7 +46,7 @@ namespace CefSharp

if (cert == nullptr)
{
_callback->Select(NULL);
_callback->Select(nullptr);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace CefSharp

!CefContextMenuParamsWrapper()
{
_wrappedInfo = NULL;
_wrappedInfo = nullptr;
}

~CefContextMenuParamsWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace CefSharp

!CefDownloadItemCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefDownloadItemCallbackWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace CefSharp

if (activeBrowser == nullptr)
{
return NULL;
return nullptr;
}

//TODO: CLean this up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace CefSharp

!CefFileDialogCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefFileDialogCallbackWrapper()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefFrameWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace CefSharp

!CefFrameWrapper()
{
_frame = NULL;
_frame = nullptr;
}

~CefFrameWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace CefSharp

!CefGetExtensionResourceCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefGetExtensionResourceCallbackWrapper()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefImageWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace CefSharp

!CefImageWrapper()
{
_image = NULL;
_image = nullptr;
}

~CefImageWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace CefSharp

!CefJSDialogCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefJSDialogCallbackWrapper()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefMenuModelWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace CefSharp

!CefMenuModelWrapper()
{
_menu = NULL;
_menu = nullptr;
}

~CefMenuModelWrapper()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core.Runtime/Internals/CefRegistrationWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace CefSharp

!CefRegistrationWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefRegistrationWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace CefSharp

!CefRequestCallbackWrapper()
{
_callback = NULL;
_callback = nullptr;
}

~CefRequestCallbackWrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace CefSharp
if (Object::ReferenceEquals(_requestContextHandler, nullptr))
{

return NULL;
return nullptr;
}

CefBrowserWrapper browserWrapper(browser);
Expand All @@ -80,7 +80,7 @@ namespace CefSharp

if (Object::ReferenceEquals(handler, nullptr))
{
return NULL;
return nullptr;
}

//CefRequestContext is not associated with a specific browser
Expand Down
Loading

0 comments on commit a18637f

Please sign in to comment.