From d02d25269087b941d4b2cd2303ff3eb0b6a7964b Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 15 Jan 2020 15:28:12 +0100 Subject: [PATCH] cefclient: Convert NULL to nullptr (see issue #2861) --- tests/cefclient/browser/browser_window.cc | 4 +- .../browser/browser_window_osr_gtk.cc | 20 +++++----- .../browser/browser_window_osr_win.cc | 2 +- .../cefclient/browser/bytes_write_handler.cc | 4 +- .../browser/client_app_delegates_browser.cc | 2 +- tests/cefclient/browser/client_handler.cc | 6 +-- tests/cefclient/browser/client_handler_osr.cc | 2 +- tests/cefclient/browser/dialog_handler_gtk.cc | 14 +++---- tests/cefclient/browser/dialog_test.cc | 4 +- tests/cefclient/browser/drm_test.cc | 2 +- tests/cefclient/browser/image_cache.cc | 14 +++---- tests/cefclient/browser/main_context.cc | 4 +- tests/cefclient/browser/main_context_impl.cc | 2 +- .../browser/main_context_impl_posix.cc | 2 +- .../browser/main_context_impl_win.cc | 2 +- .../browser/osr_accessibility_helper.cc | 12 +++--- .../browser/osr_accessibility_node.cc | 8 ++-- .../browser/osr_accessibility_node.h | 2 +- .../browser/osr_accessibility_node_win.cc | 16 ++++---- tests/cefclient/browser/osr_dragdrop_win.cc | 4 +- tests/cefclient/browser/osr_dragdrop_win.h | 2 +- tests/cefclient/browser/osr_window_win.cc | 13 ++++--- tests/cefclient/browser/preferences_test.cc | 2 +- tests/cefclient/browser/print_handler_gtk.cc | 38 ++++++++++--------- .../cefclient/browser/response_filter_test.cc | 2 +- tests/cefclient/browser/root_window.cc | 4 +- tests/cefclient/browser/root_window_create.cc | 2 +- tests/cefclient/browser/root_window_gtk.cc | 16 ++++---- .../cefclient/browser/root_window_manager.cc | 8 ++-- tests/cefclient/browser/root_window_views.cc | 6 +-- tests/cefclient/browser/root_window_win.cc | 8 ++-- tests/cefclient/browser/scheme_test.cc | 4 +- tests/cefclient/browser/server_test.cc | 2 +- tests/cefclient/browser/temp_window_win.cc | 4 +- tests/cefclient/browser/temp_window_x11.cc | 4 +- tests/cefclient/browser/test_runner.cc | 4 +- tests/cefclient/browser/urlrequest_test.cc | 8 ++-- tests/cefclient/browser/views_menu_bar.cc | 6 +-- tests/cefclient/browser/views_window.cc | 26 ++++++------- .../browser/window_test_runner_gtk.cc | 2 +- tests/cefclient/cefclient_gtk.cc | 4 +- tests/cefclient/cefclient_win.cc | 2 +- tests/cefclient/renderer/performance_test.cc | 2 +- .../renderer/performance_test_tests.cc | 14 +++---- tests/shared/browser/client_app_browser.cc | 4 +- tests/shared/browser/extension_util.cc | 6 +-- tests/shared/browser/main_message_loop.cc | 4 +- tests/shared/browser/main_message_loop.h | 2 +- .../main_message_loop_external_pump.cc | 4 +- tests/shared/browser/resource_util_posix.cc | 4 +- tests/shared/browser/resource_util_win.cc | 6 +-- tests/shared/process_helper_mac.cc | 2 +- tests/shared/renderer/client_app_renderer.h | 2 +- 53 files changed, 173 insertions(+), 170 deletions(-) diff --git a/tests/cefclient/browser/browser_window.cc b/tests/cefclient/browser/browser_window.cc index 47e9f1270..ffe67edbb 100644 --- a/tests/cefclient/browser/browser_window.cc +++ b/tests/cefclient/browser/browser_window.cc @@ -50,11 +50,11 @@ void BrowserWindow::OnBrowserClosed(CefRefPtr browser) { REQUIRE_MAIN_THREAD(); if (browser_.get()) { DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier()); - browser_ = NULL; + browser_ = nullptr; } client_handler_->DetachDelegate(); - client_handler_ = NULL; + client_handler_ = nullptr; // |this| may be deleted. delegate_->OnBrowserWindowDestroyed(); diff --git a/tests/cefclient/browser/browser_window_osr_gtk.cc b/tests/cefclient/browser/browser_window_osr_gtk.cc index d2f09b15b..242b31259 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.cc +++ b/tests/cefclient/browser/browser_window_osr_gtk.cc @@ -965,10 +965,10 @@ BrowserWindowOsrGtk::BrowserWindowOsrGtk(BrowserWindow::Delegate* delegate, painting_popup_(false), hidden_(false), glarea_(NULL), - drag_trigger_event_(NULL), - drag_data_(NULL), + drag_trigger_event_(nullptr), + drag_data_(nullptr), drag_operation_(DRAG_OPERATION_NONE), - drag_context_(NULL), + drag_context_(nullptr), drag_targets_(gtk_target_list_new(NULL, 0)), drag_leave_(false), drag_drop_(false), @@ -1900,13 +1900,13 @@ void BrowserWindowOsrGtk::DragReset() { CEF_REQUIRE_UI_THREAD(); if (drag_trigger_event_) { gdk_event_free(drag_trigger_event_); - drag_trigger_event_ = NULL; + drag_trigger_event_ = nullptr; } - drag_data_ = NULL; + drag_data_ = nullptr; drag_operation_ = DRAG_OPERATION_NONE; if (drag_context_) { g_object_unref(drag_context_); - drag_context_ = NULL; + drag_context_ = nullptr; } drag_leave_ = false; drag_drop_ = false; @@ -1943,12 +1943,12 @@ void BrowserWindowOsrGtk::DragBegin(GtkWidget* widget, size_t image_size = image_binary->GetSize(); guint8* image_buffer = (guint8*)malloc(image_size); // must free image_binary->GetData((void*)image_buffer, image_size, 0); - GdkPixbufLoader* loader = NULL; // must unref - GError* error = NULL; // must free - GdkPixbuf* pixbuf = NULL; // owned by loader + GdkPixbufLoader* loader = nullptr; // must unref + GError* error = nullptr; // must free + GdkPixbuf* pixbuf = nullptr; // owned by loader gboolean success = FALSE; loader = gdk_pixbuf_loader_new_with_type("png", &error); - if (error == NULL && loader) { + if (error == nullptr && loader) { success = gdk_pixbuf_loader_write(loader, image_buffer, image_size, NULL); if (success) { success = gdk_pixbuf_loader_close(loader, NULL); diff --git a/tests/cefclient/browser/browser_window_osr_win.cc b/tests/cefclient/browser/browser_window_osr_win.cc index 8547e1f3b..053c655b7 100644 --- a/tests/cefclient/browser/browser_window_osr_win.cc +++ b/tests/cefclient/browser/browser_window_osr_win.cc @@ -112,7 +112,7 @@ void BrowserWindowOsrWin::OnBrowserClosed(CefRefPtr browser) { REQUIRE_MAIN_THREAD(); // Release the OSR window reference. It will be deleted on the UI thread. - osr_window_ = NULL; + osr_window_ = nullptr; BrowserWindow::OnBrowserClosed(browser); } diff --git a/tests/cefclient/browser/bytes_write_handler.cc b/tests/cefclient/browser/bytes_write_handler.cc index 2a745627c..25f17fa20 100644 --- a/tests/cefclient/browser/bytes_write_handler.cc +++ b/tests/cefclient/browser/bytes_write_handler.cc @@ -15,7 +15,7 @@ BytesWriteHandler::BytesWriteHandler(size_t grow) : grow_(grow), datasize_(grow), offset_(0) { DCHECK_GT(grow, 0U); data_ = malloc(grow); - DCHECK(data_ != NULL); + DCHECK(data_ != nullptr); } BytesWriteHandler::~BytesWriteHandler() { @@ -81,7 +81,7 @@ size_t BytesWriteHandler::Grow(size_t size) { size_t rv; size_t s = (size > grow_ ? size : grow_); void* tmp = realloc(data_, datasize_ + s); - DCHECK(tmp != NULL); + DCHECK(tmp != nullptr); if (tmp) { data_ = tmp; datasize_ += s; diff --git a/tests/cefclient/browser/client_app_delegates_browser.cc b/tests/cefclient/browser/client_app_delegates_browser.cc index 83128e8aa..4594818f8 100644 --- a/tests/cefclient/browser/client_app_delegates_browser.cc +++ b/tests/cefclient/browser/client_app_delegates_browser.cc @@ -22,7 +22,7 @@ CefRefPtr ClientAppBrowser::CreatePrintHandler() { #if defined(OS_LINUX) return new ClientPrintHandlerGtk(); #else - return NULL; + return nullptr; #endif } diff --git a/tests/cefclient/browser/client_handler.cc b/tests/cefclient/browser/client_handler.cc index bdf5fde52..81fb71131 100644 --- a/tests/cefclient/browser/client_handler.cc +++ b/tests/cefclient/browser/client_handler.cc @@ -277,7 +277,7 @@ void ClientHandler::DetachDelegate() { } DCHECK(delegate_); - delegate_ = NULL; + delegate_ = nullptr; } bool ClientHandler::OnProcessMessageReceived( @@ -615,7 +615,7 @@ void ClientHandler::OnBeforeClose(CefRefPtr browser) { delete *(it); } message_handler_set_.clear(); - message_router_ = NULL; + message_router_ = nullptr; } NotifyBrowserClosed(browser); @@ -784,7 +784,7 @@ bool ClientHandler::OnSelectClientCertificate( command_line->GetSwitchValue(switches::kSslClientCertificate); if (cert_name.empty()) { - callback->Select(NULL); + callback->Select(nullptr); return true; } diff --git a/tests/cefclient/browser/client_handler_osr.cc b/tests/cefclient/browser/client_handler_osr.cc index 547223586..a5873da3b 100644 --- a/tests/cefclient/browser/client_handler_osr.cc +++ b/tests/cefclient/browser/client_handler_osr.cc @@ -25,7 +25,7 @@ void ClientHandlerOsr::DetachOsrDelegate() { } DCHECK(osr_delegate_); - osr_delegate_ = NULL; + osr_delegate_ = nullptr; } void ClientHandlerOsr::OnAfterCreated(CefRefPtr browser) { diff --git a/tests/cefclient/browser/dialog_handler_gtk.cc b/tests/cefclient/browser/dialog_handler_gtk.cc index 81e7efecf..1958a52fe 100644 --- a/tests/cefclient/browser/dialog_handler_gtk.cc +++ b/tests/cefclient/browser/dialog_handler_gtk.cc @@ -140,7 +140,7 @@ GtkWindow* GetWindow(CefRefPtr browser) { LOG(ERROR) << "No GtkWindow for browser"; return window; } - return NULL; + return nullptr; } void RunCallback(base::Callback callback, GtkWindow* window) { @@ -149,7 +149,7 @@ void RunCallback(base::Callback callback, GtkWindow* window) { } // namespace -ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(NULL) {} +ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(nullptr) {} bool ClientDialogHandlerGtk::OnFileDialog( CefRefPtr browser, @@ -221,8 +221,8 @@ void ClientDialogHandlerGtk::OnResetDialogState(CefRefPtr browser) { return; gtk_widget_destroy(gtk_dialog_); - gtk_dialog_ = NULL; - js_dialog_callback_ = NULL; + gtk_dialog_ = nullptr; + js_dialog_callback_ = nullptr; } void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params, @@ -331,7 +331,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params, GSList* filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); if (filenames) { - for (GSList* iter = filenames; iter != NULL; + for (GSList* iter = filenames; iter != nullptr; iter = g_slist_next(iter)) { std::string path(static_cast(iter->data)); g_free(iter->data); @@ -347,7 +347,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params, if (success) { GtkFileFilter* selected_filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog)); - if (selected_filter != NULL) { + if (selected_filter != nullptr) { for (size_t x = 0; x < filters.size(); ++x) { if (filters[x] == selected_filter) { filter_index = x; @@ -466,7 +466,7 @@ void ClientDialogHandlerGtk::OnDialogResponse(GtkDialog* dialog, NOTREACHED(); } - handler->OnResetDialogState(NULL); + handler->OnResetDialogState(nullptr); } } // namespace client diff --git a/tests/cefclient/browser/dialog_test.cc b/tests/cefclient/browser/dialog_test.cc index e911c957b..030cedc4c 100644 --- a/tests/cefclient/browser/dialog_test.cc +++ b/tests/cefclient/browser/dialog_test.cc @@ -75,10 +75,10 @@ class DialogCallback : public CefRunFileDialogCallback { } router_callback_->Success(response); - router_callback_ = NULL; + router_callback_ = nullptr; dialog_state_->pending_ = false; - dialog_state_ = NULL; + dialog_state_ = nullptr; } private: diff --git a/tests/cefclient/browser/drm_test.cc b/tests/cefclient/browser/drm_test.cc index 19a716644..75632bd96 100644 --- a/tests/cefclient/browser/drm_test.cc +++ b/tests/cefclient/browser/drm_test.cc @@ -91,7 +91,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { CefRefPtr value = CefParseJSON(string, JSON_PARSER_RFC); if (value.get() && value->GetType() == VTYPE_DICTIONARY) return value->GetDictionary(); - return NULL; + return nullptr; } // Verify that |key| exists in |dictionary| and has type |value_type|. Fails diff --git a/tests/cefclient/browser/image_cache.cc b/tests/cefclient/browser/image_cache.cc index de19683a4..c2c41051c 100644 --- a/tests/cefclient/browser/image_cache.cc +++ b/tests/cefclient/browser/image_cache.cc @@ -108,7 +108,7 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info, if (info.id_ == kEmptyId) { // Image intentionally left empty. - images.push_back(NULL); + images.push_back(nullptr); continue; } @@ -125,7 +125,7 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info, } // Load the image. - images.push_back(NULL); + images.push_back(nullptr); if (!missing_images) missing_images = true; } @@ -146,7 +146,7 @@ CefRefPtr ImageCache::GetCachedImage(const std::string& image_id) { if (it != image_map_.end()) return it->second; - return NULL; + return nullptr; } // static @@ -273,7 +273,7 @@ CefRefPtr ImageCache::CreateImage(const std::string& image_id, DCHECK(!content.image_); if (content.contents_.empty()) - return NULL; + return nullptr; CefRefPtr image = CefImage::CreateImage(); @@ -285,18 +285,18 @@ CefRefPtr ImageCache::CreateImage(const std::string& image_id, rep.contents_.size())) { LOG(ERROR) << "Failed to create image " << image_id << " for PNG@" << rep.scale_factor_; - return NULL; + return nullptr; } } else if (rep.type_ == TYPE_JPEG) { if (!image->AddJPEG(rep.scale_factor_, rep.contents_.c_str(), rep.contents_.size())) { LOG(ERROR) << "Failed to create image " << image_id << " for JPG@" << rep.scale_factor_; - return NULL; + return nullptr; } } else { NOTREACHED(); - return NULL; + return nullptr; } } diff --git a/tests/cefclient/browser/main_context.cc b/tests/cefclient/browser/main_context.cc index 9f6150e66..11c455c69 100644 --- a/tests/cefclient/browser/main_context.cc +++ b/tests/cefclient/browser/main_context.cc @@ -10,7 +10,7 @@ namespace client { namespace { -MainContext* g_main_context = NULL; +MainContext* g_main_context = nullptr; } // namespace @@ -26,7 +26,7 @@ MainContext::MainContext() { } MainContext::~MainContext() { - g_main_context = NULL; + g_main_context = nullptr; } } // namespace client diff --git a/tests/cefclient/browser/main_context_impl.cc b/tests/cefclient/browser/main_context_impl.cc index 949919951..ef293bfc0 100644 --- a/tests/cefclient/browser/main_context_impl.cc +++ b/tests/cefclient/browser/main_context_impl.cc @@ -133,7 +133,7 @@ MainContextImpl::MainContextImpl(CefRefPtr command_line, // cef_web_plugin.h for details. It's safe to call this method before // CefInitialize(), and calling it before CefInitialize() is required on // Linux. - CefRegisterWidevineCdm(cdm_path, NULL); + CefRegisterWidevineCdm(cdm_path, nullptr); } } diff --git a/tests/cefclient/browser/main_context_impl_posix.cc b/tests/cefclient/browser/main_context_impl_posix.cc index 45ba6d8d8..8a13b3300 100644 --- a/tests/cefclient/browser/main_context_impl_posix.cc +++ b/tests/cefclient/browser/main_context_impl_posix.cc @@ -14,7 +14,7 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) { std::string MainContextImpl::GetAppWorkingDirectory() { char szWorkingDir[256]; - if (getcwd(szWorkingDir, sizeof(szWorkingDir) - 1) == NULL) { + if (getcwd(szWorkingDir, sizeof(szWorkingDir) - 1) == nullptr) { szWorkingDir[0] = 0; } else { // Add trailing path separator. diff --git a/tests/cefclient/browser/main_context_impl_win.cc b/tests/cefclient/browser/main_context_impl_win.cc index 4bf4d588b..0bbfbf22f 100644 --- a/tests/cefclient/browser/main_context_impl_win.cc +++ b/tests/cefclient/browser/main_context_impl_win.cc @@ -25,7 +25,7 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) { std::string MainContextImpl::GetAppWorkingDirectory() { char szWorkingDir[MAX_PATH + 1]; - if (_getcwd(szWorkingDir, MAX_PATH) == NULL) { + if (_getcwd(szWorkingDir, MAX_PATH) == nullptr) { szWorkingDir[0] = 0; } else { // Add trailing path separator. diff --git a/tests/cefclient/browser/osr_accessibility_helper.cc b/tests/cefclient/browser/osr_accessibility_helper.cc index 9ccd47f1a..d829e5e7f 100644 --- a/tests/cefclient/browser/osr_accessibility_helper.cc +++ b/tests/cefclient/browser/osr_accessibility_helper.cc @@ -14,7 +14,7 @@ OsrAXNode* OsrAXTree::GetNode(int nodeId) const { if (result != node_map_.end()) { return result->second; } - return NULL; + return nullptr; } void OsrAXTree::EraseNode(int nodeId) { @@ -127,7 +127,7 @@ OsrAXNode* OsrAccessibilityHelper::GetFocusedNode() const { return tree->second.GetNode(focused_node_id_); } - return NULL; + return nullptr; } OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const { @@ -136,7 +136,7 @@ OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const { return tree->second.GetNode(tree->second.GetRootNodeId()); } - return NULL; + return nullptr; } void OsrAccessibilityHelper::UpdateLayout( @@ -205,7 +205,7 @@ void OsrAccessibilityHelper::UpdateLayout( if (update->HasKey("root_id")) { int nodeId = CastToInt(update->GetValue("root_id")); OsrAXNode* node = GetNode(treeId, nodeId); - if (node != NULL) { + if (node != nullptr) { auto& tree = accessibility_node_map_[treeId]; tree.SetRootNodeId(nodeId); } @@ -242,7 +242,7 @@ void OsrAccessibilityHelper::DestroyNode(OsrAXNode* node) { if (!childNode) { continue; } - childNode->SetParent(NULL); + childNode->SetParent(nullptr); if (childNode->OsrAXTreeId() == treeId) { DestroyNode(childNode); } @@ -263,7 +263,7 @@ OsrAXNode* OsrAccessibilityHelper::GetNode(int treeId, int nodeId) const { return tree->second.GetNode(nodeId); } - return NULL; + return nullptr; } } // namespace client diff --git a/tests/cefclient/browser/osr_accessibility_node.cc b/tests/cefclient/browser/osr_accessibility_node.cc index a86125188..a7c14046e 100644 --- a/tests/cefclient/browser/osr_accessibility_node.cc +++ b/tests/cefclient/browser/osr_accessibility_node.cc @@ -18,8 +18,8 @@ OsrAXNode::OsrAXNode(int treeId, : tree_id_(treeId), node_id_(nodeId), child_tree_id_(-1), - platform_accessibility_(NULL), - parent_(NULL), + platform_accessibility_(nullptr), + parent_(nullptr), offset_container_id_(-1), accessibility_helper_(helper) { UpdateValue(value); @@ -105,7 +105,7 @@ CefWindowHandle OsrAXNode::GetWindowHandle() const { CefRefPtr OsrAXNode::GetBrowser() const { if (accessibility_helper_) return accessibility_helper_->GetBrowser(); - return NULL; + return nullptr; } void OsrAXNode::SetParent(OsrAXNode* parent) { @@ -161,7 +161,7 @@ OsrAXNode* OsrAXNode::ChildAtIndex(int index) const { } } - return NULL; + return nullptr; } // Create and return the platform specific OsrAXNode Object diff --git a/tests/cefclient/browser/osr_accessibility_node.h b/tests/cefclient/browser/osr_accessibility_node.h index 7c815a48d..9cb72273a 100644 --- a/tests/cefclient/browser/osr_accessibility_node.h +++ b/tests/cefclient/browser/osr_accessibility_node.h @@ -63,7 +63,7 @@ class OsrAXNode { CefNativeAccessible* GetNativeAccessibleObject(OsrAXNode* parent); CefNativeAccessible* GetParentAccessibleObject() const { - return parent_ ? parent_->platform_accessibility_ : NULL; + return parent_ ? parent_->platform_accessibility_ : nullptr; } OsrAccessibilityHelper* GetAccessibilityHelper() const { diff --git a/tests/cefclient/browser/osr_accessibility_node_win.cc b/tests/cefclient/browser/osr_accessibility_node_win.cc index d88572e7d..a96889a12 100644 --- a/tests/cefclient/browser/osr_accessibility_node_win.cc +++ b/tests/cefclient/browser/osr_accessibility_node_win.cc @@ -218,7 +218,7 @@ struct CefIAccessible : public IAccessible { // Remove the node reference when OsrAXNode is destroyed, so that // MSAA clients get CO_E_OBJNOTCONNECTED - void MarkDestroyed() { node_ = NULL; } + void MarkDestroyed() { node_ = nullptr; } protected: virtual ~CefIAccessible() {} @@ -242,7 +242,7 @@ STDMETHODIMP CefIAccessible::QueryInterface(REFIID riid, void** ppvObject) { else if (riid == IID_IUnknown) *ppvObject = static_cast(this); else - *ppvObject = NULL; + *ppvObject = nullptr; if (*ppvObject) reinterpret_cast(*ppvObject)->AddRef(); @@ -317,7 +317,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild, int numChilds = node_->GetChildCount(); // Mark Leaf node if there are no child if (numChilds <= 0) { - *ppdispChild = NULL; + *ppdispChild = nullptr; return S_FALSE; } else { if (ppdispChild && VALID_CHILDID(varChild)) { @@ -332,7 +332,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild, *ppdispChild = child->GetNativeAccessibleObject(node_); } - if (*ppdispChild == NULL) + if (*ppdispChild == nullptr) retCode = S_FALSE; else (*ppdispChild)->AddRef(); @@ -449,9 +449,9 @@ STDMETHODIMP CefIAccessible::get_accFocus(VARIANT* pFocusChild) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { OsrAXNode* focusedNode = node_->GetAccessibilityHelper()->GetFocusedNode(); - CefNativeAccessible* nativeObj = NULL; + CefNativeAccessible* nativeObj = nullptr; if (focusedNode) - nativeObj = focusedNode->GetNativeAccessibleObject(NULL); + nativeObj = focusedNode->GetNativeAccessibleObject(nullptr); if (nativeObj) { if (nativeObj == this) { @@ -663,7 +663,7 @@ void OsrAXNode::Destroy() { CefIAccessible* ptr = static_cast(platform_accessibility_); if (ptr) ptr->MarkDestroyed(); - platform_accessibility_ = NULL; + platform_accessibility_ = nullptr; } // Create and return NSAccessibility Implementation Object for Window @@ -687,7 +687,7 @@ void OsrAXNode::NotifyAccessibilityEvent(std::string event_type) const {} void OsrAXNode::Destroy() {} CefNativeAccessible* OsrAXNode::GetNativeAccessibleObject(OsrAXNode* parent) { - return NULL; + return nullptr; } } // namespace client diff --git a/tests/cefclient/browser/osr_dragdrop_win.cc b/tests/cefclient/browser/osr_dragdrop_win.cc index 317ab1e8a..cdd95b824 100644 --- a/tests/cefclient/browser/osr_dragdrop_win.cc +++ b/tests/cefclient/browser/osr_dragdrop_win.cc @@ -277,7 +277,7 @@ bool DragDataToDataObject(CefRefPtr drag_data, CefRefPtr DataObjectToDragData(IDataObject* data_object) { CefRefPtr drag_data = CefDragData::Create(); - IEnumFORMATETC* enumFormats = NULL; + IEnumFORMATETC* enumFormats = nullptr; HRESULT res = data_object->EnumFormatEtc(DATADIR_GET, &enumFormats); if (res != S_OK) return drag_data; @@ -396,7 +396,7 @@ CefBrowserHost::DragOperationsMask DropTargetWin::StartDragging( HRESULT res = DoDragDrop(dataObject, dropSource, effect, &resEffect); if (res != DRAGDROP_S_DROP) resEffect = DROPEFFECT_NONE; - current_drag_data_ = NULL; + current_drag_data_ = nullptr; } return DropEffectToDragOperation(resEffect); } diff --git a/tests/cefclient/browser/osr_dragdrop_win.h b/tests/cefclient/browser/osr_dragdrop_win.h index 823b9fc37..caf9613c2 100644 --- a/tests/cefclient/browser/osr_dragdrop_win.h +++ b/tests/cefclient/browser/osr_dragdrop_win.h @@ -24,7 +24,7 @@ namespace client { #define DEFAULT_QUERY_INTERFACE(__Class) \ HRESULT __stdcall QueryInterface(const IID& iid, void** object) { \ - *object = NULL; \ + *object = nullptr; \ if (IsEqualIID(iid, IID_IUnknown)) { \ IUnknown* obj = this; \ *object = obj; \ diff --git a/tests/cefclient/browser/osr_window_win.cc b/tests/cefclient/browser/osr_window_win.cc index 7a5e78cb6..e993962ae 100644 --- a/tests/cefclient/browser/osr_window_win.cc +++ b/tests/cefclient/browser/osr_window_win.cc @@ -307,7 +307,7 @@ void OsrWindowWin::Create(HWND parent_hwnd, const RECT& rect) { SetUserDataPtr(hwnd_, this); #if defined(CEF_USE_ATL) - accessibility_root_ = NULL; + accessibility_root_ = nullptr; // Create/register the drag&drop handler. drop_target_ = DropTargetWin::Create(this, hwnd_); @@ -332,7 +332,7 @@ void OsrWindowWin::Destroy() { #if defined(CEF_USE_ATL) // Revoke/delete the drag&drop handler. RevokeDragDrop(hwnd_); - drop_target_ = NULL; + drop_target_ = nullptr; #endif render_handler_.reset(); @@ -807,7 +807,7 @@ void OsrWindowWin::OnPaint() { bool OsrWindowWin::OnEraseBkgnd() { // Erase the background when the browser does not exist. - return (browser_ == NULL); + return (browser_ == nullptr); } bool OsrWindowWin::OnTouchEvent(UINT message, WPARAM wParam, LPARAM lParam) { @@ -911,8 +911,8 @@ void OsrWindowWin::OnBeforeClose(CefRefPtr browser) { // Detach |this| from the ClientHandlerOsr. static_cast(browser_->GetHost()->GetClient().get()) ->DetachOsrDelegate(); - browser_ = NULL; - render_handler_->SetBrowser(NULL); + browser_ = nullptr; + render_handler_->SetBrowser(nullptr); Destroy(); } @@ -1092,7 +1092,8 @@ void OsrWindowWin::UpdateAccessibilityTree(CefRefPtr value) { // Update |accessibility_root_| because UpdateAccessibilityTree may have // cleared it. OsrAXNode* root = accessibility_handler_->GetRootNode(); - accessibility_root_ = root ? root->GetNativeAccessibleObject(NULL) : NULL; + accessibility_root_ = + root ? root->GetNativeAccessibleObject(nullptr) : nullptr; #endif // defined(CEF_USE_ATL) } diff --git a/tests/cefclient/browser/preferences_test.cc b/tests/cefclient/browser/preferences_test.cc index 81e60dbe5..5659a8159 100644 --- a/tests/cefclient/browser/preferences_test.cc +++ b/tests/cefclient/browser/preferences_test.cc @@ -208,7 +208,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { CefRefPtr value = CefParseJSON(string, JSON_PARSER_RFC); if (value.get() && value->GetType() == VTYPE_DICTIONARY) return value->GetDictionary(); - return NULL; + return nullptr; } // Convert a dictionary value to a JSON string. diff --git a/tests/cefclient/browser/print_handler_gtk.cc b/tests/cefclient/browser/print_handler_gtk.cc index 1ae875b95..922c85b96 100644 --- a/tests/cefclient/browser/print_handler_gtk.cc +++ b/tests/cefclient/browser/print_handler_gtk.cc @@ -85,7 +85,7 @@ class StickyPrintSettingGtk { // Lazily initialize the singleton instance. StickyPrintSettingGtk* GetLastUsedSettings() { - static StickyPrintSettingGtk* settings = NULL; + static StickyPrintSettingGtk* settings = nullptr; if (!settings) settings = new StickyPrintSettingGtk(); return settings; @@ -94,7 +94,7 @@ StickyPrintSettingGtk* GetLastUsedSettings() { // Helper class to track GTK printers. class GtkPrinterList { public: - GtkPrinterList() : default_printer_(NULL) { + GtkPrinterList() : default_printer_(nullptr) { gtk_enumerate_printers(SetPrinter, this, NULL, TRUE); } @@ -114,7 +114,7 @@ class GtkPrinterList { // - Querying for non-existant printers like 'Print to PDF'. GtkPrinter* GetPrinterWithName(const std::string& name) { if (name.empty()) - return NULL; + return nullptr; for (std::vector::iterator it = printers_.begin(); it < printers_.end(); ++it) { @@ -123,7 +123,7 @@ class GtkPrinterList { } } - return NULL; + return nullptr; } private: @@ -279,7 +279,7 @@ GtkWindow* GetWindow(CefRefPtr browser) { RootWindow::GetForBrowser(browser->GetIdentifier()); if (root_window) return GTK_WINDOW(root_window->GetWindowHandle()); - return NULL; + return nullptr; } void RunCallback(base::Callback callback, GtkWindow* window) { @@ -304,29 +304,29 @@ void GetWindowAndContinue(CefRefPtr browser, struct ClientPrintHandlerGtk::PrintHandler { PrintHandler(CefRefPtr browser) : browser_(browser), - dialog_(NULL), - gtk_settings_(NULL), - page_setup_(NULL), - printer_(NULL) {} + dialog_(nullptr), + gtk_settings_(nullptr), + page_setup_(nullptr), + printer_(nullptr) {} ~PrintHandler() { ScopedGdkThreadsEnter scoped_gdk_threads; if (dialog_) { gtk_widget_destroy(dialog_); - dialog_ = NULL; + dialog_ = nullptr; } if (gtk_settings_) { g_object_unref(gtk_settings_); - gtk_settings_ = NULL; + gtk_settings_ = nullptr; } if (page_setup_) { g_object_unref(page_setup_); - page_setup_ = NULL; + page_setup_ = nullptr; } if (printer_) { g_object_unref(printer_); - printer_ = NULL; + printer_ = nullptr; } } @@ -370,7 +370,7 @@ struct ClientPrintHandlerGtk::PrintHandler { color_value.c_str()); if (settings->GetDuplexMode() != DUPLEX_MODE_UNKNOWN) { - const char* cups_duplex_mode = NULL; + const char* cups_duplex_mode = nullptr; switch (settings->GetDuplexMode()) { case DUPLEX_MODE_LONG_EDGE: cups_duplex_mode = kDuplexNoTumble; @@ -523,17 +523,19 @@ struct ClientPrintHandlerGtk::PrintHandler { settings->SetSelectionOnly(print_selection_only); InitPrintSettings(gtk_settings_, page_setup_, settings); dialog_callback_->Continue(settings); - dialog_callback_ = NULL; + dialog_callback_ = nullptr; return; } case GTK_RESPONSE_DELETE_EVENT: // Fall through. case GTK_RESPONSE_CANCEL: { dialog_callback_->Cancel(); - dialog_callback_ = NULL; + dialog_callback_ = nullptr; return; } case GTK_RESPONSE_APPLY: - default: { NOTREACHED(); } + default: { + NOTREACHED(); + } } } @@ -543,7 +545,7 @@ struct ClientPrintHandlerGtk::PrintHandler { // chance to unwind. CefPostTask(TID_UI, base::Bind(&CefPrintJobCallback::Continue, job_callback_.get())); - job_callback_ = NULL; + job_callback_ = nullptr; } static void OnDialogResponseThunk(GtkDialog* dialog, diff --git a/tests/cefclient/browser/response_filter_test.cc b/tests/cefclient/browser/response_filter_test.cc index f437fbf85..183250404 100644 --- a/tests/cefclient/browser/response_filter_test.cc +++ b/tests/cefclient/browser/response_filter_test.cc @@ -234,7 +234,7 @@ CefRefPtr GetResourceResponseFilter( if (MatchesFilterURL(url)) return new PassThruResponseFilter(); - return NULL; + return nullptr; } } // namespace response_filter_test diff --git a/tests/cefclient/browser/root_window.cc b/tests/cefclient/browser/root_window.cc index 0ab59edb8..45ae80974 100644 --- a/tests/cefclient/browser/root_window.cc +++ b/tests/cefclient/browser/root_window.cc @@ -17,7 +17,7 @@ RootWindowConfig::RootWindowConfig() initially_hidden(false), url(MainContext::Get()->GetMainURL()) {} -RootWindow::RootWindow() : delegate_(NULL) {} +RootWindow::RootWindow() : delegate_(nullptr) {} RootWindow::~RootWindow() {} @@ -37,7 +37,7 @@ void RootWindow::OnExtensionsChanged(const ExtensionSet& extensions) { ExtensionSet::const_iterator it = extensions.begin(); for (; it != extensions.end(); ++it) { - delegate_->CreateExtensionWindow(*it, CefRect(), NULL, base::Closure(), + delegate_->CreateExtensionWindow(*it, CefRect(), nullptr, base::Closure(), WithWindowlessRendering()); } } diff --git a/tests/cefclient/browser/root_window_create.cc b/tests/cefclient/browser/root_window_create.cc index 884fb4b4f..04e347c63 100644 --- a/tests/cefclient/browser/root_window_create.cc +++ b/tests/cefclient/browser/root_window_create.cc @@ -36,7 +36,7 @@ scoped_refptr RootWindow::Create(bool use_views) { return new RootWindowMac(); #endif - return NULL; + return nullptr; } } // namespace client diff --git a/tests/cefclient/browser/root_window_gtk.cc b/tests/cefclient/browser/root_window_gtk.cc index 26e29ac72..ba4858917 100644 --- a/tests/cefclient/browser/root_window_gtk.cc +++ b/tests/cefclient/browser/root_window_gtk.cc @@ -56,12 +56,12 @@ RootWindowGtk::RootWindowGtk() with_extension_(false), is_popup_(false), initialized_(false), - window_(NULL), - back_button_(NULL), - forward_button_(NULL), - reload_button_(NULL), - stop_button_(NULL), - url_entry_(NULL), + window_(nullptr), + back_button_(nullptr), + forward_button_(nullptr), + reload_button_(nullptr), + stop_button_(nullptr), + url_entry_(nullptr), toolbar_height_(0), menubar_height_(0), window_destroyed_(false), @@ -225,7 +225,7 @@ CefRefPtr RootWindowGtk::GetBrowser() const { if (browser_window_) return browser_window_->GetBrowser(); - return NULL; + return nullptr; } ClientWindowHandle RootWindowGtk::GetWindowHandle() const { @@ -380,7 +380,7 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings, if (!is_popup_) { // Create the browser window. - browser_window_->CreateBrowser(parent, browser_bounds_, settings, NULL, + browser_window_->CreateBrowser(parent, browser_bounds_, settings, nullptr, delegate_->GetRequestContext(this)); } else { // With popups we already have a browser window. Parent the browser window diff --git a/tests/cefclient/browser/root_window_manager.cc b/tests/cefclient/browser/root_window_manager.cc index abe7b1338..f0ad7a5af 100644 --- a/tests/cefclient/browser/root_window_manager.cc +++ b/tests/cefclient/browser/root_window_manager.cc @@ -174,7 +174,7 @@ scoped_refptr RootWindowManager::CreateRootWindowAsExtension( const std::string& extension_url = extension_util::GetExtensionURL(extension); if (extension_url.empty()) { NOTREACHED() << "Extension cannot be loaded directly."; - return NULL; + return nullptr; } // Create an initially hidden browser window that loads the extension URL. @@ -226,7 +226,7 @@ scoped_refptr RootWindowManager::GetWindowForBrowser( if (browser.get() && browser->GetIdentifier() == browser_id) return *it; } - return NULL; + return nullptr; } scoped_refptr RootWindowManager::GetActiveRootWindow() const { @@ -382,10 +382,10 @@ void RootWindowManager::OnRootWindowDestroyed(RootWindow* root_window) { root_windows_.erase(it); if (root_window == active_root_window_) { - active_root_window_ = NULL; + active_root_window_ = nullptr; base::AutoLock lock_scope(active_browser_lock_); - active_browser_ = NULL; + active_browser_ = nullptr; } if (terminate_when_all_windows_closed_ && root_windows_.empty()) { diff --git a/tests/cefclient/browser/root_window_views.cc b/tests/cefclient/browser/root_window_views.cc index 7023a37a8..0165a9c26 100644 --- a/tests/cefclient/browser/root_window_views.cc +++ b/tests/cefclient/browser/root_window_views.cc @@ -251,7 +251,7 @@ void RootWindowViews::OnViewsWindowCreated(CefRefPtr window) { void RootWindowViews::OnViewsWindowDestroyed(CefRefPtr window) { CEF_REQUIRE_UI_THREAD(); - window_ = NULL; + window_ = nullptr; // Continue on the main thread. MAIN_POST_CLOSURE( @@ -333,11 +333,11 @@ void RootWindowViews::OnBrowserClosed(CefRefPtr browser) { REQUIRE_MAIN_THREAD(); if (browser_) { DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier()); - browser_ = NULL; + browser_ = nullptr; } client_handler_->DetachDelegate(); - client_handler_ = NULL; + client_handler_ = nullptr; browser_destroyed_ = true; NotifyDestroyedIfDone(); diff --git a/tests/cefclient/browser/root_window_win.cc b/tests/cefclient/browser/root_window_win.cc index 492efeedc..dd208db0c 100644 --- a/tests/cefclient/browser/root_window_win.cc +++ b/tests/cefclient/browser/root_window_win.cc @@ -286,7 +286,7 @@ CefRefPtr RootWindowWin::GetBrowser() const { if (browser_window_) return browser_window_->GetBrowser(); - return NULL; + return nullptr; } ClientWindowHandle RootWindowWin::GetWindowHandle() const { @@ -489,7 +489,7 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd, LPARAM lParam) { REQUIRE_MAIN_THREAD(); - RootWindowWin* self = NULL; + RootWindowWin* self = nullptr; if (message != WM_NCCREATE) { self = GetUserDataPtr(hWnd); if (!self) @@ -749,7 +749,7 @@ void RootWindowWin::OnDpiChanged(WPARAM wParam, LPARAM lParam) { bool RootWindowWin::OnEraseBkgnd() { // Erase the background when the browser does not exist. - return (GetBrowser() == NULL); + return (GetBrowser() == nullptr); } bool RootWindowWin::OnCommand(UINT id) { @@ -949,7 +949,7 @@ void RootWindowWin::OnCreate(LPCREATESTRUCT lpCreateStruct) { // Create the browser window. CefRect cef_rect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); - browser_window_->CreateBrowser(hwnd_, cef_rect, browser_settings_, NULL, + browser_window_->CreateBrowser(hwnd_, cef_rect, browser_settings_, nullptr, delegate_->GetRequestContext(this)); } else { // With popups we already have a browser window. Parent the browser window diff --git a/tests/cefclient/browser/scheme_test.cc b/tests/cefclient/browser/scheme_test.cc index 1e9dd12f9..c19806bea 100644 --- a/tests/cefclient/browser/scheme_test.cc +++ b/tests/cefclient/browser/scheme_test.cc @@ -39,7 +39,7 @@ class ClientSchemeHandler : public CefResourceHandler { bool handled = false; std::string url = request->GetURL(); - if (strstr(url.c_str(), "handler.html") != NULL) { + if (strstr(url.c_str(), "handler.html") != nullptr) { // Build the response html data_ = "Client Scheme Handler" @@ -65,7 +65,7 @@ class ClientSchemeHandler : public CefResourceHandler { // Set the resulting mime type mime_type_ = "text/html"; - } else if (strstr(url.c_str(), "logo.png") != NULL) { + } else if (strstr(url.c_str(), "logo.png") != nullptr) { // Load the response image if (LoadBinaryResource("logo.png", data_)) { handled = true; diff --git a/tests/cefclient/browser/server_test.cc b/tests/cefclient/browser/server_test.cc index 2029c026c..ee3b922b5 100644 --- a/tests/cefclient/browser/server_test.cc +++ b/tests/cefclient/browser/server_test.cc @@ -352,7 +352,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { CefRefPtr value = CefParseJSON(string, JSON_PARSER_RFC); if (value.get() && value->GetType() == VTYPE_DICTIONARY) return value->GetDictionary(); - return NULL; + return nullptr; } // Verify that |key| exists in |dictionary| and has type |value_type|. Fails diff --git a/tests/cefclient/browser/temp_window_win.cc b/tests/cefclient/browser/temp_window_win.cc index 9d98eebc8..af5cdf9e6 100644 --- a/tests/cefclient/browser/temp_window_win.cc +++ b/tests/cefclient/browser/temp_window_win.cc @@ -30,7 +30,7 @@ HWND CreateTempWindow() { 1, 1, NULL, NULL, hInstance, NULL); } -TempWindowWin* g_temp_window = NULL; +TempWindowWin* g_temp_window = nullptr; } // namespace @@ -43,7 +43,7 @@ TempWindowWin::TempWindowWin() : hwnd_(NULL) { } TempWindowWin::~TempWindowWin() { - g_temp_window = NULL; + g_temp_window = nullptr; DCHECK(hwnd_); DestroyWindow(hwnd_); } diff --git a/tests/cefclient/browser/temp_window_x11.cc b/tests/cefclient/browser/temp_window_x11.cc index 051cdfdbb..de9f45d1f 100644 --- a/tests/cefclient/browser/temp_window_x11.cc +++ b/tests/cefclient/browser/temp_window_x11.cc @@ -38,7 +38,7 @@ void CloseTempWindow(::Window xwindow) { XDestroyWindow(xdisplay, xwindow); } -TempWindowX11* g_temp_window = NULL; +TempWindowX11* g_temp_window = nullptr; } // namespace @@ -51,7 +51,7 @@ TempWindowX11::TempWindowX11() : xwindow_(kNullWindowHandle) { } TempWindowX11::~TempWindowX11() { - g_temp_window = NULL; + g_temp_window = nullptr; DCHECK(xwindow_); CloseTempWindow(xwindow_); diff --git a/tests/cefclient/browser/test_runner.cc b/tests/cefclient/browser/test_runner.cc index eb157bf9a..590f4d04c 100644 --- a/tests/cefclient/browser/test_runner.cc +++ b/tests/cefclient/browser/test_runner.cc @@ -323,7 +323,7 @@ void BeginTracing() { return; } - CefBeginTracing(CefString(), NULL); + CefBeginTracing(CefString(), nullptr); } void EndTracing(CefRefPtr browser) { @@ -364,7 +364,7 @@ void EndTracing(CefRefPtr browser) { CefEndTracing(file_paths.front(), this); } else { // No file selected. Discard the trace data. - CefEndTracing(CefString(), NULL); + CefEndTracing(CefString(), nullptr); } } diff --git a/tests/cefclient/browser/urlrequest_test.cc b/tests/cefclient/browser/urlrequest_test.cc index e7145fafb..7e3961385 100644 --- a/tests/cefclient/browser/urlrequest_test.cc +++ b/tests/cefclient/browser/urlrequest_test.cc @@ -147,13 +147,13 @@ class Handler : public CefMessageRouterBrowserSide::Handler { static_cast(urlrequest_->GetClient().get())->Detach(); urlrequest_->Cancel(); - urlrequest_ = NULL; + urlrequest_ = nullptr; } if (callback_.get()) { // Must always execute |callback_| before deleting it. callback_->Failure(ERR_ABORTED, test_runner::GetErrorString(ERR_ABORTED)); - callback_ = NULL; + callback_ = nullptr; } } @@ -166,8 +166,8 @@ class Handler : public CefMessageRouterBrowserSide::Handler { else callback_->Failure(error_code, test_runner::GetErrorString(error_code)); - callback_ = NULL; - urlrequest_ = NULL; + callback_ = nullptr; + urlrequest_ = nullptr; } CefRefPtr callback_; diff --git a/tests/cefclient/browser/views_menu_bar.cc b/tests/cefclient/browser/views_menu_bar.cc index c13a9dedd..a7b4b4fd2 100644 --- a/tests/cefclient/browser/views_menu_bar.cc +++ b/tests/cefclient/browser/views_menu_bar.cc @@ -99,7 +99,7 @@ CefRefPtr ViewsMenuBar::CreateMenuModel(const CefString& label, CefRefPtr ViewsMenuBar::GetMenuModel(int menu_id) const { if (HasMenuId(menu_id)) return models_[menu_id - id_start_]; - return NULL; + return nullptr; } void ViewsMenuBar::SetMenuFocusable(bool focusable) { @@ -141,7 +141,7 @@ bool ViewsMenuBar::OnKeyEvent(const CefKeyEvent& event) { } void ViewsMenuBar::Reset() { - panel_ = NULL; + panel_ = nullptr; models_.clear(); mnemonics_.clear(); id_next_ = id_start_; @@ -239,7 +239,7 @@ void ViewsMenuBar::EnsureMenuPanel() { if (panel_) return; - panel_ = CefPanel::CreatePanel(NULL); + panel_ = CefPanel::CreatePanel(nullptr); views_style::ApplyTo(panel_); // Use a horizontal box layout. diff --git a/tests/cefclient/browser/views_window.cc b/tests/cefclient/browser/views_window.cc index 06a5d1dac..230e6de07 100644 --- a/tests/cefclient/browser/views_window.cc +++ b/tests/cefclient/browser/views_window.cc @@ -112,11 +112,11 @@ CefRefPtr ViewsWindow::Create( DCHECK(delegate); // Create a new ViewsWindow. - CefRefPtr views_window = new ViewsWindow(delegate, NULL); + CefRefPtr views_window = new ViewsWindow(delegate, nullptr); // Create a new BrowserView. CefRefPtr browser_view = CefBrowserView::CreateBrowserView( - client, url, settings, NULL, request_context, views_window); + client, url, settings, nullptr, request_context, views_window); // Associate the BrowserView with the ViewsWindow. views_window->SetBrowserView(browser_view); @@ -334,7 +334,7 @@ CefRefPtr ViewsWindow::GetDelegateForPopupBrowserView( DCHECK(popup_delegate && popup_delegate != delegate_); // Create a new ViewsWindow for the popup BrowserView. - return new ViewsWindow(popup_delegate, NULL); + return new ViewsWindow(popup_delegate, nullptr); } bool ViewsWindow::OnPopupBrowserViewCreated( @@ -525,14 +525,14 @@ void ViewsWindow::OnWindowDestroyed(CefRefPtr window) { delegate_->OnViewsWindowDestroyed(this); - browser_view_ = NULL; - button_menu_model_ = NULL; + browser_view_ = nullptr; + button_menu_model_ = nullptr; if (top_menu_bar_) { top_menu_bar_->Reset(); - top_menu_bar_ = NULL; + top_menu_bar_ = nullptr; } - extensions_panel_ = NULL; - window_ = NULL; + extensions_panel_ = nullptr; + window_ = nullptr; } bool ViewsWindow::CanClose(CefRefPtr window) { @@ -711,8 +711,8 @@ void ViewsWindow::CreateMenuModel() { if (top_menu_bar_) { // Add the menus to the top menu bar. - AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", NULL)); - AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", NULL)); + AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", nullptr)); + AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", nullptr)); } } @@ -762,7 +762,7 @@ void ViewsWindow::AddControls() { menu_button->SetMinimumSize(CefSize(0, 0)); // Create the top panel. - CefRefPtr top_panel = CefPanel::CreatePanel(NULL); + CefRefPtr top_panel = CefPanel::CreatePanel(nullptr); // Use a horizontal box layout for |top_panel|. CefBoxLayoutSettings top_panel_layout_settings; @@ -876,7 +876,7 @@ void ViewsWindow::UpdateExtensionControls() { return; if (!extensions_panel_) { - extensions_panel_ = CefPanel::CreatePanel(NULL); + extensions_panel_ = CefPanel::CreatePanel(nullptr); // Use a horizontal box layout for |top_panel|. CefBoxLayoutSettings top_panel_layout_settings; @@ -946,7 +946,7 @@ void ViewsWindow::OnExtensionWindowClosed() { } // Restore the button state. - extension_button_pressed_lock_ = NULL; + extension_button_pressed_lock_ = nullptr; } } // namespace client diff --git a/tests/cefclient/browser/window_test_runner_gtk.cc b/tests/cefclient/browser/window_test_runner_gtk.cc index 56f078b72..ff79991a7 100644 --- a/tests/cefclient/browser/window_test_runner_gtk.cc +++ b/tests/cefclient/browser/window_test_runner_gtk.cc @@ -25,7 +25,7 @@ GtkWindow* GetWindow(CefRefPtr browser) { LOG(ERROR) << "No GtkWindow for browser"; return window; } - return NULL; + return nullptr; } bool IsMaximized(GtkWindow* window) { diff --git a/tests/cefclient/cefclient_gtk.cc b/tests/cefclient/cefclient_gtk.cc index ee1adb996..02ae57154 100644 --- a/tests/cefclient/cefclient_gtk.cc +++ b/tests/cefclient/cefclient_gtk.cc @@ -79,7 +79,7 @@ int RunMain(int argc, char* argv[]) { } // Execute the secondary process, if any. - int exit_code = CefExecuteProcess(main_args, app, NULL); + int exit_code = CefExecuteProcess(main_args, app, nullptr); if (exit_code >= 0) return exit_code; @@ -108,7 +108,7 @@ int RunMain(int argc, char* argv[]) { message_loop.reset(new MainMessageLoopStd); // Initialize CEF. - context->Initialize(main_args, settings, app, NULL); + context->Initialize(main_args, settings, app, nullptr); // The Chromium sandbox requires that there only be a single thread during // initialization. Therefore initialize GTK after CEF. diff --git a/tests/cefclient/cefclient_win.cc b/tests/cefclient/cefclient_win.cc index c6e8a5c81..74166bb16 100644 --- a/tests/cefclient/cefclient_win.cc +++ b/tests/cefclient/cefclient_win.cc @@ -39,7 +39,7 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) { CefMainArgs main_args(hInstance); - void* sandbox_info = NULL; + void* sandbox_info = nullptr; #if defined(CEF_USE_SANDBOX) // Manage the life span of the sandbox information object. This is necessary diff --git a/tests/cefclient/renderer/performance_test.cc b/tests/cefclient/renderer/performance_test.cc index 31a0e45a2..64fcaaa78 100644 --- a/tests/cefclient/renderer/performance_test.cc +++ b/tests/cefclient/renderer/performance_test.cc @@ -103,7 +103,7 @@ class V8Handler : public CefV8Handler { retval = CefV8Value::CreateString("Hello, world!"); break; case 8: - retval = CefV8Value::CreateObject(NULL, NULL); + retval = CefV8Value::CreateObject(nullptr, nullptr); break; case 9: retval = CefV8Value::CreateArray(8); diff --git a/tests/cefclient/renderer/performance_test_tests.cc b/tests/cefclient/renderer/performance_test_tests.cc index 16c476fdb..010fcf9b7 100644 --- a/tests/cefclient/renderer/performance_test_tests.cc +++ b/tests/cefclient/renderer/performance_test_tests.cc @@ -160,7 +160,7 @@ PERF_TEST_FUNC(V8FunctionExecuteWithContext) { PERF_TEST_FUNC(V8ObjectCreate) { PERF_ITERATIONS_START() - CefRefPtr value = CefV8Value::CreateObject(NULL, NULL); + CefRefPtr value = CefV8Value::CreateObject(nullptr, nullptr); PERF_ITERATIONS_END() } @@ -186,7 +186,7 @@ PERF_TEST_FUNC(V8ObjectCreateWithAccessor) { CefRefPtr accessor = new Accessor(); PERF_ITERATIONS_START() - CefRefPtr value = CefV8Value::CreateObject(accessor, NULL); + CefRefPtr value = CefV8Value::CreateObject(accessor, nullptr); PERF_ITERATIONS_END() } @@ -224,14 +224,14 @@ PERF_TEST_FUNC(V8ObjectCreateWithInterceptor) { CefRefPtr interceptor = new Interceptor(); PERF_ITERATIONS_START() - CefRefPtr value = CefV8Value::CreateObject(NULL, interceptor); + CefRefPtr value = CefV8Value::CreateObject(nullptr, interceptor); PERF_ITERATIONS_END() } PERF_TEST_FUNC(V8ObjectSetValue) { CefString name = "name"; CefRefPtr val = CefV8Value::CreateBool(true); - CefRefPtr obj = CefV8Value::CreateObject(NULL, NULL); + CefRefPtr obj = CefV8Value::CreateObject(nullptr, nullptr); obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); PERF_ITERATIONS_START() @@ -242,7 +242,7 @@ PERF_TEST_FUNC(V8ObjectSetValue) { PERF_TEST_FUNC(V8ObjectGetValue) { CefString name = "name"; CefRefPtr val = CefV8Value::CreateBool(true); - CefRefPtr obj = CefV8Value::CreateObject(NULL, NULL); + CefRefPtr obj = CefV8Value::CreateObject(nullptr, nullptr); obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); PERF_ITERATIONS_START() @@ -275,7 +275,7 @@ PERF_TEST_FUNC(V8ObjectSetValueWithAccessor) { CefString name = "name"; CefRefPtr val = CefV8Value::CreateBool(true); - CefRefPtr obj = CefV8Value::CreateObject(accessor, NULL); + CefRefPtr obj = CefV8Value::CreateObject(accessor, nullptr); obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE); obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); @@ -309,7 +309,7 @@ PERF_TEST_FUNC(V8ObjectGetValueWithAccessor) { CefString name = "name"; CefRefPtr val = CefV8Value::CreateBool(true); - CefRefPtr obj = CefV8Value::CreateObject(accessor, NULL); + CefRefPtr obj = CefV8Value::CreateObject(accessor, nullptr); obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE); obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); diff --git a/tests/shared/browser/client_app_browser.cc b/tests/shared/browser/client_app_browser.cc index afed49c93..e02ef7b93 100644 --- a/tests/shared/browser/client_app_browser.cc +++ b/tests/shared/browser/client_app_browser.cc @@ -57,9 +57,9 @@ void ClientAppBrowser::OnContextInitialized() { if (!cookieable_schemes_.empty()) { // Register cookieable schemes with the global cookie manager. CefRefPtr manager = - CefCookieManager::GetGlobalManager(NULL); + CefCookieManager::GetGlobalManager(nullptr); DCHECK(manager.get()); - manager->SetSupportedSchemes(cookieable_schemes_, true, NULL); + manager->SetSupportedSchemes(cookieable_schemes_, true, nullptr); } print_handler_ = CreatePrintHandler(); diff --git a/tests/shared/browser/extension_util.cc b/tests/shared/browser/extension_util.cc index dab79d843..5d2e535e5 100644 --- a/tests/shared/browser/extension_util.cc +++ b/tests/shared/browser/extension_util.cc @@ -83,7 +83,7 @@ void GetInternalManifest(const std::string& extension_path, if (!LoadBinaryResource(manifest_path.c_str(), manifest_contents) || manifest_contents.empty()) { LOG(ERROR) << "Failed to load manifest from " << manifest_path; - RunManifestCallback(callback, NULL); + RunManifestCallback(callback, nullptr); return; } @@ -96,7 +96,7 @@ void GetInternalManifest(const std::string& extension_path, error_msg = "Incorrectly formatted dictionary contents."; LOG(ERROR) << "Failed to parse manifest from " << manifest_path << "; " << error_msg.ToString(); - RunManifestCallback(callback, NULL); + RunManifestCallback(callback, nullptr); return; } @@ -178,7 +178,7 @@ void LoadExtension(CefRefPtr request_context, extension_path, handler)); } else { // Load the extension from disk. - request_context->LoadExtension(extension_path, NULL, handler); + request_context->LoadExtension(extension_path, nullptr, handler); } } diff --git a/tests/shared/browser/main_message_loop.cc b/tests/shared/browser/main_message_loop.cc index dc6f879b2..481e2b429 100644 --- a/tests/shared/browser/main_message_loop.cc +++ b/tests/shared/browser/main_message_loop.cc @@ -11,7 +11,7 @@ namespace client { namespace { -MainMessageLoop* g_main_message_loop = NULL; +MainMessageLoop* g_main_message_loop = nullptr; } // namespace @@ -21,7 +21,7 @@ MainMessageLoop::MainMessageLoop() { } MainMessageLoop::~MainMessageLoop() { - g_main_message_loop = NULL; + g_main_message_loop = nullptr; } // static diff --git a/tests/shared/browser/main_message_loop.h b/tests/shared/browser/main_message_loop.h index ac0101285..90edd8d13 100644 --- a/tests/shared/browser/main_message_loop.h +++ b/tests/shared/browser/main_message_loop.h @@ -88,7 +88,7 @@ class MainMessageLoop { // // base::scoped_refptr foo = new Foo(); // foo->DoSomething(); -// foo = NULL; // Deletion of |foo| will occur on the main thread. +// foo = nullptr; // Deletion of |foo| will occur on the main thread. // struct DeleteOnMainThread { template diff --git a/tests/shared/browser/main_message_loop_external_pump.cc b/tests/shared/browser/main_message_loop_external_pump.cc index bca6fdb23..b589f6671 100644 --- a/tests/shared/browser/main_message_loop_external_pump.cc +++ b/tests/shared/browser/main_message_loop_external_pump.cc @@ -22,7 +22,7 @@ const int32 kTimerDelayPlaceholder = INT_MAX; // DoWork(). const int64 kMaxTimerDelay = 1000 / 30; // 30fps -client::MainMessageLoopExternalPump* g_external_message_pump = NULL; +client::MainMessageLoopExternalPump* g_external_message_pump = nullptr; } // namespace @@ -33,7 +33,7 @@ MainMessageLoopExternalPump::MainMessageLoopExternalPump() } MainMessageLoopExternalPump::~MainMessageLoopExternalPump() { - g_external_message_pump = NULL; + g_external_message_pump = nullptr; } MainMessageLoopExternalPump* MainMessageLoopExternalPump::Get() { diff --git a/tests/shared/browser/resource_util_posix.cc b/tests/shared/browser/resource_util_posix.cc index d1e055702..71e73eafb 100644 --- a/tests/shared/browser/resource_util_posix.cc +++ b/tests/shared/browser/resource_util_posix.cc @@ -50,13 +50,13 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) { CefRefPtr GetBinaryResourceReader(const char* resource_name) { std::string path; if (!GetResourceDir(path)) - return NULL; + return nullptr; path.append("/"); path.append(resource_name); if (!FileExists(path.c_str())) - return NULL; + return nullptr; return CefStreamReader::CreateForFile(path); } diff --git a/tests/shared/browser/resource_util_win.cc b/tests/shared/browser/resource_util_win.cc index d5b30e555..055288cab 100644 --- a/tests/shared/browser/resource_util_win.cc +++ b/tests/shared/browser/resource_util_win.cc @@ -103,18 +103,18 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) { CefRefPtr GetBinaryResourceReader(const char* resource_name) { int resource_id = GetResourceId(resource_name); if (resource_id == 0) - return NULL; + return nullptr; DWORD dwSize; LPBYTE pBytes; if (LoadBinaryResource(resource_id, dwSize, pBytes)) { return CefStreamReader::CreateForHandler( - new CefByteReadHandler(pBytes, dwSize, NULL)); + new CefByteReadHandler(pBytes, dwSize, nullptr)); } NOTREACHED(); // The resource should be found. - return NULL; + return nullptr; } CefResourceManager::Provider* CreateBinaryResourceProvider( diff --git a/tests/shared/process_helper_mac.cc b/tests/shared/process_helper_mac.cc index 775dd4e9f..9efa2e319 100644 --- a/tests/shared/process_helper_mac.cc +++ b/tests/shared/process_helper_mac.cc @@ -46,7 +46,7 @@ int RunMain(int argc, char* argv[]) { app = new ClientAppOther(); // Execute the secondary process. - return CefExecuteProcess(main_args, app, NULL); + return CefExecuteProcess(main_args, app, nullptr); } } // namespace client diff --git a/tests/shared/renderer/client_app_renderer.h b/tests/shared/renderer/client_app_renderer.h index 38b25950d..ce206b9f3 100644 --- a/tests/shared/renderer/client_app_renderer.h +++ b/tests/shared/renderer/client_app_renderer.h @@ -34,7 +34,7 @@ class ClientAppRenderer : public ClientApp, public CefRenderProcessHandler { virtual CefRefPtr GetLoadHandler( CefRefPtr app) { - return NULL; + return nullptr; } virtual void OnContextCreated(CefRefPtr app,