libcef: Convert NULL to nullptr (see issue #2861)

This commit is contained in:
Marshall Greenblatt
2020-01-15 14:36:24 +01:00
parent c05c3e4065
commit ea63799c3e
98 changed files with 538 additions and 527 deletions

View File

@@ -178,7 +178,7 @@ class CefApp : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler() { virtual CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler() {
return NULL; return nullptr;
} }
/// ///
@@ -187,7 +187,7 @@ class CefApp : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() { virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() {
return NULL; return nullptr;
} }
/// ///
@@ -196,7 +196,7 @@ class CefApp : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() { virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() {
return NULL; return nullptr;
} }
}; };

View File

@@ -84,7 +84,7 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
// provided then printing will not be supported on the Linux platform. // provided then printing will not be supported on the Linux platform.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefPrintHandler> GetPrintHandler() { return NULL; } virtual CefRefPtr<CefPrintHandler> GetPrintHandler() { return nullptr; }
/// ///
// Called from any thread when work has been scheduled for the browser process // Called from any thread when work has been scheduled for the browser process

View File

@@ -66,7 +66,7 @@ class CefClient : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() { virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() {
return NULL; return nullptr;
} }
/// ///
@@ -74,75 +74,75 @@ class CefClient : public virtual CefBaseRefCounted {
// implementation will be used. // implementation will be used.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefDialogHandler> GetDialogHandler() { return NULL; } virtual CefRefPtr<CefDialogHandler> GetDialogHandler() { return nullptr; }
/// ///
// Return the handler for browser display state events. // Return the handler for browser display state events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() { return NULL; } virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() { return nullptr; }
/// ///
// Return the handler for download events. If no handler is returned downloads // Return the handler for download events. If no handler is returned downloads
// will not be allowed. // will not be allowed.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler() { return NULL; } virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler() { return nullptr; }
/// ///
// Return the handler for drag events. // Return the handler for drag events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefDragHandler> GetDragHandler() { return NULL; } virtual CefRefPtr<CefDragHandler> GetDragHandler() { return nullptr; }
/// ///
// Return the handler for find result events. // Return the handler for find result events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefFindHandler> GetFindHandler() { return NULL; } virtual CefRefPtr<CefFindHandler> GetFindHandler() { return nullptr; }
/// ///
// Return the handler for focus events. // Return the handler for focus events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() { return NULL; } virtual CefRefPtr<CefFocusHandler> GetFocusHandler() { return nullptr; }
/// ///
// Return the handler for JavaScript dialogs. If no handler is provided the // Return the handler for JavaScript dialogs. If no handler is provided the
// default implementation will be used. // default implementation will be used.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() { return NULL; } virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() { return nullptr; }
/// ///
// Return the handler for keyboard events. // Return the handler for keyboard events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() { return NULL; } virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() { return nullptr; }
/// ///
// Return the handler for browser life span events. // Return the handler for browser life span events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() { return NULL; } virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() { return nullptr; }
/// ///
// Return the handler for browser load status events. // Return the handler for browser load status events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() { return NULL; } virtual CefRefPtr<CefLoadHandler> GetLoadHandler() { return nullptr; }
/// ///
// Return the handler for off-screen rendering events. // Return the handler for off-screen rendering events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefRenderHandler> GetRenderHandler() { return NULL; } virtual CefRefPtr<CefRenderHandler> GetRenderHandler() { return nullptr; }
/// ///
// Return the handler for browser request events. // Return the handler for browser request events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefRequestHandler> GetRequestHandler() { return NULL; } virtual CefRefPtr<CefRequestHandler> GetRequestHandler() { return nullptr; }
/// ///
// Called when a new message is received from a different process. Return true // Called when a new message is received from a different process. Return true

View File

@@ -157,7 +157,7 @@ class CefExtensionHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefExtension> extension, CefRefPtr<CefExtension> extension,
CefRefPtr<CefBrowser> browser, CefRefPtr<CefBrowser> browser,
bool include_incognito) { bool include_incognito) {
return NULL; return nullptr;
} }
/// ///

View File

@@ -65,7 +65,7 @@ class CefRenderHandler : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefAccessibilityHandler> GetAccessibilityHandler() { virtual CefRefPtr<CefAccessibilityHandler> GetAccessibilityHandler() {
return NULL; return nullptr;
} }
/// ///

View File

@@ -93,7 +93,7 @@ class CefRenderProcessHandler : public virtual CefBaseRefCounted {
// Return the handler for browser load status events. // Return the handler for browser load status events.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() { return NULL; } virtual CefRefPtr<CefLoadHandler> GetLoadHandler() { return nullptr; }
/// ///
// Called immediately after the V8 context for a frame has been created. To // Called immediately after the V8 context for a frame has been created. To

View File

@@ -119,7 +119,7 @@ class CefRequestContextHandler : public virtual CefBaseRefCounted {
bool is_download, bool is_download,
const CefString& request_initiator, const CefString& request_initiator,
bool& disable_default_handling) { bool& disable_default_handling) {
return NULL; return nullptr;
} }
}; };

View File

@@ -145,7 +145,7 @@ class CefRequestHandler : public virtual CefBaseRefCounted {
bool is_download, bool is_download,
const CefString& request_initiator, const CefString& request_initiator,
bool& disable_default_handling) { bool& disable_default_handling) {
return NULL; return nullptr;
} }
/// ///

View File

@@ -72,7 +72,7 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefBrowser> browser, CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request) { CefRefPtr<CefRequest> request) {
return NULL; return nullptr;
} }
/// ///
@@ -109,7 +109,7 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefBrowser> browser, CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request) { CefRefPtr<CefRequest> request) {
return NULL; return nullptr;
} }
/// ///
@@ -163,7 +163,7 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request, CefRefPtr<CefRequest> request,
CefRefPtr<CefResponse> response) { CefRefPtr<CefResponse> response) {
return NULL; return nullptr;
} }
/// ///

View File

@@ -75,7 +75,7 @@ class CefWindowDelegate : public CefPanelDelegate {
virtual CefRefPtr<CefWindow> GetParentWindow(CefRefPtr<CefWindow> window, virtual CefRefPtr<CefWindow> GetParentWindow(CefRefPtr<CefWindow> window,
bool* is_menu, bool* is_menu,
bool* can_activate_menu) { bool* can_activate_menu) {
return NULL; return nullptr;
} }
/// ///

View File

@@ -927,7 +927,7 @@ void CefBrowserHostImpl::GetNavigationEntries(
CefRefPtr<CefNavigationEntryImpl> entry = CefRefPtr<CefNavigationEntryImpl> entry =
new CefNavigationEntryImpl(controller.GetEntryAtIndex(current)); new CefNavigationEntryImpl(controller.GetEntryAtIndex(current));
visitor->Visit(entry.get(), true, current, total); visitor->Visit(entry.get(), true, current, total);
entry->Detach(NULL); entry->Detach(nullptr);
} else { } else {
// Visit all entries. // Visit all entries.
bool cont = true; bool cont = true;
@@ -935,7 +935,7 @@ void CefBrowserHostImpl::GetNavigationEntries(
CefRefPtr<CefNavigationEntryImpl> entry = CefRefPtr<CefNavigationEntryImpl> entry =
new CefNavigationEntryImpl(controller.GetEntryAtIndex(i)); new CefNavigationEntryImpl(controller.GetEntryAtIndex(i));
cont = visitor->Visit(entry.get(), (i == current), i, total); cont = visitor->Visit(entry.get(), (i == current), i, total);
entry->Detach(NULL); entry->Detach(nullptr);
} }
} }
} }
@@ -1554,19 +1554,19 @@ void CefBrowserHostImpl::DestroyBrowser() {
// Disassociate the platform delegate from this browser. // Disassociate the platform delegate from this browser.
platform_delegate_->BrowserDestroyed(this); platform_delegate_->BrowserDestroyed(this);
registrar_.reset(NULL); registrar_.reset(nullptr);
content::WebContentsObserver::Observe(NULL); content::WebContentsObserver::Observe(nullptr);
if (owned_web_contents_) if (owned_web_contents_)
owned_web_contents_.reset(NULL); owned_web_contents_.reset(nullptr);
// Delete objects created by the platform delegate that may be referenced by // Delete objects created by the platform delegate that may be referenced by
// the WebContents. // the WebContents.
file_dialog_manager_.reset(NULL); file_dialog_manager_.reset(nullptr);
javascript_dialog_manager_.reset(NULL); javascript_dialog_manager_.reset(nullptr);
menu_manager_.reset(NULL); menu_manager_.reset(nullptr);
// Delete the platform delegate. // Delete the platform delegate.
platform_delegate_.reset(NULL); platform_delegate_.reset(nullptr);
CefBrowserInfoManager::GetInstance()->RemoveBrowserInfo(browser_info_); CefBrowserInfoManager::GetInstance()->RemoveBrowserInfo(browser_info_);
browser_info_->SetBrowser(nullptr); browser_info_->SetBrowser(nullptr);
@@ -2869,7 +2869,7 @@ CefBrowserHostImpl::CefBrowserHostImpl(
is_in_onsetfocus_(false), is_in_onsetfocus_(false),
focus_on_editable_field_(false), focus_on_editable_field_(false),
mouse_cursor_change_disabled_(false), mouse_cursor_change_disabled_(false),
devtools_frontend_(NULL), devtools_frontend_(nullptr),
extension_(extension) { extension_(extension) {
if (opener.get() && !platform_delegate_->IsViewsHosted()) { if (opener.get() && !platform_delegate_->IsViewsHosted()) {
// GetOpenerWindowHandle() only returns a value for non-views-hosted // GetOpenerWindowHandle() only returns a value for non-views-hosted
@@ -3082,7 +3082,7 @@ void CefBrowserHostImpl::OnTitleChange(const base::string16& title) {
void CefBrowserHostImpl::OnDevToolsWebContentsDestroyed() { void CefBrowserHostImpl::OnDevToolsWebContentsDestroyed() {
devtools_observer_.reset(); devtools_observer_.reset();
devtools_frontend_ = NULL; devtools_frontend_ = nullptr;
} }
void CefBrowserHostImpl::EnsureFileDialogManager() { void CefBrowserHostImpl::EnsureFileDialogManager() {

View File

@@ -139,7 +139,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
std::unique_ptr<CefWindowInfo> window_info(new CefWindowInfo); std::unique_ptr<CefWindowInfo> window_info(new CefWindowInfo);
#if defined(OS_WIN) #if defined(OS_WIN)
window_info->SetAsPopup(NULL, CefString()); window_info->SetAsPopup(nullptr, CefString());
#endif #endif
auto pending_popup = std::make_unique<CefBrowserInfoManager::PendingPopup>(); auto pending_popup = std::make_unique<CefBrowserInfoManager::PendingPopup>();

View File

@@ -78,7 +78,7 @@
CefBrowserMainParts::CefBrowserMainParts( CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters) const content::MainFunctionParams& parameters)
: BrowserMainParts(), devtools_delegate_(NULL) {} : BrowserMainParts(), devtools_delegate_(nullptr) {}
CefBrowserMainParts::~CefBrowserMainParts() { CefBrowserMainParts::~CefBrowserMainParts() {
constrained_window::SetConstrainedWindowViewsClient(nullptr); constrained_window::SetConstrainedWindowViewsClient(nullptr);
@@ -213,12 +213,12 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
// There should be no additional references to the global CefRequestContext // There should be no additional references to the global CefRequestContext
// during shutdown. Did you forget to release a CefBrowser reference? // during shutdown. Did you forget to release a CefBrowser reference?
DCHECK(global_request_context_->HasOneRef()); DCHECK(global_request_context_->HasOneRef());
global_request_context_ = NULL; global_request_context_ = nullptr;
} }
void CefBrowserMainParts::PostDestroyThreads() { void CefBrowserMainParts::PostDestroyThreads() {
if (extensions::ExtensionsEnabled()) { if (extensions::ExtensionsEnabled()) {
extensions::ExtensionsBrowserClient::Set(NULL); extensions::ExtensionsBrowserClient::Set(nullptr);
extensions_browser_client_.reset(); extensions_browser_client_.reset();
} }

View File

@@ -14,7 +14,7 @@ void CefBrowserMainParts::PlatformInitialize() {
HRESULT res; HRESULT res;
// Initialize common controls. // Initialize common controls.
res = CoInitialize(NULL); res = CoInitialize(nullptr);
DCHECK(SUCCEEDED(res)); DCHECK(SUCCEEDED(res));
INITCOMMONCONTROLSEX InitCtrlEx; INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
@@ -22,6 +22,6 @@ void CefBrowserMainParts::PlatformInitialize() {
InitCommonControlsEx(&InitCtrlEx); InitCommonControlsEx(&InitCtrlEx);
// Start COM stuff. // Start COM stuff.
res = OleInitialize(NULL); res = OleInitialize(nullptr);
DCHECK(SUCCEEDED(res)); DCHECK(SUCCEEDED(res));
} }

View File

@@ -51,7 +51,7 @@ void CefBrowserMessageFilter::OnGetNewRenderThreadInfo(
CefRefPtr<CefListValueImpl> listValuePtr( CefRefPtr<CefListValueImpl> listValuePtr(
new CefListValueImpl(&params->extra_info, false, false)); new CefListValueImpl(&params->extra_info, false, false));
handler->OnRenderProcessThreadCreated(listValuePtr.get()); handler->OnRenderProcessThreadCreated(listValuePtr.get());
listValuePtr->Detach(NULL); listValuePtr->Detach(nullptr);
} }
} }
} }

View File

@@ -72,8 +72,8 @@ void ChromeBrowserProcessStub::Shutdown() {
// this might cause a nested message loop to run, and we don't want pending // this might cause a nested message loop to run, and we don't want pending
// tasks to run once teardown has started. // tasks to run once teardown has started.
print_job_manager_->Shutdown(); print_job_manager_->Shutdown();
print_job_manager_.reset(NULL); print_job_manager_.reset(nullptr);
print_preview_dialog_controller_ = NULL; print_preview_dialog_controller_ = nullptr;
profile_manager_.reset(); profile_manager_.reset();
event_router_forwarder_ = nullptr; event_router_forwarder_ = nullptr;
@@ -119,17 +119,17 @@ void ChromeBrowserProcessStub::FlushLocalStateAndReply(
metrics_services_manager::MetricsServicesManager* metrics_services_manager::MetricsServicesManager*
ChromeBrowserProcessStub::GetMetricsServicesManager() { ChromeBrowserProcessStub::GetMetricsServicesManager() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
metrics::MetricsService* ChromeBrowserProcessStub::metrics_service() { metrics::MetricsService* ChromeBrowserProcessStub::metrics_service() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
rappor::RapporServiceImpl* ChromeBrowserProcessStub::rappor_service() { rappor::RapporServiceImpl* ChromeBrowserProcessStub::rappor_service() {
// Called from PluginInfoHostImpl::ReportMetrics. // Called from PluginInfoHostImpl::ReportMetrics.
return NULL; return nullptr;
} }
SystemNetworkContextManager* SystemNetworkContextManager*
@@ -141,12 +141,12 @@ ChromeBrowserProcessStub::system_network_context_manager() {
network::NetworkQualityTracker* network::NetworkQualityTracker*
ChromeBrowserProcessStub::network_quality_tracker() { ChromeBrowserProcessStub::network_quality_tracker() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
WatchDogThread* ChromeBrowserProcessStub::watchdog_thread() { WatchDogThread* ChromeBrowserProcessStub::watchdog_thread() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
ProfileManager* ChromeBrowserProcessStub::profile_manager() { ProfileManager* ChromeBrowserProcessStub::profile_manager() {
@@ -171,17 +171,17 @@ PrefService* ChromeBrowserProcessStub::local_state() {
scoped_refptr<network::SharedURLLoaderFactory> scoped_refptr<network::SharedURLLoaderFactory>
ChromeBrowserProcessStub::shared_url_loader_factory() { ChromeBrowserProcessStub::shared_url_loader_factory() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
variations::VariationsService* ChromeBrowserProcessStub::variations_service() { variations::VariationsService* ChromeBrowserProcessStub::variations_service() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() { BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
extensions::EventRouterForwarder* extensions::EventRouterForwarder*
@@ -192,13 +192,13 @@ ChromeBrowserProcessStub::extension_event_router_forwarder() {
NotificationUIManager* ChromeBrowserProcessStub::notification_ui_manager() { NotificationUIManager* ChromeBrowserProcessStub::notification_ui_manager() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
NotificationPlatformBridge* NotificationPlatformBridge*
ChromeBrowserProcessStub::notification_platform_bridge() { ChromeBrowserProcessStub::notification_platform_bridge() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
policy::ChromeBrowserPolicyConnector* policy::ChromeBrowserPolicyConnector*
@@ -216,12 +216,12 @@ policy::PolicyService* ChromeBrowserProcessStub::policy_service() {
IconManager* ChromeBrowserProcessStub::icon_manager() { IconManager* ChromeBrowserProcessStub::icon_manager() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() { GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
void ChromeBrowserProcessStub::CreateDevToolsProtocolHandler() { void ChromeBrowserProcessStub::CreateDevToolsProtocolHandler() {
@@ -263,7 +263,7 @@ ChromeBrowserProcessStub::background_printing_manager() {
IntranetRedirectDetector* IntranetRedirectDetector*
ChromeBrowserProcessStub::intranet_redirect_detector() { ChromeBrowserProcessStub::intranet_redirect_detector() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
const std::string& ChromeBrowserProcessStub::GetApplicationLocale() { const std::string& ChromeBrowserProcessStub::GetApplicationLocale() {
@@ -277,17 +277,17 @@ void ChromeBrowserProcessStub::SetApplicationLocale(const std::string& locale) {
DownloadStatusUpdater* ChromeBrowserProcessStub::download_status_updater() { DownloadStatusUpdater* ChromeBrowserProcessStub::download_status_updater() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
DownloadRequestLimiter* ChromeBrowserProcessStub::download_request_limiter() { DownloadRequestLimiter* ChromeBrowserProcessStub::download_request_limiter() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
BackgroundModeManager* ChromeBrowserProcessStub::background_mode_manager() { BackgroundModeManager* ChromeBrowserProcessStub::background_mode_manager() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
void ChromeBrowserProcessStub::set_background_mode_manager_for_test( void ChromeBrowserProcessStub::set_background_mode_manager_for_test(
@@ -297,35 +297,35 @@ void ChromeBrowserProcessStub::set_background_mode_manager_for_test(
StatusTray* ChromeBrowserProcessStub::status_tray() { StatusTray* ChromeBrowserProcessStub::status_tray() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
safe_browsing::SafeBrowsingService* safe_browsing::SafeBrowsingService*
ChromeBrowserProcessStub::safe_browsing_service() { ChromeBrowserProcessStub::safe_browsing_service() {
return NULL; return nullptr;
} }
safe_browsing::ClientSideDetectionService* safe_browsing::ClientSideDetectionService*
ChromeBrowserProcessStub::safe_browsing_detection_service() { ChromeBrowserProcessStub::safe_browsing_detection_service() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
subresource_filter::RulesetService* subresource_filter::RulesetService*
ChromeBrowserProcessStub::subresource_filter_ruleset_service() { ChromeBrowserProcessStub::subresource_filter_ruleset_service() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
optimization_guide::OptimizationGuideService* optimization_guide::OptimizationGuideService*
ChromeBrowserProcessStub::optimization_guide_service() { ChromeBrowserProcessStub::optimization_guide_service() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
StartupData* ChromeBrowserProcessStub::startup_data() { StartupData* ChromeBrowserProcessStub::startup_data() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
@@ -335,38 +335,38 @@ void ChromeBrowserProcessStub::StartAutoupdateTimer() {}
component_updater::ComponentUpdateService* component_updater::ComponentUpdateService*
ChromeBrowserProcessStub::component_updater() { ChromeBrowserProcessStub::component_updater() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
MediaFileSystemRegistry* MediaFileSystemRegistry*
ChromeBrowserProcessStub::media_file_system_registry() { ChromeBrowserProcessStub::media_file_system_registry() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() { WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
network_time::NetworkTimeTracker* network_time::NetworkTimeTracker*
ChromeBrowserProcessStub::network_time_tracker() { ChromeBrowserProcessStub::network_time_tracker() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() { gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() { resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
resource_coordinator::ResourceCoordinatorParts* resource_coordinator::ResourceCoordinatorParts*
ChromeBrowserProcessStub::resource_coordinator_parts() { ChromeBrowserProcessStub::resource_coordinator_parts() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }

View File

@@ -36,7 +36,7 @@ Profile::ProfileType ChromeProfileStub::GetProfileType() const {
Profile* ChromeProfileStub::GetOffTheRecordProfile() { Profile* ChromeProfileStub::GetOffTheRecordProfile() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
void ChromeProfileStub::DestroyOffTheRecordProfile() { void ChromeProfileStub::DestroyOffTheRecordProfile() {
@@ -70,12 +70,12 @@ bool ChromeProfileStub::IsLegacySupervised() const {
ExtensionSpecialStoragePolicy* ExtensionSpecialStoragePolicy*
ChromeProfileStub::GetExtensionSpecialStoragePolicy() { ChromeProfileStub::GetExtensionSpecialStoragePolicy() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
PrefService* ChromeProfileStub::GetOffTheRecordPrefs() { PrefService* ChromeProfileStub::GetOffTheRecordPrefs() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
bool ChromeProfileStub::IsSameProfile(Profile* profile) { bool ChromeProfileStub::IsSameProfile(Profile* profile) {

View File

@@ -264,7 +264,7 @@ class CefSelectClientCertificateCallbackImpl
// If Select has not been called, call it with NULL to continue without any // If Select has not been called, call it with NULL to continue without any
// client certificate. // client certificate.
if (delegate_) if (delegate_)
DoSelect(NULL); DoSelect(nullptr);
} }
void Select(CefRefPtr<CefX509Certificate> cert) override { void Select(CefRefPtr<CefX509Certificate> cert) override {
@@ -393,7 +393,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
// Extensions have the same process type as renderers. // Extensions have the same process type as renderers.
if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) { if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) {
static breakpad::CrashHandlerHostLinux* crash_handler = NULL; static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler) if (!crash_handler)
crash_handler = CreateCrashHandlerHost("extension"); crash_handler = CreateCrashHandlerHost("extension");
return crash_handler->GetDeathSignalSocket(); return crash_handler->GetDeathSignalSocket();
@@ -403,21 +403,21 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
command_line.GetSwitchValueASCII(switches::kProcessType); command_line.GetSwitchValueASCII(switches::kProcessType);
if (process_type == switches::kRendererProcess) { if (process_type == switches::kRendererProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = NULL; static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler) if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type); crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket(); return crash_handler->GetDeathSignalSocket();
} }
if (process_type == switches::kPpapiPluginProcess) { if (process_type == switches::kPpapiPluginProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = NULL; static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler) if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type); crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket(); return crash_handler->GetDeathSignalSocket();
} }
if (process_type == switches::kGpuProcess) { if (process_type == switches::kGpuProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = NULL; static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler) if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type); crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket(); return crash_handler->GetDeathSignalSocket();
@@ -501,7 +501,8 @@ void BindPluginInfoHost(
} // namespace } // namespace
CefContentBrowserClient::CefContentBrowserClient() : browser_main_parts_(NULL) { CefContentBrowserClient::CefContentBrowserClient()
: browser_main_parts_(nullptr) {
plugin_service_filter_.reset(new CefPluginServiceFilter); plugin_service_filter_.reset(new CefPluginServiceFilter);
content::PluginServiceImpl::GetInstance()->SetFilter( content::PluginServiceImpl::GetInstance()->SetFilter(
plugin_service_filter_.get()); plugin_service_filter_.get());
@@ -835,7 +836,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
CefRefPtr<CefCommandLineImpl> commandLinePtr( CefRefPtr<CefCommandLineImpl> commandLinePtr(
new CefCommandLineImpl(command_line, false, false)); new CefCommandLineImpl(command_line, false, false));
handler->OnBeforeChildProcessLaunch(commandLinePtr.get()); handler->OnBeforeChildProcessLaunch(commandLinePtr.get());
commandLinePtr->Detach(NULL); commandLinePtr->Detach(nullptr);
} }
} }
} }
@@ -902,7 +903,7 @@ CefContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
if (command_line->HasSwitch(switches::kEnableSpeechInput)) if (command_line->HasSwitch(switches::kEnableSpeechInput))
return new CefSpeechRecognitionManagerDelegate(); return new CefSpeechRecognitionManagerDelegate();
return NULL; return nullptr;
} }
content::GeneratedCodeCacheSettings content::GeneratedCodeCacheSettings

View File

@@ -49,7 +49,7 @@
namespace { namespace {
CefContext* g_context = NULL; CefContext* g_context = nullptr;
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
// When the process terminates check if CefShutdown() has been called. // When the process terminates check if CefShutdown() has been called.
@@ -201,7 +201,7 @@ int CefExecuteProcess(const CefMainArgs& args,
// Execute the secondary process. // Execute the secondary process.
#if defined(OS_WIN) #if defined(OS_WIN)
sandbox::SandboxInterfaceInfo sandbox_info = {0}; sandbox::SandboxInterfaceInfo sandbox_info = {0};
if (windows_sandbox_info == NULL) { if (windows_sandbox_info == nullptr) {
content::InitializeSandboxInfo(&sandbox_info); content::InitializeSandboxInfo(&sandbox_info);
windows_sandbox_info = &sandbox_info; windows_sandbox_info = &sandbox_info;
} }
@@ -270,7 +270,7 @@ void CefShutdown() {
// Delete the global context object. // Delete the global context object.
delete g_context; delete g_context;
g_context = NULL; g_context = nullptr;
} }
void CefDoMessageLoopWork() { void CefDoMessageLoopWork() {
@@ -391,7 +391,7 @@ bool CefContext::Initialize(const CefMainArgs& args,
content::ContentMainParams params(main_delegate_.get()); content::ContentMainParams params(main_delegate_.get());
#if defined(OS_WIN) #if defined(OS_WIN)
sandbox::SandboxInterfaceInfo sandbox_info = {0}; sandbox::SandboxInterfaceInfo sandbox_info = {0};
if (windows_sandbox_info == NULL) { if (windows_sandbox_info == nullptr) {
content::InitializeSandboxInfo(&sandbox_info); content::InitializeSandboxInfo(&sandbox_info);
windows_sandbox_info = &sandbox_info; windows_sandbox_info = &sandbox_info;
settings_.no_sandbox = true; settings_.no_sandbox = true;
@@ -481,7 +481,7 @@ void CefContext::Shutdown() {
FinalizeShutdown(); FinalizeShutdown();
} else { } else {
// Finish shutdown on the current thread, which should be the UI thread. // Finish shutdown on the current thread, which should be the UI thread.
FinishShutdownOnUIThread(NULL); FinishShutdownOnUIThread(nullptr);
FinalizeShutdown(); FinalizeShutdown();
} }
@@ -513,7 +513,7 @@ SkColor CefContext::GetBackgroundColor(
CefTraceSubscriber* CefContext::GetTraceSubscriber() { CefTraceSubscriber* CefContext::GetTraceSubscriber() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (shutting_down_) if (shutting_down_)
return NULL; return nullptr;
if (!trace_subscriber_.get()) if (!trace_subscriber_.get())
trace_subscriber_.reset(new CefTraceSubscriber()); trace_subscriber_.reset(new CefTraceSubscriber());
return trace_subscriber_.get(); return trace_subscriber_.get();
@@ -607,7 +607,7 @@ void CefContext::FinishShutdownOnUIThread(
observer.OnContextDestroyed(); observer.OnContextDestroyed();
if (trace_subscriber_.get()) if (trace_subscriber_.get())
trace_subscriber_.reset(NULL); trace_subscriber_.reset(nullptr);
static_cast<ChromeBrowserProcessStub*>(g_browser_process)->Shutdown(); static_cast<ChromeBrowserProcessStub*>(g_browser_process)->Shutdown();
@@ -631,11 +631,11 @@ void CefContext::FinalizeShutdown() {
// Shut down the content runner. // Shut down the content runner.
service_manager::MainShutdown(*sm_main_params_); service_manager::MainShutdown(*sm_main_params_);
browser_info_manager_.reset(NULL); browser_info_manager_.reset(nullptr);
sm_main_params_.reset(NULL); sm_main_params_.reset(nullptr);
sm_main_delegate_.reset(NULL); sm_main_delegate_.reset(nullptr);
main_delegate_.reset(NULL); main_delegate_.reset(nullptr);
delete g_browser_process; delete g_browser_process;
g_browser_process = NULL; g_browser_process = nullptr;
} }

View File

@@ -10,7 +10,7 @@ CefContextMenuParamsImpl::CefContextMenuParamsImpl(
content::ContextMenuParams* value) content::ContextMenuParams* value)
: CefValueBase<CefContextMenuParams, content::ContextMenuParams>( : CefValueBase<CefContextMenuParams, content::ContextMenuParams>(
value, value,
NULL, nullptr,
kOwnerNoDelete, kOwnerNoDelete,
true, true,
new CefValueControllerNonThreadSafe()) { new CefValueControllerNonThreadSafe()) {

View File

@@ -154,12 +154,13 @@ void CefDevToolsFileManager::FileSavedAs(const std::string& url,
base::Value url_value(url); base::Value url_value(url);
base::Value file_system_path_value(file_system_path); base::Value file_system_path_value(file_system_path);
CallClientFunction("DevToolsAPI.savedURL", &url_value, CallClientFunction("DevToolsAPI.savedURL", &url_value,
&file_system_path_value, NULL); &file_system_path_value, nullptr);
} }
void CefDevToolsFileManager::CanceledFileSaveAs(const std::string& url) { void CefDevToolsFileManager::CanceledFileSaveAs(const std::string& url) {
base::Value url_value(url); base::Value url_value(url);
CallClientFunction("DevToolsAPI.canceledSaveURL", &url_value, NULL, NULL); CallClientFunction("DevToolsAPI.canceledSaveURL", &url_value, nullptr,
nullptr);
} }
void CefDevToolsFileManager::Append(const std::string& url, void CefDevToolsFileManager::Append(const std::string& url,
@@ -175,7 +176,7 @@ void CefDevToolsFileManager::Append(const std::string& url,
void CefDevToolsFileManager::AppendedTo(const std::string& url) { void CefDevToolsFileManager::AppendedTo(const std::string& url) {
base::Value url_value(url); base::Value url_value(url);
CallClientFunction("DevToolsAPI.appendedToURL", &url_value, NULL, NULL); CallClientFunction("DevToolsAPI.appendedToURL", &url_value, nullptr, nullptr);
} }
void CefDevToolsFileManager::CallClientFunction( void CefDevToolsFileManager::CallClientFunction(

View File

@@ -209,7 +209,7 @@ void CefDevToolsFrontend::DisconnectFromTarget() {
if (!agent_host_) if (!agent_host_)
return; return;
agent_host_->DetachClient(this); agent_host_->DetachClient(this);
agent_host_ = NULL; agent_host_ = nullptr;
} }
CefDevToolsFrontend::CefDevToolsFrontend( CefDevToolsFrontend::CefDevToolsFrontend(
@@ -274,8 +274,8 @@ void CefDevToolsFrontend::WebContentsDestroyed() {
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
const std::string& message) { const std::string& message) {
std::string method; std::string method;
base::ListValue* params = NULL; base::ListValue* params = nullptr;
base::DictionaryValue* dict = NULL; base::DictionaryValue* dict = nullptr;
base::Optional<base::Value> parsed_message = base::JSONReader::Read(message); base::Optional<base::Value> parsed_message = base::JSONReader::Read(message);
if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || if (!parsed_message || !parsed_message->GetAsDictionary(&dict) ||
!dict->GetString("method", &method)) { !dict->GetString("method", &method)) {

View File

@@ -12,7 +12,7 @@
CefDownloadItemImpl::CefDownloadItemImpl(download::DownloadItem* value) CefDownloadItemImpl::CefDownloadItemImpl(download::DownloadItem* value)
: CefValueBase<CefDownloadItem, download::DownloadItem>( : CefValueBase<CefDownloadItem, download::DownloadItem>(
value, value,
NULL, nullptr,
kOwnerNoDelete, kOwnerNoDelete,
true, true,
new CefValueControllerNonThreadSafe()) { new CefValueControllerNonThreadSafe()) {

View File

@@ -34,7 +34,7 @@ CefRefPtr<CefDownloadHandler> GetDownloadHandler(
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) if (client.get())
return client->GetDownloadHandler(); return client->GetDownloadHandler();
return NULL; return nullptr;
} }
// CefBeforeDownloadCallback implementation. // CefBeforeDownloadCallback implementation.
@@ -262,7 +262,7 @@ CefDownloadManagerDelegate::CefDownloadManagerDelegate(DownloadManager* manager)
CefDownloadManagerDelegate::~CefDownloadManagerDelegate() { CefDownloadManagerDelegate::~CefDownloadManagerDelegate() {
if (manager_) { if (manager_) {
manager_->SetDelegate(NULL); manager_->SetDelegate(nullptr);
manager_->RemoveObserver(this); manager_->RemoveObserver(this);
} }
@@ -284,7 +284,7 @@ void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) {
handler->OnDownloadUpdated(browser.get(), download_item.get(), callback); handler->OnDownloadUpdated(browser.get(), download_item.get(), callback);
download_item->Detach(NULL); download_item->Detach(nullptr);
} }
} }
@@ -339,10 +339,10 @@ void CefDownloadManagerDelegate::OnDownloadCreated(DownloadManager* manager,
void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) { void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) {
DCHECK_EQ(manager, manager_); DCHECK_EQ(manager, manager_);
manager->SetDelegate(NULL); manager->SetDelegate(nullptr);
manager->RemoveObserver(this); manager->RemoveObserver(this);
manager_ptr_factory_.InvalidateWeakPtrs(); manager_ptr_factory_.InvalidateWeakPtrs();
manager_ = NULL; manager_ = nullptr;
} }
bool CefDownloadManagerDelegate::DetermineDownloadTarget( bool CefDownloadManagerDelegate::DetermineDownloadTarget(
@@ -377,7 +377,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
handler->OnBeforeDownload(browser.get(), download_item.get(), handler->OnBeforeDownload(browser.get(), download_item.get(),
suggested_name.value(), callbackObj); suggested_name.value(), callbackObj);
download_item->Detach(NULL); download_item->Detach(nullptr);
} }
return true; return true;

View File

@@ -110,7 +110,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
return set_init_result(VALIDATION_FAILURE); return set_init_result(VALIDATION_FAILURE);
// |details| are not optional. // |details| are not optional.
base::DictionaryValue* details_value = NULL; base::DictionaryValue* details_value = nullptr;
if (!args_->GetDictionary(1, &details_value)) if (!args_->GetDictionary(1, &details_value))
return set_init_result(VALIDATION_FAILURE); return set_init_result(VALIDATION_FAILURE);
std::unique_ptr<InjectDetails> details(new InjectDetails()); std::unique_ptr<InjectDetails> details(new InjectDetails());
@@ -282,7 +282,8 @@ bool TabsSetZoomFunction::RunAsync() {
zoom::ZoomController* zoom_controller = zoom::ZoomController* zoom_controller =
zoom::ZoomController::FromWebContents(web_contents); zoom::ZoomController::FromWebContents(web_contents);
double zoom_level = params->zoom_factor > 0 double zoom_level =
params->zoom_factor > 0
? blink::PageZoomFactorToZoomLevel(params->zoom_factor) ? blink::PageZoomFactorToZoomLevel(params->zoom_factor)
: zoom_controller->GetDefaultZoomLevel(); : zoom_controller->GetDefaultZoomLevel();
@@ -384,8 +385,9 @@ bool TabsGetZoomSettingsFunction::RunAsync() {
zoom::ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); zoom::ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode();
api::tabs::ZoomSettings zoom_settings; api::tabs::ZoomSettings zoom_settings;
ZoomModeToZoomSettings(zoom_mode, &zoom_settings); ZoomModeToZoomSettings(zoom_mode, &zoom_settings);
zoom_settings.default_zoom_factor.reset(new double( zoom_settings.default_zoom_factor.reset(
blink::PageZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); new double(blink::PageZoomLevelToZoomFactor(
zoom_controller->GetDefaultZoomLevel())));
results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings);
SendResponse(true); SendResponse(true);

View File

@@ -42,7 +42,7 @@ content::WebContents* GetFullPageGuestForOwnerContents(
if (plugin_guest) if (plugin_guest)
return plugin_guest->web_contents(); return plugin_guest->web_contents();
} }
return NULL; return nullptr;
} }
void GetAllGuestsForOwnerContents(content::WebContents* owner, void GetAllGuestsForOwnerContents(content::WebContents* owner,
@@ -77,7 +77,7 @@ CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForFrameRoute(
content::RenderFrameHost::FromID(render_process_id, render_routing_id); content::RenderFrameHost::FromID(render_process_id, render_routing_id);
if (host) if (host)
return GetOwnerBrowserForHost(host, is_guest_view); return GetOwnerBrowserForHost(host, is_guest_view);
return NULL; return nullptr;
} else { } else {
// Use the thread-safe approach. // Use the thread-safe approach.
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
@@ -93,7 +93,7 @@ CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForFrameRoute(
} }
return browser; return browser;
} }
return NULL; return nullptr;
} }
} }

View File

@@ -373,7 +373,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
create_params.window_info.reset(new CefWindowInfo); create_params.window_info.reset(new CefWindowInfo);
#if defined(OS_WIN) #if defined(OS_WIN)
create_params.window_info->SetAsPopup(NULL, CefString()); create_params.window_info->SetAsPopup(nullptr, CefString());
#endif #endif
// Start with the active browser's settings. // Start with the active browser's settings.

View File

@@ -27,7 +27,7 @@ content::JavaScriptDialogManager*
CefExtensionHostDelegate::GetJavaScriptDialogManager() { CefExtensionHostDelegate::GetJavaScriptDialogManager() {
// Never routed here from CefBrowserHostImpl. // Never routed here from CefBrowserHostImpl.
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
void CefExtensionHostDelegate::CreateTab( void CefExtensionHostDelegate::CreateTab(

View File

@@ -63,11 +63,12 @@ namespace {
std::unique_ptr<base::DictionaryValue> ParseManifest( std::unique_ptr<base::DictionaryValue> ParseManifest(
const std::string& manifest_contents) { const std::string& manifest_contents) {
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); std::unique_ptr<base::Value> manifest(
deserializer.Deserialize(nullptr, nullptr));
if (!manifest.get() || !manifest->is_dict()) { if (!manifest.get() || !manifest->is_dict()) {
LOG(ERROR) << "Failed to parse extension manifest."; LOG(ERROR) << "Failed to parse extension manifest.";
return NULL; return nullptr;
} }
// Transfer ownership to the caller. // Transfer ownership to the caller.
return base::WrapUnique( return base::WrapUnique(

View File

@@ -27,7 +27,7 @@ AppViewGuestDelegate* CefExtensionsAPIClient::CreateAppViewGuestDelegate()
const { const {
// TODO(extensions): Implement to support Apps. // TODO(extensions): Implement to support Apps.
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
std::unique_ptr<guest_view::GuestViewManagerDelegate> std::unique_ptr<guest_view::GuestViewManagerDelegate>

View File

@@ -65,7 +65,7 @@ bool CefExtensionsBrowserClient::AreExtensionsDisabled(
} }
bool CefExtensionsBrowserClient::IsValidContext(BrowserContext* context) { bool CefExtensionsBrowserClient::IsValidContext(BrowserContext* context) {
return GetOriginalContext(context) != NULL; return GetOriginalContext(context) != nullptr;
} }
bool CefExtensionsBrowserClient::IsSameContext(BrowserContext* first, bool CefExtensionsBrowserClient::IsSameContext(BrowserContext* first,
@@ -83,7 +83,7 @@ bool CefExtensionsBrowserClient::HasOffTheRecordContext(
BrowserContext* CefExtensionsBrowserClient::GetOffTheRecordContext( BrowserContext* CefExtensionsBrowserClient::GetOffTheRecordContext(
BrowserContext* context) { BrowserContext* context) {
return NULL; return nullptr;
} }
BrowserContext* CefExtensionsBrowserClient::GetOriginalContext( BrowserContext* CefExtensionsBrowserClient::GetOriginalContext(
@@ -159,7 +159,7 @@ void CefExtensionsBrowserClient::GetEarlyExtensionPrefsObservers(
ProcessManagerDelegate* CefExtensionsBrowserClient::GetProcessManagerDelegate() ProcessManagerDelegate* CefExtensionsBrowserClient::GetProcessManagerDelegate()
const { const {
return NULL; return nullptr;
} }
std::unique_ptr<ExtensionHostDelegate> std::unique_ptr<ExtensionHostDelegate>
@@ -291,7 +291,7 @@ void CefExtensionsBrowserClient::BroadcastEventToRenderers(
ExtensionCache* CefExtensionsBrowserClient::GetExtensionCache() { ExtensionCache* CefExtensionsBrowserClient::GetExtensionCache() {
// Only used by Chrome via ExtensionService. // Only used by Chrome via ExtensionService.
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
bool CefExtensionsBrowserClient::IsBackgroundUpdateAllowed() { bool CefExtensionsBrowserClient::IsBackgroundUpdateAllowed() {
@@ -311,7 +311,7 @@ CefExtensionsBrowserClient::GetExtensionWebContentsObserver(
KioskDelegate* CefExtensionsBrowserClient::GetKioskDelegate() { KioskDelegate* CefExtensionsBrowserClient::GetKioskDelegate() {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
bool CefExtensionsBrowserClient::IsLockScreenContext( bool CefExtensionsBrowserClient::IsLockScreenContext(

View File

@@ -61,7 +61,7 @@ ValueStore::ReadResult CefValueStore::Get(
auto settings = std::make_unique<base::DictionaryValue>(); auto settings = std::make_unique<base::DictionaryValue>();
for (std::vector<std::string>::const_iterator it = keys.begin(); for (std::vector<std::string>::const_iterator it = keys.begin();
it != keys.end(); ++it) { it != keys.end(); ++it) {
base::Value* value = NULL; base::Value* value = nullptr;
if (storage_.GetWithoutPathExpansion(*it, &value)) { if (storage_.GetWithoutPathExpansion(*it, &value)) {
settings->SetWithoutPathExpansion(*it, value->CreateDeepCopy()); settings->SetWithoutPathExpansion(*it, value->CreateDeepCopy());
} }
@@ -94,7 +94,7 @@ ValueStore::WriteResult CefValueStore::Set(
std::unique_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList()); std::unique_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList());
for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd(); for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd();
it.Advance()) { it.Advance()) {
base::Value* old_value = NULL; base::Value* old_value = nullptr;
if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) || if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) ||
!old_value->Equals(&it.value())) { !old_value->Equals(&it.value())) {
changes->push_back(ValueStoreChange( changes->push_back(ValueStoreChange(

View File

@@ -156,7 +156,7 @@ CefFileDialogManager::~CefFileDialogManager() {}
void CefFileDialogManager::Destroy() { void CefFileDialogManager::Destroy() {
DCHECK(!file_chooser_pending_); DCHECK(!file_chooser_pending_);
runner_.reset(NULL); runner_.reset(nullptr);
} }
void CefFileDialogManager::RunFileDialog( void CefFileDialogManager::RunFileDialog(

View File

@@ -72,7 +72,7 @@ CefJavaScriptDialogManager::~CefJavaScriptDialogManager() {}
void CefJavaScriptDialogManager::Destroy() { void CefJavaScriptDialogManager::Destroy() {
if (runner_.get()) { if (runner_.get()) {
runner_.reset(NULL); runner_.reset(nullptr);
} }
} }

View File

@@ -19,7 +19,7 @@ const blink::MediaStreamDevice* FindDefaultDeviceWithId(
const blink::MediaStreamDevices& devices, const blink::MediaStreamDevices& devices,
const std::string& device_id) { const std::string& device_id) {
if (devices.empty()) if (devices.empty())
return NULL; return nullptr;
blink::MediaStreamDevices::const_iterator iter = devices.begin(); blink::MediaStreamDevices::const_iterator iter = devices.begin();
for (; iter != devices.end(); ++iter) { for (; iter != devices.end(); ++iter) {

View File

@@ -91,7 +91,7 @@ CefMenuManager::CefMenuManager(CefBrowserHostImpl* browser,
: content::WebContentsObserver(browser->web_contents()), : content::WebContentsObserver(browser->web_contents()),
browser_(browser), browser_(browser),
runner_(std::move(runner)), runner_(std::move(runner)),
custom_menu_callback_(NULL), custom_menu_callback_(nullptr),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
DCHECK(web_contents()); DCHECK(web_contents());
model_ = new CefMenuModelImpl(this, nullptr, false); model_ = new CefMenuModelImpl(this, nullptr, false);
@@ -100,13 +100,13 @@ CefMenuManager::CefMenuManager(CefBrowserHostImpl* browser,
CefMenuManager::~CefMenuManager() { CefMenuManager::~CefMenuManager() {
// The model may outlive the delegate if the context menu is visible when the // The model may outlive the delegate if the context menu is visible when the
// application is closed. // application is closed.
model_->set_delegate(NULL); model_->set_delegate(nullptr);
} }
void CefMenuManager::Destroy() { void CefMenuManager::Destroy() {
CancelContextMenu(); CancelContextMenu();
if (runner_) if (runner_)
runner_.reset(NULL); runner_.reset(nullptr);
} }
bool CefMenuManager::IsShowingContextMenu() { bool CefMenuManager::IsShowingContextMenu() {
@@ -166,13 +166,13 @@ bool CefMenuManager::CreateContextMenu(
} else { } else {
// Callback should not be executed if the handler returns false. // Callback should not be executed if the handler returns false.
DCHECK(custom_menu_callback_); DCHECK(custom_menu_callback_);
custom_menu_callback_ = NULL; custom_menu_callback_ = nullptr;
callbackImpl->Disconnect(); callbackImpl->Disconnect();
} }
} }
// Do not keep references to the parameters in the callback. // Do not keep references to the parameters in the callback.
paramsPtr->Detach(NULL); paramsPtr->Detach(nullptr);
DCHECK(paramsPtr->HasOneRef()); DCHECK(paramsPtr->HasOneRef());
DCHECK(model_->VerifyRefCount()); DCHECK(model_->VerifyRefCount());
@@ -214,7 +214,7 @@ void CefMenuManager::ExecuteCommand(CefRefPtr<CefMenuModelImpl> source,
event_flags); event_flags);
// Do not keep references to the parameters in the callback. // Do not keep references to the parameters in the callback.
paramsPtr->Detach(NULL); paramsPtr->Detach(nullptr);
DCHECK(paramsPtr->HasOneRef()); DCHECK(paramsPtr->HasOneRef());
if (handled) if (handled)
@@ -280,7 +280,7 @@ void CefMenuManager::ExecuteCommandCallback(int command_id,
if (command_id != kInvalidCommandId) if (command_id != kInvalidCommandId)
ExecuteCommand(model_, command_id, event_flags); ExecuteCommand(model_, command_id, event_flags);
MenuClosed(model_); MenuClosed(model_);
custom_menu_callback_ = NULL; custom_menu_callback_ = nullptr;
} }
void CefMenuManager::CreateDefaultModel() { void CefMenuManager::CreateDefaultModel() {

View File

@@ -107,7 +107,7 @@ class CefSimpleMenuModel : public ui::MenuModel {
bool GetIconAt(int index, gfx::Image* icon) const override { return false; } bool GetIconAt(int index, gfx::Image* icon) const override { return false; }
ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const override { ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const override {
return NULL; return nullptr;
} }
bool IsEnabledAt(int index) const override { bool IsEnabledAt(int index) const override {
@@ -128,7 +128,7 @@ class CefSimpleMenuModel : public ui::MenuModel {
CefRefPtr<CefMenuModel> submenu = impl_->GetSubMenuAt(index); CefRefPtr<CefMenuModel> submenu = impl_->GetSubMenuAt(index);
if (submenu.get()) if (submenu.get())
return static_cast<CefMenuModelImpl*>(submenu.get())->model(); return static_cast<CefMenuModelImpl*>(submenu.get())->model();
return NULL; return nullptr;
} }
void MouseOutsideMenu(const gfx::Point& screen_point) override { void MouseOutsideMenu(const gfx::Point& screen_point) override {
@@ -304,7 +304,7 @@ bool CefMenuModelImpl::AddRadioItem(int command_id,
CefRefPtr<CefMenuModel> CefMenuModelImpl::AddSubMenu(int command_id, CefRefPtr<CefMenuModel> CefMenuModelImpl::AddSubMenu(int command_id,
const CefString& label) { const CefString& label) {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
Item item(MENUITEMTYPE_SUBMENU, command_id, label, kInvalidGroupId); Item item(MENUITEMTYPE_SUBMENU, command_id, label, kInvalidGroupId);
item.submenu_ = new CefMenuModelImpl(delegate_, menu_model_delegate_, true); item.submenu_ = new CefMenuModelImpl(delegate_, menu_model_delegate_, true);
@@ -360,7 +360,7 @@ CefRefPtr<CefMenuModel> CefMenuModelImpl::InsertSubMenuAt(
int command_id, int command_id,
const CefString& label) { const CefString& label) {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
Item item(MENUITEMTYPE_SUBMENU, command_id, label, kInvalidGroupId); Item item(MENUITEMTYPE_SUBMENU, command_id, label, kInvalidGroupId);
item.submenu_ = new CefMenuModelImpl(delegate_, menu_model_delegate_, true); item.submenu_ = new CefMenuModelImpl(delegate_, menu_model_delegate_, true);
@@ -490,11 +490,11 @@ CefRefPtr<CefMenuModel> CefMenuModelImpl::GetSubMenu(int command_id) {
CefRefPtr<CefMenuModel> CefMenuModelImpl::GetSubMenuAt(int index) { CefRefPtr<CefMenuModel> CefMenuModelImpl::GetSubMenuAt(int index) {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
if (index >= 0 && index < static_cast<int>(items_.size())) if (index >= 0 && index < static_cast<int>(items_.size()))
return items_[index].submenu_.get(); return items_[index].submenu_.get();
return NULL; return nullptr;
} }
bool CefMenuModelImpl::IsVisible(int command_id) { bool CefMenuModelImpl::IsVisible(int command_id) {

View File

@@ -382,7 +382,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateWheelEvent(
CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle( CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const { const content::NativeWebKeyboardEvent& event) const {
if (!event.os_event) if (!event.os_event)
return NULL; return nullptr;
return const_cast<CefEventHandle>( return const_cast<CefEventHandle>(
static_cast<CefEventHandle>(event.os_event->native_event())); static_cast<CefEventHandle>(event.os_event->native_event()));
} }

View File

@@ -32,7 +32,7 @@ void Menu2::CancelMenu() {
} }
void Menu2::Rebuild() { void Menu2::Rebuild() {
wrapper_->Rebuild(NULL); wrapper_->Rebuild(nullptr);
} }
void Menu2::UpdateStates() { void Menu2::UpdateStates() {

View File

@@ -26,7 +26,7 @@ bool CefMenuRunnerLinux::RunContextMenu(
if (!browser->IsWindowless()) if (!browser->IsWindowless())
parent_widget = browser->GetWindowWidget(); parent_widget = browser->GetWindowWidget();
menu_->RunMenuAt(parent_widget, NULL, gfx::Rect(screen_point, gfx::Size()), menu_->RunMenuAt(parent_widget, nullptr, gfx::Rect(screen_point, gfx::Size()),
views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE); views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE);
return true; return true;

View File

@@ -18,8 +18,8 @@ bool CefMenuRunnerWin::RunContextMenu(
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) { const content::ContextMenuParams& params) {
// Create a menu based on the model. // Create a menu based on the model.
menu_.reset(new views::CefNativeMenuWin(model->model(), NULL)); menu_.reset(new views::CefNativeMenuWin(model->model(), nullptr));
menu_->Rebuild(NULL); menu_->Rebuild(nullptr);
// Make sure events can be pumped while the menu is up. // Make sure events can be pumped while the menu is up.
base::MessageLoopCurrent::ScopedNestableTaskAllower allow; base::MessageLoopCurrent::ScopedNestableTaskAllower allow;

View File

@@ -401,7 +401,7 @@ class CefNativeMenuWin::MenuHostWindow {
struct CefNativeMenuWin::HighlightedMenuItemInfo { struct CefNativeMenuWin::HighlightedMenuItemInfo {
HighlightedMenuItemInfo() HighlightedMenuItemInfo()
: has_parent(false), has_submenu(false), menu(NULL), position(-1) {} : has_parent(false), has_submenu(false), menu(nullptr), position(-1) {}
bool has_parent; bool has_parent;
bool has_submenu; bool has_submenu;
@@ -420,16 +420,16 @@ const wchar_t* CefNativeMenuWin::MenuHostWindow::kWindowClassName =
CefNativeMenuWin::CefNativeMenuWin(ui::MenuModel* model, HWND system_menu_for) CefNativeMenuWin::CefNativeMenuWin(ui::MenuModel* model, HWND system_menu_for)
: model_(model), : model_(model),
menu_(NULL), menu_(nullptr),
owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL) && owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL) &&
!system_menu_for), !system_menu_for),
system_menu_for_(system_menu_for), system_menu_for_(system_menu_for),
first_item_index_(0), first_item_index_(0),
menu_action_(MENU_ACTION_NONE), menu_action_(MENU_ACTION_NONE),
menu_to_select_(NULL), menu_to_select_(nullptr),
position_to_select_(-1), position_to_select_(-1),
parent_(NULL), parent_(nullptr),
destroyed_flag_(NULL), destroyed_flag_(nullptr),
menu_to_select_factory_(this) {} menu_to_select_factory_(this) {}
CefNativeMenuWin::~CefNativeMenuWin() { CefNativeMenuWin::~CefNativeMenuWin() {
@@ -458,7 +458,7 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) {
// Command dispatch is done through WM_MENUCOMMAND, handled by the host // Command dispatch is done through WM_MENUCOMMAND, handled by the host
// window. // window.
menu_to_select_ = NULL; menu_to_select_ = nullptr;
position_to_select_ = -1; position_to_select_ = -1;
menu_to_select_factory_.InvalidateWeakPtrs(); menu_to_select_factory_.InvalidateWeakPtrs();
bool destroyed = false; bool destroyed = false;
@@ -467,10 +467,10 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) {
TrackPopupMenu(menu_, flags, point.x(), point.y(), 0, host_window_->hwnd(), TrackPopupMenu(menu_, flags, point.x(), point.y(), 0, host_window_->hwnd(),
NULL); NULL);
UnhookWindowsHookEx(hhook); UnhookWindowsHookEx(hhook);
open_native_menu_win_ = NULL; open_native_menu_win_ = nullptr;
if (destroyed) if (destroyed)
return; return;
destroyed_flag_ = NULL; destroyed_flag_ = nullptr;
if (menu_to_select_) { if (menu_to_select_) {
// Folks aren't too happy if we notify immediately. In particular, notifying // Folks aren't too happy if we notify immediately. In particular, notifying
// the delegate can cause destruction leaving the stack in a weird // the delegate can cause destruction leaving the stack in a weird
@@ -542,7 +542,7 @@ void CefNativeMenuWin::SetMinimumWidth(int width) {
// CefNativeMenuWin, private: // CefNativeMenuWin, private:
// static // static
CefNativeMenuWin* CefNativeMenuWin::open_native_menu_win_ = NULL; CefNativeMenuWin* CefNativeMenuWin::open_native_menu_win_ = nullptr;
void CefNativeMenuWin::DelayedSelect() { void CefNativeMenuWin::DelayedSelect() {
if (menu_to_select_) if (menu_to_select_)

View File

@@ -17,7 +17,7 @@ CefWindowDelegateView::CefWindowDelegateView(
bool always_on_top, bool always_on_top,
base::RepeatingClosure on_bounds_changed) base::RepeatingClosure on_bounds_changed)
: background_color_(background_color), : background_color_(background_color),
web_view_(NULL), web_view_(nullptr),
always_on_top_(always_on_top), always_on_top_(always_on_top),
on_bounds_changed_(on_bounds_changed) {} on_bounds_changed_(on_bounds_changed) {}

View File

@@ -53,7 +53,7 @@ const char kUTF8String[] = "UTF8_STRING";
::Window top_level_window = window; ::Window top_level_window = window;
::Window root = x11::None; ::Window root = x11::None;
::Window parent = x11::None; ::Window parent = x11::None;
::Window* children = NULL; ::Window* children = nullptr;
unsigned int nchildren = 0; unsigned int nchildren = 0;
// Enumerate all parents of "window" to find the highest level window // Enumerate all parents of "window" to find the highest level window
// that either: // that either:
@@ -77,7 +77,7 @@ const char kUTF8String[] = "UTF8_STRING";
CEF_EXPORT XDisplay* cef_get_xdisplay() { CEF_EXPORT XDisplay* cef_get_xdisplay() {
if (!CEF_CURRENTLY_ON(CEF_UIT)) if (!CEF_CURRENTLY_ON(CEF_UIT))
return NULL; return nullptr;
return gfx::GetXDisplay(); return gfx::GetXDisplay();
} }
@@ -280,7 +280,7 @@ views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() {
views::DesktopWindowTreeHostLinux::GetHostForWidget(child)); views::DesktopWindowTreeHostLinux::GetHostForWidget(child));
} }
} }
return NULL; return nullptr;
} }
bool CefWindowX11::CanDispatchEvent(const ui::PlatformEvent& event) { bool CefWindowX11::CanDispatchEvent(const ui::PlatformEvent& event) {

View File

@@ -13,7 +13,7 @@
CefNavigationEntryImpl::CefNavigationEntryImpl(content::NavigationEntry* value) CefNavigationEntryImpl::CefNavigationEntryImpl(content::NavigationEntry* value)
: CefValueBase<CefNavigationEntry, content::NavigationEntry>( : CefValueBase<CefNavigationEntry, content::NavigationEntry>(
value, value,
NULL, nullptr,
kOwnerNoDelete, kOwnerNoDelete,
false, false,
new CefValueControllerNonThreadSafe()) { new CefValueControllerNonThreadSafe()) {

View File

@@ -163,7 +163,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
if (action.string_piece.empty()) { if (action.string_piece.empty()) {
NOTREACHED() << "Failed to load internal resource for id: " NOTREACHED() << "Failed to load internal resource for id: "
<< action.resource_id << " URL: " << url.spec().c_str(); << action.resource_id << " URL: " << url.spec().c_str();
return NULL; return nullptr;
} }
} }
@@ -180,7 +180,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
} }
} }
return NULL; return nullptr;
} }
private: private:

View File

@@ -588,13 +588,13 @@ bool CefBrowserURLRequest::Start() {
CefRefPtr<CefRequest> CefBrowserURLRequest::GetRequest() { CefRefPtr<CefRequest> CefBrowserURLRequest::GetRequest() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return context_->request(); return context_->request();
} }
CefRefPtr<CefURLRequestClient> CefBrowserURLRequest::GetClient() { CefRefPtr<CefURLRequestClient> CefBrowserURLRequest::GetClient() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return context_->client(); return context_->client();
} }
@@ -612,7 +612,7 @@ CefURLRequest::ErrorCode CefBrowserURLRequest::GetRequestError() {
CefRefPtr<CefResponse> CefBrowserURLRequest::GetResponse() { CefRefPtr<CefResponse> CefBrowserURLRequest::GetResponse() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return context_->response(); return context_->response();
} }

View File

@@ -41,7 +41,7 @@ class AuthCallbackImpl : public CefAuthCallback {
if (delegate_) { if (delegate_) {
delegate_->Continue(username, password); delegate_->Continue(username, password);
delegate_ = NULL; delegate_ = nullptr;
} }
} }
@@ -54,7 +54,7 @@ class AuthCallbackImpl : public CefAuthCallback {
if (delegate_) { if (delegate_) {
delegate_->Cancel(); delegate_->Cancel();
delegate_ = NULL; delegate_ = nullptr;
} }
} }

View File

@@ -167,10 +167,10 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
pending_resize_(false), pending_resize_(false),
pending_resize_force_(false), pending_resize_force_(false),
render_widget_host_(content::RenderWidgetHostImpl::From(widget)), render_widget_host_(content::RenderWidgetHostImpl::From(widget)),
has_parent_(parent_host_view != NULL), has_parent_(parent_host_view != nullptr),
parent_host_view_(parent_host_view), parent_host_view_(parent_host_view),
popup_host_view_(NULL), popup_host_view_(nullptr),
child_host_view_(NULL), child_host_view_(nullptr),
is_showing_(false), is_showing_(false),
is_destroyed_(false), is_destroyed_(false),
pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
@@ -728,7 +728,7 @@ content::BrowserAccessibilityManager*
CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager( CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate, content::BrowserAccessibilityDelegate* delegate,
bool for_root_frame) { bool for_root_frame) {
return NULL; return nullptr;
} }
void CefRenderWidgetHostViewOSR::ImeSetComposition( void CefRenderWidgetHostViewOSR::ImeSetComposition(
@@ -1473,21 +1473,21 @@ void CefRenderWidgetHostViewOSR::CancelWidget() {
browser_impl_->client()->GetRenderHandler(); browser_impl_->client()->GetRenderHandler();
CHECK(handler); CHECK(handler);
handler->OnPopupShow(browser_impl_.get(), false); handler->OnPopupShow(browser_impl_.get(), false);
browser_impl_ = NULL; browser_impl_ = nullptr;
} }
if (parent_host_view_) { if (parent_host_view_) {
if (parent_host_view_->popup_host_view_ == this) { if (parent_host_view_->popup_host_view_ == this) {
parent_host_view_->set_popup_host_view(NULL); parent_host_view_->set_popup_host_view(nullptr);
} else if (parent_host_view_->child_host_view_ == this) { } else if (parent_host_view_->child_host_view_ == this) {
parent_host_view_->set_child_host_view(NULL); parent_host_view_->set_child_host_view(nullptr);
// Start rendering the parent view again. // Start rendering the parent view again.
parent_host_view_->Show(); parent_host_view_->Show();
} else { } else {
parent_host_view_->RemoveGuestHostView(this); parent_host_view_->RemoveGuestHostView(this);
} }
parent_host_view_ = NULL; parent_host_view_ = nullptr;
} }
if (render_widget_host_ && !is_destroyed_) { if (render_widget_host_ && !is_destroyed_) {

View File

@@ -21,7 +21,7 @@ CefWebContentsViewOSR::CefWebContentsViewOSR(SkColor background_color,
: background_color_(background_color), : background_color_(background_color),
use_shared_texture_(use_shared_texture), use_shared_texture_(use_shared_texture),
use_external_begin_frame_(use_external_begin_frame), use_external_begin_frame_(use_external_begin_frame),
web_contents_(NULL) {} web_contents_(nullptr) {}
CefWebContentsViewOSR::~CefWebContentsViewOSR() {} CefWebContentsViewOSR::~CefWebContentsViewOSR() {}
@@ -88,7 +88,7 @@ void CefWebContentsViewOSR::TakeFocus(bool reverse) {
} }
content::DropData* CefWebContentsViewOSR::GetDropData() const { content::DropData* CefWebContentsViewOSR::GetDropData() const {
return NULL; return nullptr;
} }
gfx::Rect CefWebContentsViewOSR::GetViewBounds() const { gfx::Rect CefWebContentsViewOSR::GetViewBounds() const {

View File

@@ -327,7 +327,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
void PopulateWebPreferences(content::RenderViewHost* rvh, void PopulateWebPreferences(content::RenderViewHost* rvh,
content::WebPreferences& web) { content::WebPreferences& web) {
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
extensions::GetOwnerBrowserForHost(rvh, NULL); extensions::GetOwnerBrowserForHost(rvh, nullptr);
// Set defaults for preferences that are not handled by PrefService. // Set defaults for preferences that are not handled by PrefService.
SetDefaultPrefs(web); SetDefaultPrefs(web);

View File

@@ -36,7 +36,7 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback {
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
if (dialog_.get()) { if (dialog_.get()) {
dialog_->OnPrintContinue(settings); dialog_->OnPrintContinue(settings);
dialog_ = NULL; dialog_ = nullptr;
} }
} else { } else {
CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogCallbackImpl::Continue, CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogCallbackImpl::Continue,
@@ -48,7 +48,7 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback {
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
if (dialog_.get()) { if (dialog_.get()) {
dialog_->OnPrintCancel(); dialog_->OnPrintCancel();
dialog_ = NULL; dialog_ = nullptr;
} }
} else { } else {
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
@@ -56,7 +56,7 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback {
} }
} }
void Disconnect() { dialog_ = NULL; } void Disconnect() { dialog_ = nullptr; }
private: private:
CefRefPtr<CefPrintDialogLinux> dialog_; CefRefPtr<CefPrintDialogLinux> dialog_;
@@ -74,7 +74,7 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback {
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
if (dialog_.get()) { if (dialog_.get()) {
dialog_->OnJobCompleted(); dialog_->OnJobCompleted();
dialog_ = NULL; dialog_ = nullptr;
} }
} else { } else {
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
@@ -82,7 +82,7 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback {
} }
} }
void Disconnect() { dialog_ = NULL; } void Disconnect() { dialog_ = nullptr; }
private: private:
CefRefPtr<CefPrintDialogLinux> dialog_; CefRefPtr<CefPrintDialogLinux> dialog_;
@@ -151,7 +151,7 @@ void CefPrintDialogLinux::OnPrintStart(int render_process_id,
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
extensions::GetOwnerBrowserForFrameRoute(render_process_id, extensions::GetOwnerBrowserForFrameRoute(render_process_id,
render_routing_id, NULL); render_routing_id, nullptr);
if (browser.get()) if (browser.get())
handler->OnPrintStart(browser.get()); handler->OnPrintStart(browser.get());
} }
@@ -160,7 +160,7 @@ CefPrintDialogLinux::CefPrintDialogLinux(PrintingContextLinux* context)
: context_(context) { : context_(context) {
DCHECK(context_); DCHECK(context_);
browser_ = extensions::GetOwnerBrowserForFrameRoute( browser_ = extensions::GetOwnerBrowserForFrameRoute(
context_->render_process_id(), context_->render_frame_id(), NULL); context_->render_process_id(), context_->render_frame_id(), nullptr);
DCHECK(browser_); DCHECK(browser_);
} }
@@ -263,7 +263,7 @@ void CefPrintDialogLinux::SetHandler() {
void CefPrintDialogLinux::ReleaseHandler() { void CefPrintDialogLinux::ReleaseHandler() {
if (handler_.get()) { if (handler_.get()) {
handler_->OnPrintReset(browser_.get()); handler_->OnPrintReset(browser_.get());
handler_ = NULL; handler_ = nullptr;
} }
} }

View File

@@ -144,7 +144,7 @@ CefRefPtr<CefRequestContext> CefRequestContext::GetGlobalContext() {
// Verify that the context is in a valid state. // Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) { if (!CONTEXT_STATE_VALID()) {
NOTREACHED() << "context not valid"; NOTREACHED() << "context not valid";
return NULL; return nullptr;
} }
CefRequestContextImpl::Config config; CefRequestContextImpl::Config config;
@@ -159,7 +159,7 @@ CefRefPtr<CefRequestContext> CefRequestContext::CreateContext(
// Verify that the context is in a valid state. // Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) { if (!CONTEXT_STATE_VALID()) {
NOTREACHED() << "context not valid"; NOTREACHED() << "context not valid";
return NULL; return nullptr;
} }
CefRequestContextImpl::Config config; CefRequestContextImpl::Config config;
@@ -176,11 +176,11 @@ CefRefPtr<CefRequestContext> CefRequestContext::CreateContext(
// Verify that the context is in a valid state. // Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) { if (!CONTEXT_STATE_VALID()) {
NOTREACHED() << "context not valid"; NOTREACHED() << "context not valid";
return NULL; return nullptr;
} }
if (!other.get()) if (!other.get())
return NULL; return nullptr;
CefRequestContextImpl::Config config; CefRequestContextImpl::Config config;
config.other = static_cast<CefRequestContextImpl*>(other.get()); config.other = static_cast<CefRequestContextImpl*>(other.get());
@@ -373,7 +373,7 @@ bool CefRequestContextImpl::HasPreference(const CefString& name) {
EnsureBrowserContext(); EnsureBrowserContext();
PrefService* pref_service = browser_context()->GetPrefs(); PrefService* pref_service = browser_context()->GetPrefs();
return (pref_service->FindPreference(name) != NULL); return (pref_service->FindPreference(name) != nullptr);
} }
CefRefPtr<CefValue> CefRequestContextImpl::GetPreference( CefRefPtr<CefValue> CefRequestContextImpl::GetPreference(
@@ -381,7 +381,7 @@ CefRefPtr<CefValue> CefRequestContextImpl::GetPreference(
// Verify that this method is being called on the UI thread. // Verify that this method is being called on the UI thread.
if (!CEF_CURRENTLY_ON_UIT()) { if (!CEF_CURRENTLY_ON_UIT()) {
NOTREACHED() << "called on invalid thread"; NOTREACHED() << "called on invalid thread";
return NULL; return nullptr;
} }
// Make sure the browser context exists. // Make sure the browser context exists.
@@ -390,7 +390,7 @@ CefRefPtr<CefValue> CefRequestContextImpl::GetPreference(
PrefService* pref_service = browser_context()->GetPrefs(); PrefService* pref_service = browser_context()->GetPrefs();
const PrefService::Preference* pref = pref_service->FindPreference(name); const PrefService::Preference* pref = pref_service->FindPreference(name);
if (!pref) if (!pref)
return NULL; return nullptr;
return new CefValueImpl(pref->GetValue()->DeepCopy()); return new CefValueImpl(pref->GetValue()->DeepCopy());
} }
@@ -399,7 +399,7 @@ CefRefPtr<CefDictionaryValue> CefRequestContextImpl::GetAllPreferences(
// Verify that this method is being called on the UI thread. // Verify that this method is being called on the UI thread.
if (!CEF_CURRENTLY_ON_UIT()) { if (!CEF_CURRENTLY_ON_UIT()) {
NOTREACHED() << "called on invalid thread"; NOTREACHED() << "called on invalid thread";
return NULL; return nullptr;
} }
// Make sure the browser context exists. // Make sure the browser context exists.
@@ -669,7 +669,7 @@ void CefRequestContextImpl::Initialize() {
// Clear the reference to |config_.other| after setting // Clear the reference to |config_.other| after setting
// |request_context_getter_|. This is the reverse order of checks in // |request_context_getter_|. This is the reverse order of checks in
// IsSharedWith(). // IsSharedWith().
config_.other = NULL; config_.other = nullptr;
} }
if (config_.handler) if (config_.handler)

View File

@@ -26,7 +26,7 @@ CefRefPtr<CefStreamReader> CefStreamReader::CreateForFile(
CefRefPtr<CefStreamReader> CefStreamReader::CreateForData(void* data, CefRefPtr<CefStreamReader> CefStreamReader::CreateForData(void* data,
size_t size) { size_t size) {
DCHECK(data != NULL); DCHECK(data != nullptr);
DCHECK(size > 0); DCHECK(size > 0);
CefRefPtr<CefStreamReader> reader; CefRefPtr<CefStreamReader> reader;
if (data && size > 0) if (data && size > 0)
@@ -139,12 +139,12 @@ int CefFileWriter::Flush() {
// CefBytesReader // CefBytesReader
CefBytesReader::CefBytesReader(void* data, int64 datasize, bool copy) CefBytesReader::CefBytesReader(void* data, int64 datasize, bool copy)
: data_(NULL), datasize_(0), copy_(false), offset_(0) { : data_(nullptr), datasize_(0), copy_(false), offset_(0) {
SetData(data, datasize, copy); SetData(data, datasize, copy);
} }
CefBytesReader::~CefBytesReader() { CefBytesReader::~CefBytesReader() {
SetData(NULL, 0, false); SetData(nullptr, 0, false);
} }
size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) { size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) {
@@ -206,7 +206,7 @@ void CefBytesReader::SetData(void* data, int64 datasize, bool copy) {
if (copy) { if (copy) {
data_ = malloc(datasize); data_ = malloc(datasize);
DCHECK(data_ != NULL); DCHECK(data_ != nullptr);
if (data_) if (data_)
memcpy(data_, data, datasize); memcpy(data_, data, datasize);
} else { } else {
@@ -220,7 +220,7 @@ CefBytesWriter::CefBytesWriter(size_t grow)
: grow_(grow), datasize_(grow), offset_(0) { : grow_(grow), datasize_(grow), offset_(0) {
DCHECK(grow > 0); DCHECK(grow > 0);
data_ = malloc(grow); data_ = malloc(grow);
DCHECK(data_ != NULL); DCHECK(data_ != nullptr);
} }
CefBytesWriter::~CefBytesWriter() { CefBytesWriter::~CefBytesWriter() {
@@ -293,7 +293,7 @@ size_t CefBytesWriter::Grow(size_t size) {
size_t rv; size_t rv;
size_t s = (size > grow_ ? size : grow_); size_t s = (size > grow_ ? size : grow_);
void* tmp = realloc(data_, datasize_ + s); void* tmp = realloc(data_, datasize_ + s);
DCHECK(tmp != NULL); DCHECK(tmp != nullptr);
if (tmp) { if (tmp) {
data_ = tmp; data_ = tmp;
datasize_ += s; datasize_ += s;

View File

@@ -58,7 +58,7 @@ CefTraceSubscriber::CefTraceSubscriber()
CefTraceSubscriber::~CefTraceSubscriber() { CefTraceSubscriber::~CefTraceSubscriber() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (collecting_trace_data_) if (collecting_trace_data_)
TracingController::GetInstance()->StopTracing(NULL); TracingController::GetInstance()->StopTracing(nullptr);
} }
bool CefTraceSubscriber::BeginTracing( bool CefTraceSubscriber::BeginTracing(
@@ -95,7 +95,7 @@ bool CefTraceSubscriber::EndTracing(const base::FilePath& tracing_file,
if (!callback.get()) { if (!callback.get()) {
// Discard the trace data. // Discard the trace data.
collecting_trace_data_ = false; collecting_trace_data_ = false;
TracingController::GetInstance()->StopTracing(NULL); TracingController::GetInstance()->StopTracing(nullptr);
return true; return true;
} }

View File

@@ -43,7 +43,8 @@ void InitializeUITesting() {
ui_controls::InstallUIControlsAura( ui_controls::InstallUIControlsAura(
views::test::CreateUIControlsDesktopAura()); views::test::CreateUIControlsDesktopAura());
#else #else
ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(NULL)); ui_controls::InstallUIControlsAura(
aura::test::CreateUIControlsAura(nullptr));
#endif #endif
#endif #endif

View File

@@ -14,7 +14,7 @@ CefRefPtr<CefXmlReader> CefXmlReader::Create(CefRefPtr<CefStreamReader> stream,
const CefString& URI) { const CefString& URI) {
CefRefPtr<CefXmlReaderImpl> impl(new CefXmlReaderImpl()); CefRefPtr<CefXmlReaderImpl> impl(new CefXmlReaderImpl());
if (!impl->Initialize(stream, encodingType, URI)) if (!impl->Initialize(stream, encodingType, URI))
return NULL; return nullptr;
return impl.get(); return impl.get();
} }
@@ -107,10 +107,11 @@ CefString xmlCharToString(const xmlChar* xmlStr, bool free) {
} // namespace } // namespace
CefXmlReaderImpl::CefXmlReaderImpl() CefXmlReaderImpl::CefXmlReaderImpl()
: supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL) {} : supported_thread_id_(base::PlatformThread::CurrentId()),
reader_(nullptr) {}
CefXmlReaderImpl::~CefXmlReaderImpl() { CefXmlReaderImpl::~CefXmlReaderImpl() {
if (reader_ != NULL) { if (reader_ != nullptr) {
if (!VerifyContext()) { if (!VerifyContext()) {
// Close() is supposed to be called directly. We'll try to free the reader // Close() is supposed to be called directly. We'll try to free the reader
// now on the wrong thread but there's no guarantee this call won't crash. // now on the wrong thread but there's no guarantee this call won't crash.
@@ -183,7 +184,7 @@ bool CefXmlReaderImpl::Close() {
// The input buffer will be freed automatically. // The input buffer will be freed automatically.
xmlFreeTextReader(reader_); xmlFreeTextReader(reader_);
reader_ = NULL; reader_ = nullptr;
return true; return true;
} }
@@ -309,7 +310,7 @@ CefString CefXmlReaderImpl::GetValue() {
if (xmlTextReaderNodeType(reader_) == XML_READER_TYPE_ENTITY_REFERENCE) { if (xmlTextReaderNodeType(reader_) == XML_READER_TYPE_ENTITY_REFERENCE) {
// Provide special handling to return entity reference values. // Provide special handling to return entity reference values.
xmlNodePtr node = xmlTextReaderCurrentNode(reader_); xmlNodePtr node = xmlTextReaderCurrentNode(reader_);
if (node->content != NULL) if (node->content != nullptr)
return xmlCharToString(node->content, false); return xmlCharToString(node->content, false);
return CefString(); return CefString();
} else { } else {
@@ -447,5 +448,5 @@ bool CefXmlReaderImpl::VerifyContext() {
return false; return false;
} }
return (reader_ != NULL); return (reader_ != nullptr);
} }

View File

@@ -14,7 +14,7 @@ CefRefPtr<CefZipReader> CefZipReader::Create(
CefRefPtr<CefStreamReader> stream) { CefRefPtr<CefStreamReader> stream) {
CefRefPtr<CefZipReaderImpl> impl(new CefZipReaderImpl()); CefRefPtr<CefZipReaderImpl> impl(new CefZipReaderImpl());
if (!impl->Initialize(stream)) if (!impl->Initialize(stream))
return NULL; return nullptr;
return impl.get(); return impl.get();
} }
@@ -76,14 +76,14 @@ int ZCALLBACK zlib_error_callback OF((voidpf opaque, voidpf stream)) {
CefZipReaderImpl::CefZipReaderImpl() CefZipReaderImpl::CefZipReaderImpl()
: supported_thread_id_(base::PlatformThread::CurrentId()), : supported_thread_id_(base::PlatformThread::CurrentId()),
reader_(NULL), reader_(nullptr),
has_fileopen_(false), has_fileopen_(false),
has_fileinfo_(false), has_fileinfo_(false),
filesize_(0), filesize_(0),
filemodified_(0) {} filemodified_(0) {}
CefZipReaderImpl::~CefZipReaderImpl() { CefZipReaderImpl::~CefZipReaderImpl() {
if (reader_ != NULL) { if (reader_ != nullptr) {
if (!VerifyContext()) { if (!VerifyContext()) {
// Close() is supposed to be called directly. We'll try to free the reader // Close() is supposed to be called directly. We'll try to free the reader
// now on the wrong thread but there's no guarantee this call won't crash. // now on the wrong thread but there's no guarantee this call won't crash.
@@ -100,7 +100,7 @@ bool CefZipReaderImpl::Initialize(CefRefPtr<CefStreamReader> stream) {
zlib_filefunc64_def filefunc_def; zlib_filefunc64_def filefunc_def;
filefunc_def.zopen64_file = zlib_open_callback; filefunc_def.zopen64_file = zlib_open_callback;
filefunc_def.zread_file = zlib_read_callback; filefunc_def.zread_file = zlib_read_callback;
filefunc_def.zwrite_file = NULL; filefunc_def.zwrite_file = nullptr;
filefunc_def.ztell64_file = zlib_tell_callback; filefunc_def.ztell64_file = zlib_tell_callback;
filefunc_def.zseek64_file = zlib_seek_callback; filefunc_def.zseek64_file = zlib_seek_callback;
filefunc_def.zclose_file = zlib_close_callback; filefunc_def.zclose_file = zlib_close_callback;
@@ -111,7 +111,7 @@ bool CefZipReaderImpl::Initialize(CefRefPtr<CefStreamReader> stream) {
stream->AddRef(); stream->AddRef();
reader_ = unzOpen2_64("", &filefunc_def); reader_ = unzOpen2_64("", &filefunc_def);
return (reader_ != NULL); return (reader_ != nullptr);
} }
bool CefZipReaderImpl::MoveToFirstFile() { bool CefZipReaderImpl::MoveToFirstFile() {
@@ -161,7 +161,7 @@ bool CefZipReaderImpl::Close() {
CloseFile(); CloseFile();
int result = unzClose(reader_); int result = unzClose(reader_);
reader_ = NULL; reader_ = nullptr;
return (result == UNZ_OK); return (result == UNZ_OK);
} }
@@ -278,5 +278,5 @@ bool CefZipReaderImpl::VerifyContext() {
return false; return false;
} }
return (reader_ != NULL); return (reader_ != nullptr);
} }

View File

@@ -47,9 +47,9 @@ CEF_EXPORT void cef_trace_event_instant(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_COPY_INSTANT0(kCategory, name, TRACE_EVENT_SCOPE_THREAD); TRACE_EVENT_COPY_INSTANT0(kCategory, name, TRACE_EVENT_SCOPE_THREAD);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_COPY_INSTANT1(kCategory, name, TRACE_EVENT_SCOPE_THREAD, TRACE_EVENT_COPY_INSTANT1(kCategory, name, TRACE_EVENT_SCOPE_THREAD,
arg1_name, arg1_val); arg1_name, arg1_val);
} else { } else {
@@ -57,9 +57,9 @@ CEF_EXPORT void cef_trace_event_instant(const char* /* category */,
arg1_name, arg1_val, arg2_name, arg2_val); arg1_name, arg1_val, arg2_name, arg2_val);
} }
} else { } else {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_INSTANT0(kCategory, name, TRACE_EVENT_SCOPE_THREAD); TRACE_EVENT_INSTANT0(kCategory, name, TRACE_EVENT_SCOPE_THREAD);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_INSTANT1(kCategory, name, TRACE_EVENT_SCOPE_THREAD, arg1_name, TRACE_EVENT_INSTANT1(kCategory, name, TRACE_EVENT_SCOPE_THREAD, arg1_name,
arg1_val); arg1_val);
} else { } else {
@@ -81,9 +81,9 @@ CEF_EXPORT void cef_trace_event_begin(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_BEGIN_WITH_FLAGS0(kCategory, name, TRACE_EVENT_FLAG_COPY); TRACE_EVENT_BEGIN_WITH_FLAGS0(kCategory, name, TRACE_EVENT_FLAG_COPY);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_BEGIN_WITH_FLAGS1(kCategory, name, TRACE_EVENT_FLAG_COPY, TRACE_EVENT_BEGIN_WITH_FLAGS1(kCategory, name, TRACE_EVENT_FLAG_COPY,
arg1_name, arg1_val); arg1_name, arg1_val);
} else { } else {
@@ -91,9 +91,9 @@ CEF_EXPORT void cef_trace_event_begin(const char* /* category */,
arg2_val); arg2_val);
} }
} else { } else {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_BEGIN0(kCategory, name); TRACE_EVENT_BEGIN0(kCategory, name);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_BEGIN1(kCategory, name, arg1_name, arg1_val); TRACE_EVENT_BEGIN1(kCategory, name, arg1_name, arg1_val);
} else { } else {
TRACE_EVENT_BEGIN2(kCategory, name, arg1_name, arg1_val, arg2_name, TRACE_EVENT_BEGIN2(kCategory, name, arg1_name, arg1_val, arg2_name,
@@ -114,9 +114,9 @@ CEF_EXPORT void cef_trace_event_end(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_END_WITH_FLAGS0(kCategory, name, TRACE_EVENT_FLAG_COPY); TRACE_EVENT_END_WITH_FLAGS0(kCategory, name, TRACE_EVENT_FLAG_COPY);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_END_WITH_FLAGS1(kCategory, name, TRACE_EVENT_FLAG_COPY, TRACE_EVENT_END_WITH_FLAGS1(kCategory, name, TRACE_EVENT_FLAG_COPY,
arg1_name, arg1_val); arg1_name, arg1_val);
} else { } else {
@@ -124,9 +124,9 @@ CEF_EXPORT void cef_trace_event_end(const char* /* category */,
arg2_val); arg2_val);
} }
} else { } else {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_END0(kCategory, name); TRACE_EVENT_END0(kCategory, name);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_END1(kCategory, name, arg1_name, arg1_val); TRACE_EVENT_END1(kCategory, name, arg1_name, arg1_val);
} else { } else {
TRACE_EVENT_END2(kCategory, name, arg1_name, arg1_val, arg2_name, TRACE_EVENT_END2(kCategory, name, arg1_name, arg1_val, arg2_name,
@@ -147,14 +147,14 @@ CEF_EXPORT void cef_trace_counter(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (value1_name == NULL && value2_name == NULL) { if (value1_name == nullptr && value2_name == nullptr) {
TRACE_COPY_COUNTER1(kCategory, name, value1_val); TRACE_COPY_COUNTER1(kCategory, name, value1_val);
} else { } else {
TRACE_COPY_COUNTER2(kCategory, name, value1_name, value1_val, value2_name, TRACE_COPY_COUNTER2(kCategory, name, value1_name, value1_val, value2_name,
value2_val); value2_val);
} }
} else { } else {
if (value1_name == NULL && value2_name == NULL) { if (value1_name == nullptr && value2_name == nullptr) {
TRACE_COUNTER1(kCategory, name, value1_val); TRACE_COUNTER1(kCategory, name, value1_val);
} else { } else {
TRACE_COUNTER2(kCategory, name, value1_name, value1_val, value2_name, TRACE_COUNTER2(kCategory, name, value1_name, value1_val, value2_name,
@@ -176,14 +176,14 @@ CEF_EXPORT void cef_trace_counter_id(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (value1_name == NULL && value2_name == NULL) { if (value1_name == nullptr && value2_name == nullptr) {
TRACE_COPY_COUNTER_ID1(kCategory, name, id, value1_val); TRACE_COPY_COUNTER_ID1(kCategory, name, id, value1_val);
} else { } else {
TRACE_COPY_COUNTER_ID2(kCategory, name, id, value1_name, value1_val, TRACE_COPY_COUNTER_ID2(kCategory, name, id, value1_name, value1_val,
value2_name, value2_val); value2_name, value2_val);
} }
} else { } else {
if (value1_name == NULL && value2_name == NULL) { if (value1_name == nullptr && value2_name == nullptr) {
TRACE_COUNTER_ID1(kCategory, name, id, value1_val); TRACE_COUNTER_ID1(kCategory, name, id, value1_val);
} else { } else {
TRACE_COUNTER_ID2(kCategory, name, id, value1_name, value1_val, TRACE_COUNTER_ID2(kCategory, name, id, value1_name, value1_val,
@@ -205,18 +205,18 @@ CEF_EXPORT void cef_trace_event_async_begin(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_COPY_ASYNC_BEGIN0(kCategory, name, id); TRACE_EVENT_COPY_ASYNC_BEGIN0(kCategory, name, id);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_COPY_ASYNC_BEGIN1(kCategory, name, id, arg1_name, arg1_val); TRACE_EVENT_COPY_ASYNC_BEGIN1(kCategory, name, id, arg1_name, arg1_val);
} else { } else {
TRACE_EVENT_COPY_ASYNC_BEGIN2(kCategory, name, id, arg1_name, arg1_val, TRACE_EVENT_COPY_ASYNC_BEGIN2(kCategory, name, id, arg1_name, arg1_val,
arg2_name, arg2_val); arg2_name, arg2_val);
} }
} else { } else {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_ASYNC_BEGIN0(kCategory, name, id); TRACE_EVENT_ASYNC_BEGIN0(kCategory, name, id);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_ASYNC_BEGIN1(kCategory, name, id, arg1_name, arg1_val); TRACE_EVENT_ASYNC_BEGIN1(kCategory, name, id, arg1_name, arg1_val);
} else { } else {
TRACE_EVENT_ASYNC_BEGIN2(kCategory, name, id, arg1_name, arg1_val, TRACE_EVENT_ASYNC_BEGIN2(kCategory, name, id, arg1_name, arg1_val,
@@ -237,7 +237,7 @@ CEF_EXPORT void cef_trace_event_async_step_into(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL) { if (arg1_name == nullptr) {
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO,
kCategory, name, id, kCategory, name, id,
TRACE_EVENT_FLAG_COPY, "step", step); TRACE_EVENT_FLAG_COPY, "step", step);
@@ -247,7 +247,7 @@ CEF_EXPORT void cef_trace_event_async_step_into(const char* /* category */,
TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val); TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val);
} }
} else { } else {
if (arg1_name == NULL) { if (arg1_name == nullptr) {
TRACE_EVENT_ASYNC_STEP_INTO0(kCategory, name, id, step); TRACE_EVENT_ASYNC_STEP_INTO0(kCategory, name, id, step);
} else { } else {
TRACE_EVENT_ASYNC_STEP_INTO1(kCategory, name, id, step, arg1_name, TRACE_EVENT_ASYNC_STEP_INTO1(kCategory, name, id, step, arg1_name,
@@ -268,7 +268,7 @@ CEF_EXPORT void cef_trace_event_async_step_past(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL) { if (arg1_name == nullptr) {
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST,
kCategory, name, id, kCategory, name, id,
TRACE_EVENT_FLAG_COPY, "step", step); TRACE_EVENT_FLAG_COPY, "step", step);
@@ -278,7 +278,7 @@ CEF_EXPORT void cef_trace_event_async_step_past(const char* /* category */,
TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val); TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val);
} }
} else { } else {
if (arg1_name == NULL) { if (arg1_name == nullptr) {
TRACE_EVENT_ASYNC_STEP_PAST0(kCategory, name, id, step); TRACE_EVENT_ASYNC_STEP_PAST0(kCategory, name, id, step);
} else { } else {
TRACE_EVENT_ASYNC_STEP_PAST1(kCategory, name, id, step, arg1_name, TRACE_EVENT_ASYNC_STEP_PAST1(kCategory, name, id, step, arg1_name,
@@ -300,18 +300,18 @@ CEF_EXPORT void cef_trace_event_async_end(const char* /* category */,
return; return;
if (copy) { if (copy) {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_COPY_ASYNC_END0(kCategory, name, id); TRACE_EVENT_COPY_ASYNC_END0(kCategory, name, id);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_COPY_ASYNC_END1(kCategory, name, id, arg1_name, arg1_val); TRACE_EVENT_COPY_ASYNC_END1(kCategory, name, id, arg1_name, arg1_val);
} else { } else {
TRACE_EVENT_COPY_ASYNC_END2(kCategory, name, id, arg1_name, arg1_val, TRACE_EVENT_COPY_ASYNC_END2(kCategory, name, id, arg1_name, arg1_val,
arg2_name, arg2_val); arg2_name, arg2_val);
} }
} else { } else {
if (arg1_name == NULL && arg2_name == NULL) { if (arg1_name == nullptr && arg2_name == nullptr) {
TRACE_EVENT_ASYNC_END0(kCategory, name, id); TRACE_EVENT_ASYNC_END0(kCategory, name, id);
} else if (arg2_name == NULL) { } else if (arg2_name == nullptr) {
TRACE_EVENT_ASYNC_END1(kCategory, name, id, arg1_name, arg1_val); TRACE_EVENT_ASYNC_END1(kCategory, name, id, arg1_name, arg1_val);
} else { } else {
TRACE_EVENT_ASYNC_END2(kCategory, name, id, arg1_name, arg1_val, TRACE_EVENT_ASYNC_END2(kCategory, name, id, arg1_name, arg1_val,

View File

@@ -73,7 +73,7 @@ struct ParamTraits<net::UploadElement> {
void ParamTraits<scoped_refptr<net::UploadData>>::Write(base::Pickle* m, void ParamTraits<scoped_refptr<net::UploadData>>::Write(base::Pickle* m,
const param_type& p) { const param_type& p) {
WriteParam(m, p.get() != NULL); WriteParam(m, p.get() != nullptr);
if (p.get()) { if (p.get()) {
WriteParam(m, p->elements()); WriteParam(m, p->elements());
WriteParam(m, p->identifier()); WriteParam(m, p->identifier());

View File

@@ -12,10 +12,10 @@ CefCommandLineImpl::CefCommandLineImpl(base::CommandLine* value,
bool read_only) bool read_only)
: CefValueBase<CefCommandLine, base::CommandLine>( : CefValueBase<CefCommandLine, base::CommandLine>(
value, value,
NULL, nullptr,
will_delete ? kOwnerWillDelete : kOwnerNoDelete, will_delete ? kOwnerWillDelete : kOwnerNoDelete,
read_only, read_only,
NULL) {} nullptr) {}
bool CefCommandLineImpl::IsValid() { bool CefCommandLineImpl::IsValid() {
return !detached(); return !detached();
@@ -26,7 +26,7 @@ bool CefCommandLineImpl::IsReadOnly() {
} }
CefRefPtr<CefCommandLine> CefCommandLineImpl::Copy() { CefRefPtr<CefCommandLine> CefCommandLineImpl::Copy() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return new CefCommandLineImpl(new base::CommandLine(const_value().argv()), return new CefCommandLineImpl(new base::CommandLine(const_value().argv()),
true, false); true, false);
} }

View File

@@ -44,7 +44,7 @@
namespace { namespace {
CefContentClient* g_content_client = NULL; CefContentClient* g_content_client = nullptr;
// The following plugin-related methods are from // The following plugin-related methods are from
// chrome/common/chrome_content_client.cc // chrome/common/chrome_content_client.cc
@@ -168,7 +168,7 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
.value()))); .value())));
if (!manifest_value.get()) if (!manifest_value.get())
return false; return false;
base::DictionaryValue* manifest = NULL; base::DictionaryValue* manifest = nullptr;
if (!manifest_value->GetAsDictionary(&manifest)) if (!manifest_value->GetAsDictionary(&manifest))
return false; return false;
@@ -195,7 +195,7 @@ CefContentClient::CefContentClient(CefRefPtr<CefApp> application)
} }
CefContentClient::~CefContentClient() { CefContentClient::~CefContentClient() {
g_content_client = NULL; g_content_client = nullptr;
} }
// static // static

View File

@@ -380,7 +380,7 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
kCrashKeysSection, kCrashKeysSection,
} current_section = kNoSection; } current_section = kNoSection;
while (fgets(line, sizeof(line) - 1, fp) != NULL) { while (fgets(line, sizeof(line) - 1, fp) != nullptr) {
std::string str = line; std::string str = line;
base::TrimString(str, base::kWhitespaceASCII, &str); base::TrimString(str, base::kWhitespaceASCII, &str);
if (str.empty() || str[0] == '#') if (str.empty() || str[0] == '#')

View File

@@ -32,7 +32,7 @@ CefRefPtr<CefDragData> CefDragData::Create() {
} }
CefRefPtr<CefDragData> CefDragDataImpl::Clone() { CefRefPtr<CefDragData> CefDragDataImpl::Clone() {
CefDragDataImpl* drag_data = NULL; CefDragDataImpl* drag_data = nullptr;
{ {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
drag_data = new CefDragDataImpl(data_, image_, image_hotspot_); drag_data = new CefDragDataImpl(data_, image_, image_hotspot_);

View File

@@ -41,7 +41,7 @@ CefRefPtr<CefValue> CefParseJSON(const CefString& json_string,
base::Value::ToUniquePtrValue(std::move(parse_result.value())) base::Value::ToUniquePtrValue(std::move(parse_result.value()))
.release()); .release());
} }
return NULL; return nullptr;
} }
CefRefPtr<CefValue> CefParseJSONAndReturnError( CefRefPtr<CefValue> CefParseJSONAndReturnError(
@@ -64,7 +64,7 @@ CefRefPtr<CefValue> CefParseJSONAndReturnError(
error_code_out = error_code_out =
static_cast<cef_json_parser_error_t>(value_and_error.error_code); static_cast<cef_json_parser_error_t>(value_and_error.error_code);
error_msg_out = value_and_error.error_message; error_msg_out = value_and_error.error_message;
return NULL; return nullptr;
} }
CefString CefWriteJSON(CefRefPtr<CefValue> node, CefString CefWriteJSON(CefRefPtr<CefValue> node,

View File

@@ -381,7 +381,7 @@ class CefUIThread : public base::PlatformThread::Delegate {
#if defined(OS_WIN) #if defined(OS_WIN)
// Initializes the COM library on the current thread. // Initializes the COM library on the current thread.
CoInitialize(NULL); CoInitialize(nullptr);
#endif #endif
start_event_.Signal(); start_event_.Signal();
@@ -393,7 +393,7 @@ class CefUIThread : public base::PlatformThread::Delegate {
run_loop.Run(); run_loop.Run();
browser_runner_->Shutdown(); browser_runner_->Shutdown();
browser_runner_.reset(NULL); browser_runner_.reset(nullptr);
content::BrowserTaskExecutor::Shutdown(); content::BrowserTaskExecutor::Shutdown();
@@ -651,7 +651,7 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
new CefCommandLineImpl(command_line, false, false)); new CefCommandLineImpl(command_line, false, false));
content_client_.application()->OnBeforeCommandLineProcessing( content_client_.application()->OnBeforeCommandLineProcessing(
CefString(process_type), commandLinePtr.get()); CefString(process_type), commandLinePtr.get());
commandLinePtr->Detach(NULL); commandLinePtr->Detach(nullptr);
} }
// Initialize logging. // Initialize logging.
@@ -841,7 +841,7 @@ content::ContentUtilityClient* CefMainDelegate::CreateContentUtilityClient() {
void CefMainDelegate::ShutdownBrowser() { void CefMainDelegate::ShutdownBrowser() {
if (browser_runner_.get()) { if (browser_runner_.get()) {
browser_runner_->Shutdown(); browser_runner_->Shutdown();
browser_runner_.reset(NULL); browser_runner_.reset(nullptr);
} }
if (ui_thread_.get()) { if (ui_thread_.get()) {

View File

@@ -11,7 +11,7 @@ namespace net {
UploadElement::UploadElement() UploadElement::UploadElement()
: type_(TYPE_BYTES), : type_(TYPE_BYTES),
bytes_start_(NULL), bytes_start_(nullptr),
bytes_length_(0), bytes_length_(0),
file_range_offset_(0), file_range_offset_(0),
file_range_length_(std::numeric_limits<uint64_t>::max()) {} file_range_length_(std::numeric_limits<uint64_t>::max()) {}

View File

@@ -111,13 +111,13 @@ CefString CefBase64Encode(const void* data, size_t data_size) {
CefRefPtr<CefBinaryValue> CefBase64Decode(const CefString& data) { CefRefPtr<CefBinaryValue> CefBase64Decode(const CefString& data) {
if (data.size() == 0) if (data.size() == 0)
return NULL; return nullptr;
const std::string& input = data; const std::string& input = data;
std::string output; std::string output;
if (base::Base64Decode(input, &output)) if (base::Base64Decode(input, &output))
return CefBinaryValue::Create(output.data(), output.size()); return CefBinaryValue::Create(output.data(), output.size());
return NULL; return nullptr;
} }
CefString CefURIEncode(const CefString& text, bool use_plus) { CefString CefURIEncode(const CefString& text, bool use_plus) {
@@ -131,7 +131,7 @@ CefString CefURIDecode(const CefString& text,
static_cast<net::UnescapeRule::Type>(unescape_rule); static_cast<net::UnescapeRule::Type>(unescape_rule);
if (convert_to_utf8) if (convert_to_utf8)
return net::UnescapeAndDecodeUTF8URLComponentWithAdjustments( return net::UnescapeAndDecodeUTF8URLComponentWithAdjustments(
text.ToString(), type, NULL); text.ToString(), type, nullptr);
else else
return net::UnescapeURLComponent(text.ToString(), type); return net::UnescapeURLComponent(text.ToString(), type);
} }

View File

@@ -30,10 +30,10 @@ CefProcessMessageImpl::CefProcessMessageImpl(Cef_Request_Params* value,
bool read_only) bool read_only)
: CefValueBase<CefProcessMessage, Cef_Request_Params>( : CefValueBase<CefProcessMessage, Cef_Request_Params>(
value, value,
NULL, nullptr,
will_delete ? kOwnerWillDelete : kOwnerNoDelete, will_delete ? kOwnerWillDelete : kOwnerNoDelete,
read_only, read_only,
NULL) {} nullptr) {}
bool CefProcessMessageImpl::CopyTo(Cef_Request_Params& target) { bool CefProcessMessageImpl::CopyTo(Cef_Request_Params& target) {
CEF_VALUE_VERIFY_RETURN(false, false); CEF_VALUE_VERIFY_RETURN(false, false);
@@ -50,7 +50,7 @@ bool CefProcessMessageImpl::IsReadOnly() {
} }
CefRefPtr<CefProcessMessage> CefProcessMessageImpl::Copy() { CefRefPtr<CefProcessMessage> CefProcessMessageImpl::Copy() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
Cef_Request_Params* params = new Cef_Request_Params(); Cef_Request_Params* params = new Cef_Request_Params();
CopyValue(const_value(), *params); CopyValue(const_value(), *params);
return new CefProcessMessageImpl(params, true, false); return new CefProcessMessageImpl(params, true, false);
@@ -62,7 +62,7 @@ CefString CefProcessMessageImpl::GetName() {
} }
CefRefPtr<CefListValue> CefProcessMessageImpl::GetArgumentList() { CefRefPtr<CefListValue> CefProcessMessageImpl::GetArgumentList() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return CefListValueImpl::GetOrCreateRef( return CefListValueImpl::GetOrCreateRef(
const_cast<base::ListValue*>(&(const_value().arguments)), const_cast<base::ListValue*>(&(const_value().arguments)),
const_cast<Cef_Request_Params*>(&const_value()), read_only(), const_cast<Cef_Request_Params*>(&const_value()), read_only(),

View File

@@ -982,7 +982,7 @@ void CefRequestImpl::Reset() {
method_ = "GET"; method_ = "GET";
referrer_url_ = GURL(); referrer_url_ = GURL();
referrer_policy_ = REFERRER_POLICY_DEFAULT; referrer_policy_ = REFERRER_POLICY_DEFAULT;
postdata_ = NULL; postdata_ = nullptr;
headermap_.clear(); headermap_.clear();
resource_type_ = RT_SUB_RESOURCE; resource_type_ = RT_SUB_RESOURCE;
transition_type_ = TT_EXPLICIT; transition_type_ = TT_EXPLICIT;
@@ -1306,8 +1306,8 @@ void CefPostDataElementImpl::SetToBytes(size_t size, const void* bytes) {
// Assign the new data // Assign the new data
void* data = malloc(size); void* data = malloc(size);
DCHECK(data != NULL); DCHECK(data != nullptr);
if (data == NULL) if (data == nullptr)
return; return;
memcpy(data, bytes, size); memcpy(data, bytes, size);

View File

@@ -32,7 +32,7 @@ gfx::Image CefResourceBundleDelegate::GetNativeImageNamed(int resource_id) {
base::RefCountedStaticMemory* CefResourceBundleDelegate::LoadDataResourceBytes( base::RefCountedStaticMemory* CefResourceBundleDelegate::LoadDataResourceBytes(
int resource_id, int resource_id,
ui::ScaleFactor scale_factor) { ui::ScaleFactor scale_factor) {
return NULL; return nullptr;
} }
bool CefResourceBundleDelegate::GetRawDataResource(int resource_id, bool CefResourceBundleDelegate::GetRawDataResource(int resource_id,
@@ -42,7 +42,7 @@ bool CefResourceBundleDelegate::GetRawDataResource(int resource_id,
CefRefPtr<CefResourceBundleHandler> handler = CefRefPtr<CefResourceBundleHandler> handler =
content_client_->application()->GetResourceBundleHandler(); content_client_->application()->GetResourceBundleHandler();
if (handler.get()) { if (handler.get()) {
void* data = NULL; void* data = nullptr;
size_t data_size = 0; size_t data_size = 0;
if (scale_factor != ui::SCALE_FACTOR_NONE) { if (scale_factor != ui::SCALE_FACTOR_NONE) {
if (handler->GetDataResourceForScale( if (handler->GetDataResourceForScale(

View File

@@ -54,7 +54,7 @@ CEF_EXPORT int cef_string_wide_set(const wchar_t* src,
} else { } else {
output->str = const_cast<wchar_t*>(src); output->str = const_cast<wchar_t*>(src);
output->length = src_len; output->length = src_len;
output->dtor = NULL; output->dtor = nullptr;
} }
return 1; return 1;
} }
@@ -78,7 +78,7 @@ CEF_EXPORT int cef_string_utf8_set(const char* src,
} else { } else {
output->str = const_cast<char*>(src); output->str = const_cast<char*>(src);
output->length = src_len; output->length = src_len;
output->dtor = NULL; output->dtor = nullptr;
} }
return 1; return 1;
} }
@@ -103,39 +103,39 @@ CEF_EXPORT int cef_string_utf16_set(const char16* src,
} else { } else {
output->str = const_cast<char16*>(src); output->str = const_cast<char16*>(src);
output->length = src_len; output->length = src_len;
output->dtor = NULL; output->dtor = nullptr;
} }
return 1; return 1;
} }
CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str) { CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str) {
DCHECK(str != NULL); DCHECK(str != nullptr);
if (str->dtor && str->str) if (str->dtor && str->str)
str->dtor(str->str); str->dtor(str->str);
str->str = NULL; str->str = nullptr;
str->length = 0; str->length = 0;
str->dtor = NULL; str->dtor = nullptr;
} }
CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str) { CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str) {
DCHECK(str != NULL); DCHECK(str != nullptr);
if (str->dtor && str->str) if (str->dtor && str->str)
str->dtor(str->str); str->dtor(str->str);
str->str = NULL; str->str = nullptr;
str->length = 0; str->length = 0;
str->dtor = NULL; str->dtor = nullptr;
} }
CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str) { CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str) {
DCHECK(str != NULL); DCHECK(str != nullptr);
if (str->dtor && str->str) if (str->dtor && str->str)
str->dtor(str->str); str->dtor(str->str);
str->str = NULL; str->str = nullptr;
str->length = 0; str->length = 0;
str->dtor = NULL; str->dtor = nullptr;
} }
CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1, CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1,

View File

@@ -26,7 +26,7 @@ CefRefPtr<CefTaskRunner> CefTaskRunner::GetForCurrentThread() {
CefTaskRunnerImpl::GetCurrentTaskRunner(); CefTaskRunnerImpl::GetCurrentTaskRunner();
if (task_runner.get()) if (task_runner.get())
return new CefTaskRunnerImpl(task_runner); return new CefTaskRunnerImpl(task_runner);
return NULL; return nullptr;
} }
// static // static
@@ -37,7 +37,7 @@ CefRefPtr<CefTaskRunner> CefTaskRunner::GetForThread(CefThreadId threadId) {
return new CefTaskRunnerImpl(task_runner); return new CefTaskRunnerImpl(task_runner);
LOG(WARNING) << "Invalid thread id " << threadId; LOG(WARNING) << "Invalid thread id " << threadId;
return NULL; return nullptr;
} }
// CefTaskRunnerImpl // CefTaskRunnerImpl
@@ -56,13 +56,13 @@ scoped_refptr<base::SingleThreadTaskRunner> CefTaskRunnerImpl::GetTaskRunner(
CefContentRendererClient* client = CefContentRendererClient::Get(); CefContentRendererClient* client = CefContentRendererClient::Get();
if (client) if (client)
return client->render_task_runner(); return client->render_task_runner();
return NULL; return nullptr;
} }
// Browser process. // Browser process.
CefContentBrowserClient* client = CefContentBrowserClient::Get(); CefContentBrowserClient* client = CefContentBrowserClient::Get();
if (!client) if (!client)
return NULL; return nullptr;
int id = -1; int id = -1;
switch (threadId) { switch (threadId) {
@@ -93,7 +93,7 @@ scoped_refptr<base::SingleThreadTaskRunner> CefTaskRunnerImpl::GetTaskRunner(
base::TaskPriority::USER_BLOCKING}); base::TaskPriority::USER_BLOCKING});
} }
return NULL; return nullptr;
} }
// static // static

View File

@@ -6,7 +6,7 @@
// CefTrackNode implementation. // CefTrackNode implementation.
CefTrackNode::CefTrackNode() : track_next_(NULL), track_prev_(NULL) {} CefTrackNode::CefTrackNode() : track_next_(nullptr), track_prev_(nullptr) {}
CefTrackNode::~CefTrackNode() {} CefTrackNode::~CefTrackNode() {}
@@ -31,8 +31,8 @@ void CefTrackNode::RemoveTracking() {
track_next_->SetTrackPrev(track_prev_); track_next_->SetTrackPrev(track_prev_);
if (track_prev_) if (track_prev_)
track_prev_->SetTrackNext(track_next_); track_prev_->SetTrackNext(track_next_);
track_next_ = NULL; track_next_ = nullptr;
track_prev_ = NULL; track_prev_ = nullptr;
} }
// CefTrackManager implementation. // CefTrackManager implementation.
@@ -71,6 +71,6 @@ void CefTrackManager::DeleteAll() {
next->RemoveTracking(); next->RemoveTracking();
delete next; delete next;
} }
} while (next != NULL); } while (next != nullptr);
object_count_ = 0; object_count_ = 0;
} }

View File

@@ -19,12 +19,12 @@ CefRefPtr<CefURLRequest> CefURLRequest::Create(
CefRefPtr<CefRequestContext> request_context) { CefRefPtr<CefRequestContext> request_context) {
if (!request.get() || !client.get()) { if (!request.get() || !client.get()) {
NOTREACHED() << "called with invalid parameters"; NOTREACHED() << "called with invalid parameters";
return NULL; return nullptr;
} }
if (!CefTaskRunnerImpl::GetCurrentTaskRunner()) { if (!CefTaskRunnerImpl::GetCurrentTaskRunner()) {
NOTREACHED() << "called on invalid thread"; NOTREACHED() << "called on invalid thread";
return NULL; return nullptr;
} }
if (CefContentClient::Get()->browser()) { if (CefContentClient::Get()->browser()) {
@@ -33,16 +33,16 @@ CefRefPtr<CefURLRequest> CefURLRequest::Create(
new CefBrowserURLRequest(nullptr, request, client, request_context); new CefBrowserURLRequest(nullptr, request, client, request_context);
if (impl->Start()) if (impl->Start())
return impl.get(); return impl.get();
return NULL; return nullptr;
} else if (CefContentClient::Get()->renderer()) { } else if (CefContentClient::Get()->renderer()) {
// In the render process. // In the render process.
CefRefPtr<CefRenderURLRequest> impl = CefRefPtr<CefRenderURLRequest> impl =
new CefRenderURLRequest(nullptr, request, client); new CefRenderURLRequest(nullptr, request, client);
if (impl->Start()) if (impl->Start())
return impl.get(); return impl.get();
return NULL; return nullptr;
} else { } else {
NOTREACHED() << "called in unsupported process"; NOTREACHED() << "called in unsupported process";
return NULL; return nullptr;
} }
} }

View File

@@ -5,7 +5,7 @@
#include "libcef/common/value_base.h" #include "libcef/common/value_base.h"
CefValueController::CefValueController() CefValueController::CefValueController()
: owner_value_(NULL), owner_object_(NULL) {} : owner_value_(nullptr), owner_object_(nullptr) {}
CefValueController::~CefValueController() { CefValueController::~CefValueController() {
// Everything should already have been removed. // Everything should already have been removed.
@@ -56,8 +56,8 @@ void CefValueController::Remove(void* value, bool notify_object) {
// Should never notify when removing the owner object. // Should never notify when removing the owner object.
DCHECK(!notify_object); DCHECK(!notify_object);
owner_value_ = NULL; owner_value_ = nullptr;
owner_object_ = NULL; owner_object_ = nullptr;
// Remove all references. // Remove all references.
if (reference_map_.size() > 0) { if (reference_map_.size() > 0) {
@@ -92,7 +92,7 @@ CefValueController::Object* CefValueController::Get(void* value) {
ReferenceMap::iterator it = reference_map_.find(value); ReferenceMap::iterator it = reference_map_.find(value);
if (it != reference_map_.end()) if (it != reference_map_.end())
return it->second; return it->second;
return NULL; return nullptr;
} }
} }

View File

@@ -301,15 +301,15 @@ class CefValueBase : public CefType, public CefValueController::Object {
DeleteValue(value_); DeleteValue(value_);
} }
controller_ = NULL; controller_ = nullptr;
value_ = NULL; value_ = nullptr;
} }
// Detaches the underlying value and returns a pointer to it. If this is an // Detaches the underlying value and returns a pointer to it. If this is an
// owner and a |new_controller| value is specified any existing references // owner and a |new_controller| value is specified any existing references
// will be passed to the new controller. // will be passed to the new controller.
ValueType* Detach(CefValueController* new_controller) { ValueType* Detach(CefValueController* new_controller) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
// A |new_controller| value is required for mode kOwnerWillDelete. // A |new_controller| value is required for mode kOwnerWillDelete.
DCHECK(!will_delete() || new_controller); DCHECK(!will_delete() || new_controller);
@@ -323,11 +323,11 @@ class CefValueBase : public CefType, public CefValueController::Object {
// Remove the object from the controller. If this is the owner object any // Remove the object from the controller. If this is the owner object any
// references will be detached. // references will be detached.
controller()->Remove(value_, false); controller()->Remove(value_, false);
controller_ = NULL; controller_ = nullptr;
// Return the old value. // Return the old value.
ValueType* old_val = value_; ValueType* old_val = value_;
value_ = NULL; value_ = nullptr;
return old_val; return old_val;
} }
@@ -349,8 +349,8 @@ class CefValueBase : public CefType, public CefValueController::Object {
// Only references should be removed in this manner. // Only references should be removed in this manner.
DCHECK(reference()); DCHECK(reference());
controller_ = NULL; controller_ = nullptr;
value_ = NULL; value_ = nullptr;
} }
// Override to customize value deletion. // Override to customize value deletion.

View File

@@ -118,7 +118,7 @@ bool CefValueImpl::IsValid() {
if (list_value_) if (list_value_)
return list_value_->IsValid(); return list_value_->IsValid();
return (value_ != NULL); return (value_ != nullptr);
} }
bool CefValueImpl::IsOwned() { bool CefValueImpl::IsOwned() {
@@ -317,21 +317,21 @@ bool CefValueImpl::SetString(const CefString& value) {
bool CefValueImpl::SetBinary(CefRefPtr<CefBinaryValue> value) { bool CefValueImpl::SetBinary(CefRefPtr<CefBinaryValue> value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(NULL); SetValueInternal(nullptr);
binary_value_ = value; binary_value_ = value;
return true; return true;
} }
bool CefValueImpl::SetDictionary(CefRefPtr<CefDictionaryValue> value) { bool CefValueImpl::SetDictionary(CefRefPtr<CefDictionaryValue> value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(NULL); SetValueInternal(nullptr);
dictionary_value_ = value; dictionary_value_ = value;
return true; return true;
} }
bool CefValueImpl::SetList(CefRefPtr<CefListValue> value) { bool CefValueImpl::SetList(CefRefPtr<CefListValue> value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(NULL); SetValueInternal(nullptr);
list_value_ = value; list_value_ = value;
return true; return true;
} }
@@ -339,10 +339,10 @@ bool CefValueImpl::SetList(CefRefPtr<CefListValue> value) {
void CefValueImpl::SetValueInternal(base::Value* value) { void CefValueImpl::SetValueInternal(base::Value* value) {
lock_.AssertAcquired(); lock_.AssertAcquired();
value_.reset(NULL); value_.reset(nullptr);
binary_value_ = NULL; binary_value_ = nullptr;
dictionary_value_ = NULL; dictionary_value_ = nullptr;
list_value_ = NULL; list_value_ = nullptr;
if (value) { if (value) {
switch (value->type()) { switch (value->type()) {
@@ -375,7 +375,7 @@ CefValueController* CefValueImpl::GetValueController() const {
return static_cast<CefListValueImpl*>(list_value_.get())->controller(); return static_cast<CefListValueImpl*>(list_value_.get())->controller();
} }
return NULL; return nullptr;
} }
void CefValueImpl::AcquireLock() { void CefValueImpl::AcquireLock() {
@@ -419,7 +419,7 @@ CefRefPtr<CefBinaryValue> CefBinaryValue::Create(const void* data,
DCHECK(data); DCHECK(data);
DCHECK_GT(data_size, (size_t)0); DCHECK_GT(data_size, (size_t)0);
if (!data || data_size == 0) if (!data || data_size == 0)
return NULL; return nullptr;
return new CefBinaryValueImpl(static_cast<char*>(const_cast<void*>(data)), return new CefBinaryValueImpl(static_cast<char*>(const_cast<void*>(data)),
data_size); data_size);
@@ -445,21 +445,21 @@ CefRefPtr<CefBinaryValue> CefBinaryValueImpl::GetOrCreateRef(
CefBinaryValueImpl::CefBinaryValueImpl(base::Value* value, bool will_delete) CefBinaryValueImpl::CefBinaryValueImpl(base::Value* value, bool will_delete)
: CefValueBase<CefBinaryValue, base::Value>( : CefValueBase<CefBinaryValue, base::Value>(
value, value,
NULL, nullptr,
will_delete ? kOwnerWillDelete : kOwnerNoDelete, will_delete ? kOwnerWillDelete : kOwnerNoDelete,
true, true,
NULL) {} nullptr) {}
CefBinaryValueImpl::CefBinaryValueImpl(char* data, size_t data_size) CefBinaryValueImpl::CefBinaryValueImpl(char* data, size_t data_size)
: CefValueBase<CefBinaryValue, base::Value>( : CefValueBase<CefBinaryValue, base::Value>(
new base::Value(std::vector<char>(data, data + data_size)), new base::Value(std::vector<char>(data, data + data_size)),
NULL, nullptr,
kOwnerWillDelete, kOwnerWillDelete,
true, true,
NULL) {} nullptr) {}
base::Value* CefBinaryValueImpl::CopyValue() { base::Value* CefBinaryValueImpl::CopyValue() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return const_value().DeepCopy(); return const_value().DeepCopy();
} }
@@ -491,7 +491,7 @@ bool CefBinaryValueImpl::IsEqualValue(const base::Value* that) {
base::Value* CefBinaryValueImpl::GetValueUnsafe() { base::Value* CefBinaryValueImpl::GetValueUnsafe() {
if (!VerifyAttached()) if (!VerifyAttached())
return NULL; return nullptr;
controller()->AssertLockAcquired(); controller()->AssertLockAcquired();
return const_cast<base::Value*>(&const_value()); return const_cast<base::Value*>(&const_value());
} }
@@ -527,9 +527,9 @@ bool CefBinaryValueImpl::IsEqual(CefRefPtr<CefBinaryValue> that) {
} }
CefRefPtr<CefBinaryValue> CefBinaryValueImpl::Copy() { CefRefPtr<CefBinaryValue> CefBinaryValueImpl::Copy() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return new CefBinaryValueImpl(const_value().DeepCopy(), NULL, return new CefBinaryValueImpl(const_value().DeepCopy(), nullptr,
CefBinaryValueImpl::kOwnerWillDelete, NULL); CefBinaryValueImpl::kOwnerWillDelete, nullptr);
} }
size_t CefBinaryValueImpl::GetSize() { size_t CefBinaryValueImpl::GetSize() {
@@ -595,13 +595,13 @@ CefDictionaryValueImpl::CefDictionaryValueImpl(base::DictionaryValue* value,
bool read_only) bool read_only)
: CefValueBase<CefDictionaryValue, base::DictionaryValue>( : CefValueBase<CefDictionaryValue, base::DictionaryValue>(
value, value,
NULL, nullptr,
will_delete ? kOwnerWillDelete : kOwnerNoDelete, will_delete ? kOwnerWillDelete : kOwnerNoDelete,
read_only, read_only,
NULL) {} nullptr) {}
base::DictionaryValue* CefDictionaryValueImpl::CopyValue() { base::DictionaryValue* CefDictionaryValueImpl::CopyValue() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return const_value().DeepCopy(); return const_value().DeepCopy();
} }
@@ -633,7 +633,7 @@ bool CefDictionaryValueImpl::IsEqualValue(const base::DictionaryValue* that) {
base::DictionaryValue* CefDictionaryValueImpl::GetValueUnsafe() { base::DictionaryValue* CefDictionaryValueImpl::GetValueUnsafe() {
if (!VerifyAttached()) if (!VerifyAttached())
return NULL; return nullptr;
controller()->AssertLockAcquired(); controller()->AssertLockAcquired();
return const_cast<base::DictionaryValue*>(&const_value()); return const_cast<base::DictionaryValue*>(&const_value());
} }
@@ -674,7 +674,7 @@ bool CefDictionaryValueImpl::IsEqual(CefRefPtr<CefDictionaryValue> that) {
CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::Copy( CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::Copy(
bool exclude_empty_children) { bool exclude_empty_children) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
base::DictionaryValue* value; base::DictionaryValue* value;
if (exclude_empty_children) { if (exclude_empty_children) {
@@ -686,7 +686,7 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::Copy(
} }
return new CefDictionaryValueImpl( return new CefDictionaryValueImpl(
value, NULL, CefDictionaryValueImpl::kOwnerWillDelete, false, NULL); value, nullptr, CefDictionaryValueImpl::kOwnerWillDelete, false, nullptr);
} }
size_t CefDictionaryValueImpl::GetSize() { size_t CefDictionaryValueImpl::GetSize() {
@@ -728,7 +728,7 @@ bool CefDictionaryValueImpl::Remove(const CefString& key) {
CefValueType CefDictionaryValueImpl::GetType(const CefString& key) { CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID); CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value)) { &out_value)) {
switch (out_value->type()) { switch (out_value->type()) {
@@ -757,9 +757,9 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
} }
CefRefPtr<CefValue> CefDictionaryValueImpl::GetValue(const CefString& key) { CefRefPtr<CefValue> CefDictionaryValueImpl::GetValue(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value)) { &out_value)) {
return CefValueImpl::GetOrCreateRefOrCopy( return CefValueImpl::GetOrCreateRefOrCopy(
@@ -768,13 +768,13 @@ CefRefPtr<CefValue> CefDictionaryValueImpl::GetValue(const CefString& key) {
controller()); controller());
} }
return NULL; return nullptr;
} }
bool CefDictionaryValueImpl::GetBool(const CefString& key) { bool CefDictionaryValueImpl::GetBool(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, false); CEF_VALUE_VERIFY_RETURN(false, false);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
bool ret_value = false; bool ret_value = false;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value))
@@ -786,7 +786,7 @@ bool CefDictionaryValueImpl::GetBool(const CefString& key) {
int CefDictionaryValueImpl::GetInt(const CefString& key) { int CefDictionaryValueImpl::GetInt(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
int ret_value = 0; int ret_value = 0;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value))
@@ -798,7 +798,7 @@ int CefDictionaryValueImpl::GetInt(const CefString& key) {
double CefDictionaryValueImpl::GetDouble(const CefString& key) { double CefDictionaryValueImpl::GetDouble(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
double ret_value = 0; double ret_value = 0;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value))
@@ -810,7 +810,7 @@ double CefDictionaryValueImpl::GetDouble(const CefString& key) {
CefString CefDictionaryValueImpl::GetString(const CefString& key) { CefString CefDictionaryValueImpl::GetString(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, CefString()); CEF_VALUE_VERIFY_RETURN(false, CefString());
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
std::string ret_value; std::string ret_value;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value))
@@ -821,9 +821,9 @@ CefString CefDictionaryValueImpl::GetString(const CefString& key) {
CefRefPtr<CefBinaryValue> CefDictionaryValueImpl::GetBinary( CefRefPtr<CefBinaryValue> CefDictionaryValueImpl::GetBinary(
const CefString& key) { const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
@@ -834,14 +834,14 @@ CefRefPtr<CefBinaryValue> CefDictionaryValueImpl::GetBinary(
controller()); controller());
} }
return NULL; return nullptr;
} }
CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary( CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary(
const CefString& key) { const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
@@ -853,13 +853,13 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary(
read_only(), controller()); read_only(), controller());
} }
return NULL; return nullptr;
} }
CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) { CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
@@ -871,7 +871,7 @@ CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) {
read_only(), controller()); read_only(), controller());
} }
return NULL; return nullptr;
} }
bool CefDictionaryValueImpl::SetValue(const CefString& key, bool CefDictionaryValueImpl::SetValue(const CefString& key,
@@ -1017,13 +1017,13 @@ CefListValueImpl::CefListValueImpl(base::ListValue* value,
bool read_only) bool read_only)
: CefValueBase<CefListValue, base::ListValue>( : CefValueBase<CefListValue, base::ListValue>(
value, value,
NULL, nullptr,
will_delete ? kOwnerWillDelete : kOwnerNoDelete, will_delete ? kOwnerWillDelete : kOwnerNoDelete,
read_only, read_only,
NULL) {} nullptr) {}
base::ListValue* CefListValueImpl::CopyValue() { base::ListValue* CefListValueImpl::CopyValue() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return const_value().DeepCopy(); return const_value().DeepCopy();
} }
@@ -1055,7 +1055,7 @@ bool CefListValueImpl::IsEqualValue(const base::ListValue* that) {
base::ListValue* CefListValueImpl::GetValueUnsafe() { base::ListValue* CefListValueImpl::GetValueUnsafe() {
if (!VerifyAttached()) if (!VerifyAttached())
return NULL; return nullptr;
controller()->AssertLockAcquired(); controller()->AssertLockAcquired();
return const_cast<base::ListValue*>(&const_value()); return const_cast<base::ListValue*>(&const_value());
} }
@@ -1095,10 +1095,11 @@ bool CefListValueImpl::IsEqual(CefRefPtr<CefListValue> that) {
} }
CefRefPtr<CefListValue> CefListValueImpl::Copy() { CefRefPtr<CefListValue> CefListValueImpl::Copy() {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
return new CefListValueImpl(const_value().DeepCopy(), NULL, return new CefListValueImpl(const_value().DeepCopy(), nullptr,
CefListValueImpl::kOwnerWillDelete, false, NULL); CefListValueImpl::kOwnerWillDelete, false,
nullptr);
} }
bool CefListValueImpl::SetSize(size_t size) { bool CefListValueImpl::SetSize(size_t size) {
@@ -1139,7 +1140,7 @@ bool CefListValueImpl::Remove(size_t index) {
CefValueType CefListValueImpl::GetType(size_t index) { CefValueType CefListValueImpl::GetType(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID); CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value)) { if (const_value().Get(index, &out_value)) {
switch (out_value->type()) { switch (out_value->type()) {
case base::Value::Type::NONE: case base::Value::Type::NONE:
@@ -1167,9 +1168,9 @@ CefValueType CefListValueImpl::GetType(size_t index) {
} }
CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) { CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value)) { if (const_value().Get(index, &out_value)) {
return CefValueImpl::GetOrCreateRefOrCopy( return CefValueImpl::GetOrCreateRefOrCopy(
const_cast<base::Value*>(out_value), const_cast<base::Value*>(out_value),
@@ -1177,13 +1178,13 @@ CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) {
controller()); controller());
} }
return NULL; return nullptr;
} }
bool CefListValueImpl::GetBool(size_t index) { bool CefListValueImpl::GetBool(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, false); CEF_VALUE_VERIFY_RETURN(false, false);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
bool ret_value = false; bool ret_value = false;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value))
@@ -1195,7 +1196,7 @@ bool CefListValueImpl::GetBool(size_t index) {
int CefListValueImpl::GetInt(size_t index) { int CefListValueImpl::GetInt(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
int ret_value = 0; int ret_value = 0;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value))
@@ -1207,7 +1208,7 @@ int CefListValueImpl::GetInt(size_t index) {
double CefListValueImpl::GetDouble(size_t index) { double CefListValueImpl::GetDouble(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
double ret_value = 0; double ret_value = 0;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value))
@@ -1219,7 +1220,7 @@ double CefListValueImpl::GetDouble(size_t index) {
CefString CefListValueImpl::GetString(size_t index) { CefString CefListValueImpl::GetString(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, CefString()); CEF_VALUE_VERIFY_RETURN(false, CefString());
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
std::string ret_value; std::string ret_value;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value))
@@ -1229,9 +1230,9 @@ CefString CefListValueImpl::GetString(size_t index) {
} }
CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) { CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value) && out_value->is_blob()) { if (const_value().Get(index, &out_value) && out_value->is_blob()) {
base::Value* binary_value = const_cast<base::Value*>(out_value); base::Value* binary_value = const_cast<base::Value*>(out_value);
@@ -1240,13 +1241,13 @@ CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
controller()); controller());
} }
return NULL; return nullptr;
} }
CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) { CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value) && out_value->is_dict()) { if (const_value().Get(index, &out_value) && out_value->is_dict()) {
base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>( base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>(
@@ -1256,13 +1257,13 @@ CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
controller()); controller());
} }
return NULL; return nullptr;
} }
CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) { CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, NULL); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = NULL; const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value) && out_value->is_list()) { if (const_value().Get(index, &out_value) && out_value->is_list()) {
base::ListValue* list_value = base::ListValue* list_value =
@@ -1272,7 +1273,7 @@ CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) {
controller()); controller());
} }
return NULL; return nullptr;
} }
bool CefListValueImpl::SetValue(size_t index, CefRefPtr<CefValue> value) { bool CefListValueImpl::SetValue(size_t index, CefRefPtr<CefValue> value) {

View File

@@ -130,10 +130,10 @@ class CefBinaryValueImpl : public CefValueBase<CefBinaryValue, base::Value> {
// Reference an existing value (set |will_delete| to false) or take ownership // Reference an existing value (set |will_delete| to false) or take ownership
// of an existing value (set |will_delete| to true). When referencing an // of an existing value (set |will_delete| to true). When referencing an
// existing value you must explicitly call Detach(NULL) when |value| is no // existing value you must explicitly call Detach(nullptr) when |value| is no
// longer valid. Use GetOrCreateRef instead of this constructor if |value| is // longer valid. Use GetOrCreateRef instead of this constructor if |value| is
// owned by some other object and you do not plan to explicitly call // owned by some other object and you do not plan to explicitly call
// Detach(NULL). // Detach(nullptr).
CefBinaryValueImpl(base::Value* value, bool will_delete); CefBinaryValueImpl(base::Value* value, bool will_delete);
// The data will always be copied. // The data will always be copied.
@@ -186,10 +186,10 @@ class CefDictionaryValueImpl
// Reference an existing value (set |will_delete| to false) or take ownership // Reference an existing value (set |will_delete| to false) or take ownership
// of an existing value (set |will_delete| to true). When referencing an // of an existing value (set |will_delete| to true). When referencing an
// existing value you must explicitly call Detach(NULL) when |value| is no // existing value you must explicitly call Detach(nullptr) when |value| is no
// longer valid. Use GetOrCreateRef instead of this constructor if |value| is // longer valid. Use GetOrCreateRef instead of this constructor if |value| is
// owned by some other object and you do not plan to explicitly call // owned by some other object and you do not plan to explicitly call
// Detach(NULL). // Detach(nullptr).
CefDictionaryValueImpl(base::DictionaryValue* value, CefDictionaryValueImpl(base::DictionaryValue* value,
bool will_delete, bool will_delete,
bool read_only); bool read_only);
@@ -266,10 +266,10 @@ class CefListValueImpl : public CefValueBase<CefListValue, base::ListValue> {
// Reference an existing value (set |will_delete| to false) or take ownership // Reference an existing value (set |will_delete| to false) or take ownership
// of an existing value (set |will_delete| to true). When referencing an // of an existing value (set |will_delete| to true). When referencing an
// existing value you must explicitly call Detach(NULL) when |value| is no // existing value you must explicitly call Detach(nullptr) when |value| is no
// longer valid. Use GetOrCreateRef instead of this constructor if |value| is // longer valid. Use GetOrCreateRef instead of this constructor if |value| is
// owned by some other object and you do not plan to explicitly call // owned by some other object and you do not plan to explicitly call
// Detach(NULL). // Detach(nullptr).
CefListValueImpl(base::ListValue* value, bool will_delete, bool read_only); CefListValueImpl(base::ListValue* value, bool will_delete, bool read_only);
// Return a copy of the value. // Return a copy of the value.

View File

@@ -120,7 +120,8 @@ std::unique_ptr<base::DictionaryValue> ParseManifestFile(
} }
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); std::unique_ptr<base::Value> manifest(
deserializer.Deserialize(nullptr, nullptr));
if (!manifest.get() || !manifest->is_dict()) if (!manifest.get() || !manifest->is_dict())
return nullptr; return nullptr;

View File

@@ -194,17 +194,17 @@ CefContentRendererClient* CefContentRendererClient::Get() {
CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForView( CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForView(
content::RenderView* view) { content::RenderView* view) {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(nullptr);
BrowserMap::const_iterator it = browsers_.find(view); BrowserMap::const_iterator it = browsers_.find(view);
if (it != browsers_.end()) if (it != browsers_.end())
return it->second; return it->second;
return NULL; return nullptr;
} }
CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForMainFrame( CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForMainFrame(
blink::WebFrame* frame) { blink::WebFrame* frame) {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(nullptr);
BrowserMap::const_iterator it = browsers_.begin(); BrowserMap::const_iterator it = browsers_.begin();
for (; it != browsers_.end(); ++it) { for (; it != browsers_.end(); ++it) {
@@ -215,7 +215,7 @@ CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForMainFrame(
} }
} }
return NULL; return nullptr;
} }
void CefContentRendererClient::OnBrowserDestroyed(CefBrowserImpl* browser) { void CefContentRendererClient::OnBrowserDestroyed(CefBrowserImpl* browser) {
@@ -341,7 +341,7 @@ CefContentRendererClient::GetCurrentTaskRunner() {
// Check if currently on the render thread. // Check if currently on the render thread.
if (CEF_CURRENTLY_ON_RT()) if (CEF_CURRENTLY_ON_RT())
return render_task_runner_; return render_task_runner_;
return NULL; return nullptr;
} }
void CefContentRendererClient::RunSingleProcessCleanup() { void CefContentRendererClient::RunSingleProcessCleanup() {
@@ -462,7 +462,7 @@ void CefContentRendererClient::RenderThreadConnected() {
CefRefPtr<CefListValueImpl> listValuePtr( CefRefPtr<CefListValueImpl> listValuePtr(
new CefListValueImpl(&params.extra_info, false, true)); new CefListValueImpl(&params.extra_info, false, true));
handler->OnRenderThreadCreated(listValuePtr.get()); handler->OnRenderThreadCreated(listValuePtr.get());
listValuePtr->Detach(NULL); listValuePtr->Detach(nullptr);
} }
} }
@@ -777,7 +777,7 @@ CefRefPtr<CefBrowserImpl> CefContentRendererClient::MaybeCreateBrowser(
CefRefPtr<CefDictionaryValueImpl> dictValuePtr( CefRefPtr<CefDictionaryValueImpl> dictValuePtr(
new CefDictionaryValueImpl(&params.extra_info, false, true)); new CefDictionaryValueImpl(&params.extra_info, false, true));
handler->OnBrowserCreated(browser.get(), dictValuePtr.get()); handler->OnBrowserCreated(browser.get(), dictValuePtr.get());
dictValuePtr->Detach(NULL); dictValuePtr->Detach(nullptr);
} }
} }
@@ -788,7 +788,7 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
// Clean up the single existing RenderProcessHost. // Clean up the single existing RenderProcessHost.
content::RenderProcessHost* host = NULL; content::RenderProcessHost* host = nullptr;
content::RenderProcessHost::iterator iterator( content::RenderProcessHost::iterator iterator(
content::RenderProcessHost::AllHostsIterator()); content::RenderProcessHost::AllHostsIterator());
if (!iterator.IsAtEnd()) { if (!iterator.IsAtEnd()) {

View File

@@ -34,7 +34,7 @@ CefDOMDocumentImpl::~CefDOMDocumentImpl() {
CEF_REQUIRE_RT(); CEF_REQUIRE_RT();
// Verify that the Detach() method has been called. // Verify that the Detach() method has been called.
DCHECK(frame_ == NULL); DCHECK(frame_ == nullptr);
} }
CefDOMDocumentImpl::Type CefDOMDocumentImpl::GetType() { CefDOMDocumentImpl::Type CefDOMDocumentImpl::GetType() {
@@ -189,11 +189,11 @@ CefString CefDOMDocumentImpl::GetCompleteURL(const CefString& partialURL) {
CefRefPtr<CefDOMNode> CefDOMDocumentImpl::GetOrCreateNode( CefRefPtr<CefDOMNode> CefDOMDocumentImpl::GetOrCreateNode(
const blink::WebNode& node) { const blink::WebNode& node) {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
// Nodes may potentially be null. // Nodes may potentially be null.
if (node.IsNull()) if (node.IsNull())
return NULL; return nullptr;
if (!node_map_.empty()) { if (!node_map_.empty()) {
// Locate the existing node, if any. // Locate the existing node, if any.
@@ -238,11 +238,11 @@ void CefDOMDocumentImpl::Detach() {
node_map_.clear(); node_map_.clear();
} }
frame_ = NULL; frame_ = nullptr;
} }
bool CefDOMDocumentImpl::VerifyContext() { bool CefDOMDocumentImpl::VerifyContext() {
if (!CEF_CURRENTLY_ON_RT() || frame_ == NULL) { if (!CEF_CURRENTLY_ON_RT() || frame_ == nullptr) {
NOTREACHED(); NOTREACHED();
return false; return false;
} }

View File

@@ -214,28 +214,28 @@ CefString CefDOMNodeImpl::GetAsMarkup() {
CefRefPtr<CefDOMDocument> CefDOMNodeImpl::GetDocument() { CefRefPtr<CefDOMDocument> CefDOMNodeImpl::GetDocument() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return document_.get(); return document_.get();
} }
CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetParent() { CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetParent() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return document_->GetOrCreateNode(node_.ParentNode()); return document_->GetOrCreateNode(node_.ParentNode());
} }
CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetPreviousSibling() { CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetPreviousSibling() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return document_->GetOrCreateNode(node_.PreviousSibling()); return document_->GetOrCreateNode(node_.PreviousSibling());
} }
CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetNextSibling() { CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetNextSibling() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return document_->GetOrCreateNode(node_.NextSibling()); return document_->GetOrCreateNode(node_.NextSibling());
} }
@@ -249,14 +249,14 @@ bool CefDOMNodeImpl::HasChildren() {
CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetFirstChild() { CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetFirstChild() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return document_->GetOrCreateNode(node_.FirstChild()); return document_->GetOrCreateNode(node_.FirstChild());
} }
CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetLastChild() { CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetLastChild() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return document_->GetOrCreateNode(node_.LastChild()); return document_->GetOrCreateNode(node_.LastChild());
} }
@@ -397,7 +397,7 @@ CefRect CefDOMNodeImpl::GetElementBounds() {
} }
void CefDOMNodeImpl::Detach() { void CefDOMNodeImpl::Detach() {
document_ = NULL; document_ = nullptr;
node_.Assign(WebNode()); node_.Assign(WebNode());
} }

View File

@@ -59,7 +59,7 @@ CefFrameImpl::~CefFrameImpl() {}
bool CefFrameImpl::IsValid() { bool CefFrameImpl::IsValid() {
CEF_REQUIRE_RT_RETURN(false); CEF_REQUIRE_RT_RETURN(false);
return (frame_ != NULL); return (frame_ != nullptr);
} }
void CefFrameImpl::Undo() { void CefFrameImpl::Undo() {
@@ -174,7 +174,7 @@ bool CefFrameImpl::IsMain() {
CEF_REQUIRE_RT_RETURN(false); CEF_REQUIRE_RT_RETURN(false);
if (frame_) if (frame_)
return (frame_->Parent() == NULL); return (frame_->Parent() == nullptr);
return false; return false;
} }
@@ -202,7 +202,7 @@ int64 CefFrameImpl::GetIdentifier() {
} }
CefRefPtr<CefFrame> CefFrameImpl::GetParent() { CefRefPtr<CefFrame> CefFrameImpl::GetParent() {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(nullptr);
if (frame_) { if (frame_) {
blink::WebFrame* parent = frame_->Parent(); blink::WebFrame* parent = frame_->Parent();
@@ -210,7 +210,7 @@ CefRefPtr<CefFrame> CefFrameImpl::GetParent() {
return browser_->GetWebFrameImpl(parent->ToWebLocalFrame()).get(); return browser_->GetWebFrameImpl(parent->ToWebLocalFrame()).get();
} }
return NULL; return nullptr;
} }
CefString CefFrameImpl::GetURL() { CefString CefFrameImpl::GetURL() {
@@ -225,20 +225,20 @@ CefString CefFrameImpl::GetURL() {
} }
CefRefPtr<CefBrowser> CefFrameImpl::GetBrowser() { CefRefPtr<CefBrowser> CefFrameImpl::GetBrowser() {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(nullptr);
return browser_; return browser_;
} }
CefRefPtr<CefV8Context> CefFrameImpl::GetV8Context() { CefRefPtr<CefV8Context> CefFrameImpl::GetV8Context() {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(nullptr);
if (frame_) { if (frame_) {
v8::Isolate* isolate = blink::MainThreadIsolate(); v8::Isolate* isolate = blink::MainThreadIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
return new CefV8ContextImpl(isolate, frame_->MainWorldScriptContext()); return new CefV8ContextImpl(isolate, frame_->MainWorldScriptContext());
} else { } else {
return NULL; return nullptr;
} }
} }
@@ -264,16 +264,16 @@ void CefFrameImpl::VisitDOM(CefRefPtr<CefDOMVisitor> visitor) {
CefRefPtr<CefURLRequest> CefFrameImpl::CreateURLRequest( CefRefPtr<CefURLRequest> CefFrameImpl::CreateURLRequest(
CefRefPtr<CefRequest> request, CefRefPtr<CefRequest> request,
CefRefPtr<CefURLRequestClient> client) { CefRefPtr<CefURLRequestClient> client) {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(nullptr);
if (!request || !client || !frame_) if (!request || !client || !frame_)
return NULL; return nullptr;
CefRefPtr<CefRenderURLRequest> impl = CefRefPtr<CefRenderURLRequest> impl =
new CefRenderURLRequest(this, request, client); new CefRenderURLRequest(this, request, client);
if (impl->Start()) if (impl->Start())
return impl.get(); return impl.get();
return NULL; return nullptr;
} }
void CefFrameImpl::SendProcessMessage(CefProcessId target_process, void CefFrameImpl::SendProcessMessage(CefProcessId target_process,

View File

@@ -21,7 +21,7 @@
using content::BrowserThread; using content::BrowserThread;
CefRenderMessageFilter::CefRenderMessageFilter() : channel_(NULL) {} CefRenderMessageFilter::CefRenderMessageFilter() : channel_(nullptr) {}
CefRenderMessageFilter::~CefRenderMessageFilter() {} CefRenderMessageFilter::~CefRenderMessageFilter() {}

View File

@@ -210,13 +210,13 @@ class CefRenderURLRequest::Context
} }
if (loader_.get()) if (loader_.get())
loader_.reset(NULL); loader_.reset(nullptr);
DCHECK(url_request_.get()); DCHECK(url_request_.get());
client_->OnRequestComplete(url_request_.get()); client_->OnRequestComplete(url_request_.get());
// This may result in the Context object being deleted. // This may result in the Context object being deleted.
url_request_ = NULL; url_request_ = nullptr;
} }
void OnBodyReadable(MojoResult, const mojo::HandleSignalsState&) { void OnBodyReadable(MojoResult, const mojo::HandleSignalsState&) {
@@ -426,13 +426,13 @@ bool CefRenderURLRequest::Start() {
CefRefPtr<CefRequest> CefRenderURLRequest::GetRequest() { CefRefPtr<CefRequest> CefRenderURLRequest::GetRequest() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return context_->request(); return context_->request();
} }
CefRefPtr<CefURLRequestClient> CefRenderURLRequest::GetClient() { CefRefPtr<CefURLRequestClient> CefRenderURLRequest::GetClient() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return context_->client(); return context_->client();
} }
@@ -450,7 +450,7 @@ CefURLRequest::ErrorCode CefRenderURLRequest::GetRequestError() {
CefRefPtr<CefResponse> CefRenderURLRequest::GetResponse() { CefRefPtr<CefResponse> CefRenderURLRequest::GetResponse() {
if (!VerifyContext()) if (!VerifyContext())
return NULL; return nullptr;
return context_->response(); return context_->response();
} }

View File

@@ -206,7 +206,7 @@ class CefV8StateManager {
void DestroyIsolateManager() { void DestroyIsolateManager() {
DCHECK(current_tls_.Get()); DCHECK(current_tls_.Get());
delete current_tls_.Get(); delete current_tls_.Get();
current_tls_.Set(NULL); current_tls_.Set(nullptr);
} }
CefV8IsolateManager* GetIsolateManager() { CefV8IsolateManager* GetIsolateManager() {
@@ -293,7 +293,7 @@ class V8TrackObject : public CefTrackNode {
if (GetPrivate(context, object, kCefTrackObject, &value)) if (GetPrivate(context, object, kCefTrackObject, &value))
return static_cast<V8TrackObject*>(v8::External::Cast(*value)->Value()); return static_cast<V8TrackObject*>(v8::External::Cast(*value)->Value());
return NULL; return nullptr;
} }
private: private:
@@ -999,7 +999,7 @@ CefRefPtr<CefFrame> CefV8ContextImpl::GetFrame() {
} }
CefRefPtr<CefV8Value> CefV8ContextImpl::GetGlobal() { CefRefPtr<CefV8Value> CefV8ContextImpl::GetGlobal() {
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(NULL); CEF_V8_REQUIRE_VALID_HANDLE_RETURN(nullptr);
if (blink_glue::IsScriptForbidden()) if (blink_glue::IsScriptForbidden())
return nullptr; return nullptr;
@@ -1072,8 +1072,8 @@ bool CefV8ContextImpl::Eval(const CefString& code,
int start_line, int start_line,
CefRefPtr<CefV8Value>& retval, CefRefPtr<CefV8Value>& retval,
CefRefPtr<CefV8Exception>& exception) { CefRefPtr<CefV8Exception>& exception) {
retval = NULL; retval = nullptr;
exception = NULL; exception = nullptr;
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false);
@@ -1240,7 +1240,7 @@ void CefV8ValueImpl::Handle::SecondWeakCallback(
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateUndefined() { CefRefPtr<CefV8Value> CefV8Value::CreateUndefined() {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitUndefined(); impl->InitUndefined();
@@ -1249,7 +1249,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateUndefined() {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateNull() { CefRefPtr<CefV8Value> CefV8Value::CreateNull() {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitNull(); impl->InitNull();
@@ -1258,7 +1258,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateNull() {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value) { CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitBool(value); impl->InitBool(value);
@@ -1267,7 +1267,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value) {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) { CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitInt(value); impl->InitInt(value);
@@ -1276,7 +1276,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32 value) { CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32 value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitUInt(value); impl->InitUInt(value);
@@ -1285,7 +1285,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32 value) {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value) { CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitDouble(value); impl->InitDouble(value);
@@ -1294,7 +1294,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value) {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateDate(const CefTime& value) { CefRefPtr<CefV8Value> CefV8Value::CreateDate(const CefTime& value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitDate(value); impl->InitDate(value);
@@ -1303,7 +1303,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateDate(const CefTime& value) {
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateString(const CefString& value) { CefRefPtr<CefV8Value> CefV8Value::CreateString(const CefString& value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
CefString str(value); CefString str(value);
@@ -1315,7 +1315,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateString(const CefString& value) {
CefRefPtr<CefV8Value> CefV8Value::CreateObject( CefRefPtr<CefV8Value> CefV8Value::CreateObject(
CefRefPtr<CefV8Accessor> accessor, CefRefPtr<CefV8Accessor> accessor,
CefRefPtr<CefV8Interceptor> interceptor) { CefRefPtr<CefV8Interceptor> interceptor) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
@@ -1323,7 +1323,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
// Create the new V8 object. If an interceptor is passed, create object from // Create the new V8 object. If an interceptor is passed, create object from
@@ -1343,7 +1343,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
v8::MaybeLocal<v8::Object> maybe_object = tmpl->NewInstance(context); v8::MaybeLocal<v8::Object> maybe_object = tmpl->NewInstance(context);
if (!maybe_object.ToLocal<v8::Object>(&obj)) { if (!maybe_object.ToLocal<v8::Object>(&obj)) {
NOTREACHED() << "Failed to create V8 Object with interceptor"; NOTREACHED() << "Failed to create V8 Object with interceptor";
return NULL; return nullptr;
} }
} else { } else {
obj = v8::Object::New(isolate); obj = v8::Object::New(isolate);
@@ -1366,7 +1366,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) { CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
@@ -1374,7 +1374,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
// Create a tracker object that will cause the user data reference to be // Create a tracker object that will cause the user data reference to be
@@ -1397,14 +1397,14 @@ CefRefPtr<CefV8Value> CefV8Value::CreateArrayBuffer(
void* buffer, void* buffer,
size_t length, size_t length,
CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback) { CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
// Create a tracker object that will cause the user data reference to be // Create a tracker object that will cause the user data reference to be
@@ -1425,11 +1425,11 @@ CefRefPtr<CefV8Value> CefV8Value::CreateArrayBuffer(
CefRefPtr<CefV8Value> CefV8Value::CreateFunction( CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
const CefString& name, const CefString& name,
CefRefPtr<CefV8Handler> handler) { CefRefPtr<CefV8Handler> handler) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
if (!handler.get()) { if (!handler.get()) {
NOTREACHED() << "invalid parameter"; NOTREACHED() << "invalid parameter";
return NULL; return nullptr;
} }
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
@@ -1438,7 +1438,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
v8::Local<v8::External> function_data = v8::Local<v8::External> function_data =
@@ -1453,7 +1453,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
v8::Local<v8::Function> func; v8::Local<v8::Function> func;
if (!maybe_func.ToLocal(&func)) { if (!maybe_func.ToLocal(&func)) {
NOTREACHED() << "failed to create V8 function"; NOTREACHED() << "failed to create V8 function";
return NULL; return nullptr;
} }
func->SetName(GetV8String(isolate, name)); func->SetName(GetV8String(isolate, name));
@@ -1523,7 +1523,7 @@ void CefV8ValueImpl::InitFromV8Value(v8::Local<v8::Context> context,
value->ToString(context).ToLocalChecked(), rv); value->ToString(context).ToLocalChecked(), rv);
InitString(rv); InitString(rv);
} else if (value->IsObject()) { } else if (value->IsObject()) {
InitObject(value, NULL); InitObject(value, nullptr);
} }
} }
@@ -1575,10 +1575,10 @@ void CefV8ValueImpl::InitString(CefString& value) {
if (str) { if (str) {
string_value_ = *str; string_value_ = *str;
cef_string_t* writable_struct = value.GetWritableStruct(); cef_string_t* writable_struct = value.GetWritableStruct();
writable_struct->str = NULL; writable_struct->str = nullptr;
writable_struct->length = 0; writable_struct->length = 0;
} else { } else {
string_value_.str = NULL; string_value_.str = nullptr;
string_value_.length = 0; string_value_.length = 0;
} }
} }
@@ -1804,17 +1804,17 @@ bool CefV8ValueImpl::IsUserCreated() {
v8::Local<v8::Object> obj = value->ToObject(context).ToLocalChecked(); v8::Local<v8::Object> obj = value->ToObject(context).ToLocalChecked();
V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
return (tracker != NULL); return (tracker != nullptr);
} }
bool CefV8ValueImpl::HasException() { bool CefV8ValueImpl::HasException() {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
return (last_exception_.get() != NULL); return (last_exception_.get() != nullptr);
} }
CefRefPtr<CefV8Exception> CefV8ValueImpl::GetException() { CefRefPtr<CefV8Exception> CefV8ValueImpl::GetException() {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(nullptr);
return last_exception_; return last_exception_;
} }
@@ -1822,7 +1822,7 @@ CefRefPtr<CefV8Exception> CefV8ValueImpl::GetException() {
bool CefV8ValueImpl::ClearException() { bool CefV8ValueImpl::ClearException() {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
last_exception_ = NULL; last_exception_ = nullptr;
return true; return true;
} }
@@ -1926,7 +1926,7 @@ bool CefV8ValueImpl::DeleteValue(int index) {
} }
CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) { CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(nullptr);
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
@@ -1934,7 +1934,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
@@ -1947,15 +1947,15 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
if (!HasCaught(context, try_catch) && !ret_value.IsEmpty()) { if (!HasCaught(context, try_catch) && !ret_value.IsEmpty()) {
return new CefV8ValueImpl(isolate, context, ret_value.ToLocalChecked()); return new CefV8ValueImpl(isolate, context, ret_value.ToLocalChecked());
} }
return NULL; return nullptr;
} }
CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) { CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(nullptr);
if (index < 0) { if (index < 0) {
NOTREACHED() << "invalid input parameter"; NOTREACHED() << "invalid input parameter";
return NULL; return nullptr;
} }
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
@@ -1964,7 +1964,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
@@ -1977,7 +1977,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
if (!HasCaught(context, try_catch) && !ret_value.IsEmpty()) { if (!HasCaught(context, try_catch) && !ret_value.IsEmpty()) {
return new CefV8ValueImpl(isolate, context, ret_value.ToLocalChecked()); return new CefV8ValueImpl(isolate, context, ret_value.ToLocalChecked());
} }
return NULL; return nullptr;
} }
bool CefV8ValueImpl::SetValue(const CefString& key, bool CefV8ValueImpl::SetValue(const CefString& key,
@@ -2083,7 +2083,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key,
v8::AccessorNameGetterCallback getter = AccessorNameGetterCallbackImpl; v8::AccessorNameGetterCallback getter = AccessorNameGetterCallbackImpl;
v8::AccessorNameSetterCallback setter = v8::AccessorNameSetterCallback setter =
(attribute & V8_PROPERTY_ATTRIBUTE_READONLY) (attribute & V8_PROPERTY_ATTRIBUTE_READONLY)
? NULL ? nullptr
: AccessorNameSetterCallbackImpl; : AccessorNameSetterCallbackImpl;
v8::TryCatch try_catch(isolate); v8::TryCatch try_catch(isolate);
@@ -2148,7 +2148,7 @@ bool CefV8ValueImpl::SetUserData(CefRefPtr<CefBaseRefCounted> user_data) {
} }
CefRefPtr<CefBaseRefCounted> CefV8ValueImpl::GetUserData() { CefRefPtr<CefBaseRefCounted> CefV8ValueImpl::GetUserData() {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(nullptr);
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
@@ -2156,7 +2156,7 @@ CefRefPtr<CefBaseRefCounted> CefV8ValueImpl::GetUserData() {
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
@@ -2166,7 +2166,7 @@ CefRefPtr<CefBaseRefCounted> CefV8ValueImpl::GetUserData() {
if (tracker) if (tracker)
return tracker->GetUserData(); return tracker->GetUserData();
return NULL; return nullptr;
} }
int CefV8ValueImpl::GetExternallyAllocatedMemory() { int CefV8ValueImpl::GetExternallyAllocatedMemory() {
@@ -2246,13 +2246,13 @@ CefV8ValueImpl::GetArrayBufferReleaseCallback() {
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsArrayBuffer()) { if (!value->IsArrayBuffer()) {
NOTREACHED() << "V8 value is not an array buffer"; NOTREACHED() << "V8 value is not an array buffer";
return NULL; return nullptr;
} }
v8::Local<v8::Object> obj = value->ToObject(context).ToLocalChecked(); v8::Local<v8::Object> obj = value->ToObject(context).ToLocalChecked();
@@ -2261,7 +2261,7 @@ CefV8ValueImpl::GetArrayBufferReleaseCallback() {
if (tracker) if (tracker)
return tracker->GetReleaseCallback(); return tracker->GetReleaseCallback();
return NULL; return nullptr;
} }
bool CefV8ValueImpl::NeuterArrayBuffer() { bool CefV8ValueImpl::NeuterArrayBuffer() {
@@ -2320,7 +2320,7 @@ CefString CefV8ValueImpl::GetFunctionName() {
} }
CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() { CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(nullptr);
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
@@ -2328,13 +2328,13 @@ CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() {
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) { if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context"; NOTREACHED() << "not currently in a V8 context";
return NULL; return nullptr;
} }
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) { if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function"; NOTREACHED() << "V8 value is not a function";
return NULL; return nullptr;
} }
v8::Local<v8::Object> obj = value->ToObject(context).ToLocalChecked(); v8::Local<v8::Object> obj = value->ToObject(context).ToLocalChecked();
@@ -2342,7 +2342,7 @@ CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() {
if (tracker) if (tracker)
return tracker->GetHandler(); return tracker->GetHandler();
return NULL; return nullptr;
} }
CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunction( CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunction(
@@ -2357,7 +2357,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Context> context,
CefRefPtr<CefV8Value> object, CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments) { const CefV8ValueList& arguments) {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(nullptr);
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
@@ -2369,11 +2369,11 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
if (context.get() && !context->IsValid()) { if (context.get() && !context->IsValid()) {
NOTREACHED() << "invalid V8 context parameter"; NOTREACHED() << "invalid V8 context parameter";
return NULL; return nullptr;
} }
if (object.get() && (!object->IsValid() || !object->IsObject())) { if (object.get() && (!object->IsValid() || !object->IsObject())) {
NOTREACHED() << "invalid V8 object parameter"; NOTREACHED() << "invalid V8 object parameter";
return NULL; return nullptr;
} }
int argc = arguments.size(); int argc = arguments.size();
@@ -2381,7 +2381,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
for (int i = 0; i < argc; ++i) { for (int i = 0; i < argc; ++i) {
if (!arguments[i].get() || !arguments[i]->IsValid()) { if (!arguments[i].get() || !arguments[i]->IsValid()) {
NOTREACHED() << "invalid V8 arguments parameter"; NOTREACHED() << "invalid V8 arguments parameter";
return NULL; return nullptr;
} }
} }
} }
@@ -2409,7 +2409,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
recv = context_local->Global(); recv = context_local->Global();
} }
v8::Local<v8::Value>* argv = NULL; v8::Local<v8::Value>* argv = nullptr;
if (argc > 0) { if (argc > 0) {
argv = new v8::Local<v8::Value>[argc]; argv = new v8::Local<v8::Value>[argc];
for (int i = 0; i < argc; ++i) { for (int i = 0; i < argc; ++i) {
@@ -2448,7 +2448,7 @@ bool CefV8ValueImpl::HasCaught(v8::Local<v8::Context> context,
return true; return true;
} else { } else {
if (last_exception_.get()) if (last_exception_.get())
last_exception_ = NULL; last_exception_ = nullptr;
return false; return false;
} }
} }
@@ -2457,14 +2457,14 @@ bool CefV8ValueImpl::HasCaught(v8::Local<v8::Context> context,
// static // static
CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) { CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::Isolate* isolate = GetIsolateManager()->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
isolate, frame_limit, v8::StackTrace::kDetailed); isolate, frame_limit, v8::StackTrace::kDetailed);
if (stackTrace.IsEmpty()) if (stackTrace.IsEmpty())
return NULL; return nullptr;
return new CefV8StackTraceImpl(isolate, stackTrace); return new CefV8StackTraceImpl(isolate, stackTrace);
} }
@@ -2495,7 +2495,7 @@ int CefV8StackTraceImpl::GetFrameCount() {
CefRefPtr<CefV8StackFrame> CefV8StackTraceImpl::GetFrame(int index) { CefRefPtr<CefV8StackFrame> CefV8StackTraceImpl::GetFrame(int index) {
if (index < 0 || index >= static_cast<int>(frames_.size())) if (index < 0 || index >= static_cast<int>(frames_.size()))
return NULL; return nullptr;
return frames_[index]; return frames_[index];
} }

View File

@@ -13,7 +13,7 @@ CefRefPtr<CefBaseRefCounted> CefCppToCRefCounted<
cef_base_ref_counted_t>::UnwrapDerived(CefWrapperType type, cef_base_ref_counted_t>::UnwrapDerived(CefWrapperType type,
cef_base_ref_counted_t* s) { cef_base_ref_counted_t* s) {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
template <> template <>

View File

@@ -19,7 +19,7 @@ CefRawPtr<CefBaseScoped>
CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped, cef_base_scoped_t>:: CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped, cef_base_scoped_t>::
UnwrapDerivedRaw(CefWrapperType type, cef_base_scoped_t* s) { UnwrapDerivedRaw(CefWrapperType type, cef_base_scoped_t* s) {
NOTREACHED(); NOTREACHED();
return NULL; return nullptr;
} }
template <> template <>

View File

@@ -22,7 +22,7 @@ class CefCppToCRefCounted : public CefBaseRefCounted {
// passing an object instance the other side. // passing an object instance the other side.
static StructName* Wrap(CefRefPtr<BaseName> c) { static StructName* Wrap(CefRefPtr<BaseName> c) {
if (!c.get()) if (!c.get())
return NULL; return nullptr;
// Wrap our object with the CefCppToCRefCounted class. // Wrap our object with the CefCppToCRefCounted class.
ClassName* wrapper = new ClassName(); ClassName* wrapper = new ClassName();
@@ -38,7 +38,7 @@ class CefCppToCRefCounted : public CefBaseRefCounted {
// back from the other side. // back from the other side.
static CefRefPtr<BaseName> Unwrap(StructName* s) { static CefRefPtr<BaseName> Unwrap(StructName* s) {
if (!s) if (!s)
return NULL; return nullptr;
// Cast our structure to the wrapper structure type. // Cast our structure to the wrapper structure type.
WrapperStruct* wrapperStruct = GetWrapperStruct(s); WrapperStruct* wrapperStruct = GetWrapperStruct(s);

View File

@@ -34,7 +34,7 @@ class CefCppToCScoped : public CefBaseScoped {
// } // }
static StructName* WrapOwn(CefOwnPtr<BaseName> c) { static StructName* WrapOwn(CefOwnPtr<BaseName> c) {
if (!c) if (!c)
return NULL; return nullptr;
// Wrap our object with the CefCppToC class. // Wrap our object with the CefCppToC class.
ClassName* wrapper = new ClassName(); ClassName* wrapper = new ClassName();
@@ -97,7 +97,7 @@ class CefCppToCScoped : public CefBaseScoped {
// We're giving up ownership of the underlying object. Clear the pointer so // We're giving up ownership of the underlying object. Clear the pointer so
// it doesn't get deleted. // it doesn't get deleted.
BaseName* object = wrapperStruct->object_; BaseName* object = wrapperStruct->object_;
wrapperStruct->object_ = NULL; wrapperStruct->object_ = nullptr;
delete wrapperStruct->wrapper_; delete wrapperStruct->wrapper_;
@@ -114,7 +114,7 @@ class CefCppToCScoped : public CefBaseScoped {
// } // }
static CefRawPtr<BaseName> UnwrapRaw(StructName* s) { static CefRawPtr<BaseName> UnwrapRaw(StructName* s) {
if (!s) if (!s)
return NULL; return nullptr;
// Cast our structure to the wrapper structure type. // Cast our structure to the wrapper structure type.
WrapperStruct* wrapperStruct = GetWrapperStruct(s); WrapperStruct* wrapperStruct = GetWrapperStruct(s);

View File

@@ -112,7 +112,7 @@ template <class ClassName, class BaseName, class StructName>
CefRefPtr<BaseName> CefCToCppRefCounted<ClassName, BaseName, StructName>::Wrap( CefRefPtr<BaseName> CefCToCppRefCounted<ClassName, BaseName, StructName>::Wrap(
StructName* s) { StructName* s) {
if (!s) if (!s)
return NULL; return nullptr;
// Wrap their structure with the CefCToCppRefCounted object. // Wrap their structure with the CefCToCppRefCounted object.
WrapperStruct* wrapperStruct = new WrapperStruct; WrapperStruct* wrapperStruct = new WrapperStruct;
@@ -132,7 +132,7 @@ template <class ClassName, class BaseName, class StructName>
StructName* CefCToCppRefCounted<ClassName, BaseName, StructName>::Unwrap( StructName* CefCToCppRefCounted<ClassName, BaseName, StructName>::Unwrap(
CefRefPtr<BaseName> c) { CefRefPtr<BaseName> c) {
if (!c.get()) if (!c.get())
return NULL; return nullptr;
WrapperStruct* wrapperStruct = GetWrapperStruct(c.get()); WrapperStruct* wrapperStruct = GetWrapperStruct(c.get());

View File

@@ -122,7 +122,7 @@ template <class ClassName, class BaseName, class StructName>
StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapOwn( StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapOwn(
CefOwnPtr<BaseName> c) { CefOwnPtr<BaseName> c) {
if (!c.get()) if (!c.get())
return NULL; return nullptr;
WrapperStruct* wrapperStruct = GetWrapperStruct(c.get()); WrapperStruct* wrapperStruct = GetWrapperStruct(c.get());
@@ -140,7 +140,7 @@ StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapOwn(
#endif #endif
// Don't delete the original object when the wrapper is deleted. // Don't delete the original object when the wrapper is deleted.
wrapperStruct->struct_ = NULL; wrapperStruct->struct_ = nullptr;
// Return the original structure. // Return the original structure.
return orig_struct; return orig_struct;
@@ -151,7 +151,7 @@ template <class ClassName, class BaseName, class StructName>
StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapRaw( StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapRaw(
CefRawPtr<BaseName> c) { CefRawPtr<BaseName> c) {
if (!c) if (!c)
return NULL; return nullptr;
WrapperStruct* wrapperStruct = GetWrapperStruct(c); WrapperStruct* wrapperStruct = GetWrapperStruct(c);

View File

@@ -48,7 +48,7 @@ class CefBrowserInfoMap {
// Add an object associated with the specified ID values. // Add an object associated with the specified ID values.
void Add(int browser_id, IdType info_id, ObjectType info) { void Add(int browser_id, IdType info_id, ObjectType info) {
InfoMap* info_map = NULL; InfoMap* info_map = nullptr;
typename BrowserInfoMap::const_iterator it_browser = typename BrowserInfoMap::const_iterator it_browser =
browser_info_map_.find(browser_id); browser_info_map_.find(browser_id);
if (it_browser == browser_info_map_.end()) { if (it_browser == browser_info_map_.end()) {

View File

@@ -97,7 +97,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
if (!persistent_) { if (!persistent_) {
// Non-persistent callbacks are only good for a single use. // Non-persistent callbacks are only good for a single use.
router_ = NULL; router_ = nullptr;
} }
} }
} }
@@ -118,13 +118,13 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
error_message)); error_message));
// Failure always invalidates the callback. // Failure always invalidates the callback.
router_ = NULL; router_ = nullptr;
} }
} }
void Detach() { void Detach() {
CEF_REQUIRE_UI_THREAD(); CEF_REQUIRE_UI_THREAD();
router_ = NULL; router_ = nullptr;
} }
private: private:
@@ -161,7 +161,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
bool RemoveHandler(Handler* handler) OVERRIDE { bool RemoveHandler(Handler* handler) OVERRIDE {
CEF_REQUIRE_UI_THREAD(); CEF_REQUIRE_UI_THREAD();
if (handler_set_.erase(handler) > 0) { if (handler_set_.erase(handler) > 0) {
CancelPendingFor(NULL, handler, true); CancelPendingFor(nullptr, handler, true);
return true; return true;
} }
return false; return false;
@@ -222,17 +222,17 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
} }
void OnBeforeClose(CefRefPtr<CefBrowser> browser) OVERRIDE { void OnBeforeClose(CefRefPtr<CefBrowser> browser) OVERRIDE {
CancelPendingFor(browser, NULL, false); CancelPendingFor(browser, nullptr, false);
} }
void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser) OVERRIDE { void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser) OVERRIDE {
CancelPendingFor(browser, NULL, false); CancelPendingFor(browser, nullptr, false);
} }
void OnBeforeBrowse(CefRefPtr<CefBrowser> browser, void OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) OVERRIDE { CefRefPtr<CefFrame> frame) OVERRIDE {
if (frame->IsMain()) if (frame->IsMain())
CancelPendingFor(browser, NULL, false); CancelPendingFor(browser, nullptr, false);
} }
bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
@@ -616,7 +616,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
return true; return true;
} }
CefRefPtr<CefV8Value> successVal = NULL; CefRefPtr<CefV8Value> successVal = nullptr;
if (arg->HasValue(kMemberOnSuccess)) { if (arg->HasValue(kMemberOnSuccess)) {
successVal = arg->GetValue(kMemberOnSuccess); successVal = arg->GetValue(kMemberOnSuccess);
if (!successVal->IsFunction()) { if (!successVal->IsFunction()) {
@@ -627,7 +627,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
} }
} }
CefRefPtr<CefV8Value> failureVal = NULL; CefRefPtr<CefV8Value> failureVal = nullptr;
if (arg->HasValue(kMemberOnFailure)) { if (arg->HasValue(kMemberOnFailure)) {
failureVal = arg->GetValue(kMemberOnFailure); failureVal = arg->GetValue(kMemberOnFailure);
if (!failureVal->IsFunction()) { if (!failureVal->IsFunction()) {
@@ -638,7 +638,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
} }
} }
CefRefPtr<CefV8Value> persistentVal = NULL; CefRefPtr<CefV8Value> persistentVal = nullptr;
if (arg->HasValue(kMemberPersistent)) { if (arg->HasValue(kMemberPersistent)) {
persistentVal = arg->GetValue(kMemberPersistent); persistentVal = arg->GetValue(kMemberPersistent);
if (!persistentVal->IsBool()) { if (!persistentVal->IsBool()) {
@@ -1008,7 +1008,8 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
if (context && info->success_callback) { if (context && info->success_callback) {
CefV8ValueList args; CefV8ValueList args;
args.push_back(CefV8Value::CreateString(response)); args.push_back(CefV8Value::CreateString(response));
info->success_callback->ExecuteFunctionWithContext(context, NULL, args); info->success_callback->ExecuteFunctionWithContext(context, nullptr,
args);
} }
if (removed) if (removed)
@@ -1034,7 +1035,8 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
CefV8ValueList args; CefV8ValueList args;
args.push_back(CefV8Value::CreateInt(error_code)); args.push_back(CefV8Value::CreateInt(error_code));
args.push_back(CefV8Value::CreateString(error_message)); args.push_back(CefV8Value::CreateString(error_message));
info->failure_callback->ExecuteFunctionWithContext(context, NULL, args); info->failure_callback->ExecuteFunctionWithContext(context, nullptr,
args);
} }
DCHECK(removed); DCHECK(removed);
@@ -1076,7 +1078,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
ContextMap::const_iterator it = context_map_.find(context_id); ContextMap::const_iterator it = context_map_.find(context_id);
if (it != context_map_.end()) if (it != context_map_.end())
return it->second; return it->second;
return NULL; return nullptr;
} }
const CefMessageRouterConfig config_; const CefMessageRouterConfig config_;
@@ -1113,7 +1115,7 @@ CefRefPtr<CefMessageRouterBrowserSide> CefMessageRouterBrowserSide::Create(
const CefMessageRouterConfig& config) { const CefMessageRouterConfig& config) {
CefMessageRouterConfig validated_config = config; CefMessageRouterConfig validated_config = config;
if (!ValidateConfig(validated_config)) if (!ValidateConfig(validated_config))
return NULL; return nullptr;
return new CefMessageRouterBrowserSideImpl(validated_config); return new CefMessageRouterBrowserSideImpl(validated_config);
} }
@@ -1122,6 +1124,6 @@ CefRefPtr<CefMessageRouterRendererSide> CefMessageRouterRendererSide::Create(
const CefMessageRouterConfig& config) { const CefMessageRouterConfig& config) {
CefMessageRouterConfig validated_config = config; CefMessageRouterConfig validated_config = config;
if (!ValidateConfig(validated_config)) if (!ValidateConfig(validated_config))
return NULL; return nullptr;
return new CefMessageRouterRendererSideImpl(validated_config); return new CefMessageRouterRendererSideImpl(validated_config);
} }

View File

@@ -228,7 +228,7 @@ class ArchiveProvider : public CefResourceManager::Provider {
archive = new CefZipArchive; archive = new CefZipArchive;
if (archive->Load(stream, password, true) == 0) { if (archive->Load(stream, password, true) == 0) {
DLOG(WARNING) << "Empty archive file: " << archive_path; DLOG(WARNING) << "Empty archive file: " << archive_path;
archive = NULL; archive = nullptr;
} }
} else { } else {
DLOG(WARNING) << "Failed to load archive file: " << archive_path; DLOG(WARNING) << "Failed to load archive file: " << archive_path;
@@ -388,7 +388,7 @@ CefResourceManager::Request::SendRequest() {
bool CefResourceManager::Request::HasState() { bool CefResourceManager::Request::HasState() {
CEF_REQUIRE_IO_THREAD(); CEF_REQUIRE_IO_THREAD();
return (state_.get() != NULL); return (state_.get() != nullptr);
} }
// static // static
@@ -598,7 +598,7 @@ CefRefPtr<CefResourceHandler> CefResourceManager::GetResourceHandler(
CEF_REQUIRE_IO_THREAD(); CEF_REQUIRE_IO_THREAD();
if (pending_handlers_.empty()) if (pending_handlers_.empty())
return NULL; return nullptr;
CefRefPtr<CefResourceHandler> handler; CefRefPtr<CefResourceHandler> handler;
@@ -734,7 +734,7 @@ void CefResourceManager::DeleteProvider(ProviderEntryList::iterator& iterator,
if (stop) if (stop)
request->Stop(); request->Stop();
else else
request->Continue(NULL); request->Continue(nullptr);
current_entry->provider_->OnRequestCanceled(request); current_entry->provider_->OnRequestCanceled(request);
} }
} }

View File

@@ -158,7 +158,7 @@ class CefXmlObjectLoader {
} // namespace } // namespace
CefXmlObject::CefXmlObject(const CefString& name) CefXmlObject::CefXmlObject(const CefString& name)
: name_(name), parent_(NULL) {} : name_(name), parent_(nullptr) {}
CefXmlObject::~CefXmlObject() {} CefXmlObject::~CefXmlObject() {}
@@ -245,7 +245,7 @@ bool CefXmlObject::SetName(const CefString& name) {
bool CefXmlObject::HasParent() { bool CefXmlObject::HasParent() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
return (parent_ != NULL); return (parent_ != nullptr);
} }
CefRefPtr<CefXmlObject> CefXmlObject::GetParent() { CefRefPtr<CefXmlObject> CefXmlObject::GetParent() {
@@ -385,7 +385,7 @@ bool CefXmlObject::RemoveChild(CefRefPtr<CefXmlObject> child) {
for (; it != children_.end(); ++it) { for (; it != children_.end(); ++it) {
if ((*it).get() == child.get()) { if ((*it).get() == child.get()) {
children_.erase(it); children_.erase(it);
child->SetParent(NULL); child->SetParent(nullptr);
return true; return true;
} }
} }
@@ -402,14 +402,14 @@ void CefXmlObject::ClearChildren() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
ObjectVector::iterator it = children_.begin(); ObjectVector::iterator it = children_.begin();
for (; it != children_.end(); ++it) for (; it != children_.end(); ++it)
(*it)->SetParent(NULL); (*it)->SetParent(nullptr);
children_.clear(); children_.clear();
} }
CefRefPtr<CefXmlObject> CefXmlObject::FindChild(const CefString& name) { CefRefPtr<CefXmlObject> CefXmlObject::FindChild(const CefString& name) {
DCHECK(!name.empty()); DCHECK(!name.empty());
if (name.empty()) if (name.empty())
return NULL; return nullptr;
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
ObjectVector::const_iterator it = children_.begin(); ObjectVector::const_iterator it = children_.begin();
@@ -417,7 +417,7 @@ CefRefPtr<CefXmlObject> CefXmlObject::FindChild(const CefString& name) {
if ((*it)->GetName() == name) if ((*it)->GetName() == name)
return (*it); return (*it);
} }
return NULL; return nullptr;
} }
size_t CefXmlObject::FindChildren(const CefString& name, size_t CefXmlObject::FindChildren(const CefString& name,
@@ -442,10 +442,10 @@ size_t CefXmlObject::FindChildren(const CefString& name,
void CefXmlObject::SetParent(CefXmlObject* parent) { void CefXmlObject::SetParent(CefXmlObject* parent) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
if (parent) { if (parent) {
DCHECK(parent_ == NULL); DCHECK(parent_ == nullptr);
parent_ = parent; parent_ = parent;
} else { } else {
DCHECK(parent_ != NULL); DCHECK(parent_ != nullptr);
parent_ = NULL; parent_ = nullptr;
} }
} }

View File

@@ -150,7 +150,7 @@ CefRefPtr<CefZipArchive::File> CefZipArchive::GetFile(
FileMap::const_iterator it = contents_.find(ToLower(fileName)); FileMap::const_iterator it = contents_.find(ToLower(fileName));
if (it != contents_.end()) if (it != contents_.end())
return it->second; return it->second;
return NULL; return nullptr;
} }
bool CefZipArchive::RemoveFile(const CefString& fileName) { bool CefZipArchive::RemoveFile(const CefString& fileName) {