refactor: run clang-tidy (#20231)

* refactor: clang-tidy modernize-use-nullptr

* refactor: clang-tidy modernize-use-equals-default

* refactor: clang-tidy modernize-make-unique

* refactor: omit nullptr arg from unique_ptr.reset()

As per comment by @miniak
This commit is contained in:
Charles Kerr 2019-09-16 18:12:00 -04:00 committed by GitHub
parent 660e566201
commit 2b316f3843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 261 additions and 223 deletions

View file

@ -86,7 +86,7 @@ CertificateManagerModel::CertificateManagerModel(
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
} }
CertificateManagerModel::~CertificateManagerModel() {} CertificateManagerModel::~CertificateManagerModel() = default;
int CertificateManagerModel::ImportFromPKCS12( int CertificateManagerModel::ImportFromPKCS12(
PK11SlotInfo* slot_info, PK11SlotInfo* slot_info,

View file

@ -185,7 +185,7 @@ int WaitSocketForRead(int fd, const base::TimeDelta& timeout) {
FD_ZERO(&read_fds); FD_ZERO(&read_fds);
FD_SET(fd, &read_fds); FD_SET(fd, &read_fds);
return HANDLE_EINTR(select(fd + 1, &read_fds, NULL, NULL, &tv)); return HANDLE_EINTR(select(fd + 1, &read_fds, nullptr, nullptr, &tv));
} }
// Read a message from a socket fd, with an optional timeout. // Read a message from a socket fd, with an optional timeout.

View file

@ -159,7 +159,7 @@ bool Converter<std::string>::FromV8(v8::Isolate* isolate,
v8::Local<v8::String> str = v8::Local<v8::String>::Cast(val); v8::Local<v8::String> str = v8::Local<v8::String>::Cast(val);
int length = str->Utf8Length(isolate); int length = str->Utf8Length(isolate);
out->resize(length); out->resize(length);
str->WriteUtf8(isolate, &(*out)[0], length, NULL, str->WriteUtf8(isolate, &(*out)[0], length, nullptr,
v8::String::NO_NULL_TERMINATION); v8::String::NO_NULL_TERMINATION);
return true; return true;
} }

View file

@ -179,9 +179,9 @@ void AppendDelimitedSwitchToVector(const base::StringPiece cmd_switch,
} // namespace } // namespace
AtomContentClient::AtomContentClient() {} AtomContentClient::AtomContentClient() = default;
AtomContentClient::~AtomContentClient() {} AtomContentClient::~AtomContentClient() = default;
base::string16 AtomContentClient::GetLocalizedString(int message_id) { base::string16 AtomContentClient::GetLocalizedString(int message_id) {
return l10n_util::GetStringUTF16(message_id); return l10n_util::GetStringUTF16(message_id);

View file

@ -126,9 +126,9 @@ void LoadResourceBundle(const std::string& locale) {
#endif // BUILDFLAG(ENABLE_PDF_VIEWER) #endif // BUILDFLAG(ENABLE_PDF_VIEWER)
} }
AtomMainDelegate::AtomMainDelegate() {} AtomMainDelegate::AtomMainDelegate() = default;
AtomMainDelegate::~AtomMainDelegate() {} AtomMainDelegate::~AtomMainDelegate() = default;
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
auto* command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
@ -283,12 +283,12 @@ void AtomMainDelegate::PreCreateMainMessageLoop() {
} }
content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() { content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(new AtomBrowserClient); browser_client_ = std::make_unique<AtomBrowserClient>();
return browser_client_.get(); return browser_client_.get();
} }
content::ContentGpuClient* AtomMainDelegate::CreateContentGpuClient() { content::ContentGpuClient* AtomMainDelegate::CreateContentGpuClient() {
gpu_client_.reset(new AtomGpuClient); gpu_client_ = std::make_unique<AtomGpuClient>();
return gpu_client_.get(); return gpu_client_.get();
} }
@ -297,16 +297,16 @@ AtomMainDelegate::CreateContentRendererClient() {
auto* command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
if (IsSandboxEnabled(command_line)) { if (IsSandboxEnabled(command_line)) {
renderer_client_.reset(new AtomSandboxedRendererClient); renderer_client_ = std::make_unique<AtomSandboxedRendererClient>();
} else { } else {
renderer_client_.reset(new AtomRendererClient); renderer_client_ = std::make_unique<AtomRendererClient>();
} }
return renderer_client_.get(); return renderer_client_.get();
} }
content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() { content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() {
utility_client_.reset(new AtomContentUtilityClient); utility_client_ = std::make_unique<AtomContentUtilityClient>();
return utility_client_.get(); return utility_client_.get();
} }

View file

@ -4,6 +4,8 @@
#include "shell/browser/api/atom_api_app.h" #include "shell/browser/api/atom_api_app.h"
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
@ -941,9 +943,9 @@ std::string App::GetLocaleCountryCode() {
kCFStringEncodingUTF8); kCFStringEncodingUTF8);
region = temporaryCString; region = temporaryCString;
#else #else
const char* locale_ptr = setlocale(LC_TIME, NULL); const char* locale_ptr = setlocale(LC_TIME, nullptr);
if (!locale_ptr) if (!locale_ptr)
locale_ptr = setlocale(LC_NUMERIC, NULL); locale_ptr = setlocale(LC_NUMERIC, nullptr);
if (locale_ptr) { if (locale_ptr) {
std::string locale = locale_ptr; std::string locale = locale_ptr;
std::string::size_type rpos = locale.find('.'); std::string::size_type rpos = locale.find('.');
@ -977,8 +979,8 @@ bool App::RequestSingleInstanceLock() {
auto cb = base::BindRepeating(&App::OnSecondInstance, base::Unretained(this)); auto cb = base::BindRepeating(&App::OnSecondInstance, base::Unretained(this));
process_singleton_.reset(new ProcessSingleton( process_singleton_ = std::make_unique<ProcessSingleton>(
user_dir, base::BindRepeating(NotificationCallbackWrapper, cb))); user_dir, base::BindRepeating(NotificationCallbackWrapper, cb));
switch (process_singleton_->NotifyOtherProcessOrCreate()) { switch (process_singleton_->NotifyOtherProcessOrCreate()) {
case ProcessSingleton::NotifyResult::LOCK_ERROR: case ProcessSingleton::NotifyResult::LOCK_ERROR:

View file

@ -167,7 +167,7 @@ Cookies::Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context)
base::Unretained(this))); base::Unretained(this)));
} }
Cookies::~Cookies() {} Cookies::~Cookies() = default;
v8::Local<v8::Promise> Cookies::Get(const base::DictionaryValue& filter) { v8::Local<v8::Promise> Cookies::Get(const base::DictionaryValue& filter) {
util::Promise<net::CookieList> promise(isolate()); util::Promise<net::CookieList> promise(isolate());

View file

@ -27,7 +27,7 @@ Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
Init(isolate); Init(isolate);
} }
Debugger::~Debugger() {} Debugger::~Debugger() = default;
void Debugger::AgentHostClosed(DevToolsAgentHost* agent_host) { void Debugger::AgentHostClosed(DevToolsAgentHost* agent_host) {
DCHECK(agent_host == agent_host_); DCHECK(agent_host == agent_host_);

View file

@ -62,7 +62,7 @@ DesktopCapturer::DesktopCapturer(v8::Isolate* isolate) {
Init(isolate); Init(isolate);
} }
DesktopCapturer::~DesktopCapturer() {} DesktopCapturer::~DesktopCapturer() = default;
void DesktopCapturer::StartHandling(bool capture_window, void DesktopCapturer::StartHandling(bool capture_window,
bool capture_screen, bool capture_screen,
@ -90,18 +90,18 @@ void DesktopCapturer::StartHandling(bool capture_window,
// Initialize the source list. // Initialize the source list.
// Apply the new thumbnail size and restart capture. // Apply the new thumbnail size and restart capture.
if (capture_window) { if (capture_window) {
window_capturer_.reset(new NativeDesktopMediaList( window_capturer_ = std::make_unique<NativeDesktopMediaList>(
content::DesktopMediaID::TYPE_WINDOW, content::DesktopMediaID::TYPE_WINDOW,
content::desktop_capture::CreateWindowCapturer())); content::desktop_capture::CreateWindowCapturer());
window_capturer_->SetThumbnailSize(thumbnail_size); window_capturer_->SetThumbnailSize(thumbnail_size);
window_capturer_->AddObserver(this); window_capturer_->AddObserver(this);
window_capturer_->StartUpdating(); window_capturer_->StartUpdating();
} }
if (capture_screen) { if (capture_screen) {
screen_capturer_.reset(new NativeDesktopMediaList( screen_capturer_ = std::make_unique<NativeDesktopMediaList>(
content::DesktopMediaID::TYPE_SCREEN, content::DesktopMediaID::TYPE_SCREEN,
content::desktop_capture::CreateScreenCapturer())); content::desktop_capture::CreateScreenCapturer());
screen_capturer_->SetThumbnailSize(thumbnail_size); screen_capturer_->SetThumbnailSize(thumbnail_size);
screen_capturer_->AddObserver(this); screen_capturer_->AddObserver(this);
screen_capturer_->StartUpdating(); screen_capturer_->StartUpdating();

View file

@ -51,7 +51,7 @@ void MenuViews::PopupAt(TopLevelWindow* window,
menu_runners_[window_id] = menu_runners_[window_id] =
std::make_unique<MenuRunner>(model(), flags, close_callback); std::make_unique<MenuRunner>(model(), flags, close_callback);
menu_runners_[window_id]->RunMenuAt( menu_runners_[window_id]->RunMenuAt(
native_window->widget(), NULL, gfx::Rect(location, gfx::Size()), native_window->widget(), nullptr, gfx::Rect(location, gfx::Size()),
views::MenuAnchorPosition::kTopLeft, ui::MENU_SOURCE_MOUSE); views::MenuAnchorPosition::kTopLeft, ui::MENU_SOURCE_MOUSE);
} }

View file

@ -19,7 +19,7 @@ Net::Net(v8::Isolate* isolate) {
Init(isolate); Init(isolate);
} }
Net::~Net() {} Net::~Net() = default;
// static // static
v8::Local<v8::Value> Net::Create(v8::Isolate* isolate) { v8::Local<v8::Value> Net::Create(v8::Isolate* isolate) {

View file

@ -49,7 +49,7 @@ PowerSaveBlocker::PowerSaveBlocker(v8::Isolate* isolate)
: current_lock_type_(device::mojom::WakeLockType::kPreventAppSuspension), : current_lock_type_(device::mojom::WakeLockType::kPreventAppSuspension),
is_wake_lock_active_(false) {} is_wake_lock_active_(false) {}
PowerSaveBlocker::~PowerSaveBlocker() {} PowerSaveBlocker::~PowerSaveBlocker() = default;
void PowerSaveBlocker::UpdatePowerSaveBlocker() { void PowerSaveBlocker::UpdatePowerSaveBlocker() {
if (wake_lock_types_.empty()) { if (wake_lock_types_.empty()) {

View file

@ -183,7 +183,7 @@ URLRequestNS::URLRequestNS(mate::Arguments* args) : weak_factory_(this) {
InitWith(args->isolate(), args->GetThis()); InitWith(args->isolate(), args->GetThis());
} }
URLRequestNS::~URLRequestNS() {} URLRequestNS::~URLRequestNS() = default;
bool URLRequestNS::NotStarted() const { bool URLRequestNS::NotStarted() const {
return request_state_ == 0; return request_state_ == 0;

View file

@ -387,8 +387,8 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
GURL("chrome-guest://fake-host")); GURL("chrome-guest://fake-host"));
content::WebContents::CreateParams params(session->browser_context(), content::WebContents::CreateParams params(session->browser_context(),
site_instance); site_instance);
guest_delegate_.reset( guest_delegate_ =
new WebViewGuestDelegate(embedder_->web_contents(), this)); std::make_unique<WebViewGuestDelegate>(embedder_->web_contents(), this);
params.guest_delegate = guest_delegate_.get(); params.guest_delegate = guest_delegate_.get();
#if BUILDFLAG(ENABLE_OSR) #if BUILDFLAG(ENABLE_OSR)
@ -828,7 +828,7 @@ std::unique_ptr<content::BluetoothChooser> WebContents::RunBluetoothChooser(
content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager( content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager(
content::WebContents* source) { content::WebContents* source) {
if (!dialog_manager_) if (!dialog_manager_)
dialog_manager_.reset(new AtomJavaScriptDialogManager(this)); dialog_manager_ = std::make_unique<AtomJavaScriptDialogManager>(this);
return dialog_manager_.get(); return dialog_manager_.get();
} }
@ -2038,8 +2038,8 @@ void WebContents::BeginFrameSubscription(mate::Arguments* args) {
return; return;
} }
frame_subscriber_.reset( frame_subscriber_ =
new FrameSubscriber(web_contents(), callback, only_dirty)); std::make_unique<FrameSubscriber>(web_contents(), callback, only_dirty);
} }
void WebContents::EndFrameSubscription() { void WebContents::EndFrameSubscription() {

View file

@ -22,7 +22,7 @@ namespace {
class WebContentsViewRelay class WebContentsViewRelay
: public content::WebContentsUserData<WebContentsViewRelay> { : public content::WebContentsUserData<WebContentsViewRelay> {
public: public:
~WebContentsViewRelay() override {} ~WebContentsViewRelay() override = default;
private: private:
explicit WebContentsViewRelay(content::WebContents* contents) {} explicit WebContentsViewRelay(content::WebContents* contents) {}

View file

@ -15,7 +15,7 @@ Event::Event(v8::Isolate* isolate) {
Init(isolate); Init(isolate);
} }
Event::~Event() {} Event::~Event() = default;
void Event::SetCallback(base::Optional<MessageSyncCallback> callback) { void Event::SetCallback(base::Optional<MessageSyncCallback> callback) {
DCHECK(!callback_); DCHECK(!callback_);

View file

@ -11,7 +11,7 @@ namespace electron {
GPUInfoEnumerator::GPUInfoEnumerator() GPUInfoEnumerator::GPUInfoEnumerator()
: value_stack(), current(std::make_unique<base::DictionaryValue>()) {} : value_stack(), current(std::make_unique<base::DictionaryValue>()) {}
GPUInfoEnumerator::~GPUInfoEnumerator() {} GPUInfoEnumerator::~GPUInfoEnumerator() = default;
void GPUInfoEnumerator::AddInt64(const char* name, int64_t value) { void GPUInfoEnumerator::AddInt64(const char* name, int64_t value) {
current->SetInteger(name, value); current->SetInteger(name, value);

View file

@ -20,7 +20,7 @@ SavePageHandler::SavePageHandler(content::WebContents* web_contents,
util::Promise<void*> promise) util::Promise<void*> promise)
: web_contents_(web_contents), promise_(std::move(promise)) {} : web_contents_(web_contents), promise_(std::move(promise)) {}
SavePageHandler::~SavePageHandler() {} SavePageHandler::~SavePageHandler() = default;
void SavePageHandler::OnDownloadCreated(content::DownloadManager* manager, void SavePageHandler::OnDownloadCreated(content::DownloadManager* manager,
download::DownloadItem* item) { download::DownloadItem* item) {

View file

@ -35,7 +35,7 @@ TrackableObjectBase::TrackableObjectBase() : weak_factory_(this) {
GetDestroyClosure()); GetDestroyClosure());
} }
TrackableObjectBase::~TrackableObjectBase() {} TrackableObjectBase::~TrackableObjectBase() = default;
base::OnceClosure TrackableObjectBase::GetDestroyClosure() { base::OnceClosure TrackableObjectBase::GetDestroyClosure() {
return base::BindOnce(&TrackableObjectBase::Destroy, return base::BindOnce(&TrackableObjectBase::Destroy,

View file

@ -4,6 +4,8 @@
#include "shell/browser/atom_autofill_driver.h" #include "shell/browser/atom_autofill_driver.h"
#include <memory>
#include <utility> #include <utility>
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
@ -16,11 +18,11 @@ AutofillDriver::AutofillDriver(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
mojom::ElectronAutofillDriverAssociatedRequest request) mojom::ElectronAutofillDriverAssociatedRequest request)
: render_frame_host_(render_frame_host), binding_(this) { : render_frame_host_(render_frame_host), binding_(this) {
autofill_popup_.reset(new AutofillPopup()); autofill_popup_ = std::make_unique<AutofillPopup>();
binding_.Bind(std::move(request)); binding_.Bind(std::move(request));
} }
AutofillDriver::~AutofillDriver() {} AutofillDriver::~AutofillDriver() = default;
void AutofillDriver::ShowAutofillPopup( void AutofillDriver::ShowAutofillPopup(
const gfx::RectF& bounds, const gfx::RectF& bounds,

View file

@ -28,7 +28,7 @@ std::unique_ptr<AutofillDriver> CreateDriver(
} // namespace } // namespace
AutofillDriverFactory::~AutofillDriverFactory() {} AutofillDriverFactory::~AutofillDriverFactory() = default;
// static // static
void AutofillDriverFactory::BindAutofillDriver( void AutofillDriverFactory::BindAutofillDriver(

View file

@ -896,7 +896,7 @@ content::PlatformNotificationService*
AtomBrowserClient::GetPlatformNotificationService( AtomBrowserClient::GetPlatformNotificationService(
content::BrowserContext* browser_context) { content::BrowserContext* browser_context) {
if (!notification_service_) { if (!notification_service_) {
notification_service_.reset(new PlatformNotificationService(this)); notification_service_ = std::make_unique<PlatformNotificationService>(this);
} }
return notification_service_.get(); return notification_service_.get();
} }

View file

@ -4,6 +4,8 @@
#include "shell/browser/atom_browser_context.h" #include "shell/browser/atom_browser_context.h"
#include <memory>
#include <utility> #include <utility>
#include "base/command_line.h" #include "base/command_line.h"
@ -205,13 +207,13 @@ int AtomBrowserContext::GetMaxCacheSize() const {
content::ResourceContext* AtomBrowserContext::GetResourceContext() { content::ResourceContext* AtomBrowserContext::GetResourceContext() {
if (!resource_context_) if (!resource_context_)
resource_context_.reset(new content::ResourceContext); resource_context_ = std::make_unique<content::ResourceContext>();
return resource_context_.get(); return resource_context_.get();
} }
std::string AtomBrowserContext::GetMediaDeviceIDSalt() { std::string AtomBrowserContext::GetMediaDeviceIDSalt() {
if (!media_device_id_salt_.get()) if (!media_device_id_salt_.get())
media_device_id_salt_.reset(new MediaDeviceIDSalt(prefs_.get())); media_device_id_salt_ = std::make_unique<MediaDeviceIDSalt>(prefs_.get());
return media_device_id_salt_->GetSalt(); return media_device_id_salt_->GetSalt();
} }
@ -228,22 +230,22 @@ content::DownloadManagerDelegate*
AtomBrowserContext::GetDownloadManagerDelegate() { AtomBrowserContext::GetDownloadManagerDelegate() {
if (!download_manager_delegate_.get()) { if (!download_manager_delegate_.get()) {
auto* download_manager = content::BrowserContext::GetDownloadManager(this); auto* download_manager = content::BrowserContext::GetDownloadManager(this);
download_manager_delegate_.reset( download_manager_delegate_ =
new AtomDownloadManagerDelegate(download_manager)); std::make_unique<AtomDownloadManagerDelegate>(download_manager);
} }
return download_manager_delegate_.get(); return download_manager_delegate_.get();
} }
content::BrowserPluginGuestManager* AtomBrowserContext::GetGuestManager() { content::BrowserPluginGuestManager* AtomBrowserContext::GetGuestManager() {
if (!guest_manager_) if (!guest_manager_)
guest_manager_.reset(new WebViewManager); guest_manager_ = std::make_unique<WebViewManager>();
return guest_manager_.get(); return guest_manager_.get();
} }
content::PermissionControllerDelegate* content::PermissionControllerDelegate*
AtomBrowserContext::GetPermissionControllerDelegate() { AtomBrowserContext::GetPermissionControllerDelegate() {
if (!permission_manager_.get()) if (!permission_manager_.get())
permission_manager_.reset(new AtomPermissionManager); permission_manager_ = std::make_unique<AtomPermissionManager>();
return permission_manager_.get(); return permission_manager_.get();
} }
@ -257,7 +259,8 @@ std::string AtomBrowserContext::GetUserAgent() const {
predictors::PreconnectManager* AtomBrowserContext::GetPreconnectManager() { predictors::PreconnectManager* AtomBrowserContext::GetPreconnectManager() {
if (!preconnect_manager_.get()) { if (!preconnect_manager_.get()) {
preconnect_manager_.reset(new predictors::PreconnectManager(nullptr, this)); preconnect_manager_ =
std::make_unique<predictors::PreconnectManager>(nullptr, this);
} }
return preconnect_manager_.get(); return preconnect_manager_.get();
} }

View file

@ -4,6 +4,8 @@
#include "shell/browser/atom_browser_main_parts.h" #include "shell/browser/atom_browser_main_parts.h"
#include <memory>
#include <utility> #include <utility>
#if defined(OS_LINUX) #if defined(OS_LINUX)
@ -289,13 +291,13 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
// The ProxyResolverV8 has setup a complete V8 environment, in order to // The ProxyResolverV8 has setup a complete V8 environment, in order to
// avoid conflicts we only initialize our V8 environment after that. // avoid conflicts we only initialize our V8 environment after that.
js_env_.reset(new JavascriptEnvironment(node_bindings_->uv_loop())); js_env_ = std::make_unique<JavascriptEnvironment>(node_bindings_->uv_loop());
node_bindings_->Initialize(); node_bindings_->Initialize();
// Create the global environment. // Create the global environment.
node::Environment* env = node_bindings_->CreateEnvironment( node::Environment* env = node_bindings_->CreateEnvironment(
js_env_->context(), js_env_->platform(), false); js_env_->context(), js_env_->platform(), false);
node_env_.reset(new NodeEnvironment(env)); node_env_ = std::make_unique<NodeEnvironment>(env);
/** /**
* 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 * 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨
@ -316,7 +318,7 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
*/ */
// Enable support for v8 inspector // Enable support for v8 inspector
node_debugger_.reset(new NodeDebugger(env)); node_debugger_ = std::make_unique<NodeDebugger>(env);
node_debugger_->Start(); node_debugger_->Start();
// Only run the node bootstrapper after we have initialized the inspector // Only run the node bootstrapper after we have initialized the inspector
@ -362,7 +364,7 @@ int AtomBrowserMainParts::PreCreateThreads() {
#endif #endif
if (!views::LayoutProvider::Get()) if (!views::LayoutProvider::Get())
layout_provider_.reset(new views::LayoutProvider()); layout_provider_ = std::make_unique<views::LayoutProvider>();
// Initialize the app locale. // Initialize the app locale.
fake_browser_process_->SetApplicationLocale( fake_browser_process_->SetApplicationLocale(
@ -403,7 +405,7 @@ void AtomBrowserMainParts::ToolkitInitialized() {
#endif #endif
#if defined(USE_AURA) #if defined(USE_AURA)
wm_state_.reset(new wm::WMState); wm_state_ = std::make_unique<wm::WMState>();
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
@ -418,7 +420,7 @@ void AtomBrowserMainParts::ToolkitInitialized() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
views_delegate_.reset(new ViewsDelegateMac); views_delegate_.reset(new ViewsDelegateMac);
#else #else
views_delegate_.reset(new ViewsDelegate); views_delegate_ = std::make_unique<ViewsDelegate>();
#endif #endif
} }
@ -557,7 +559,7 @@ AtomBrowserMainParts::GetGeolocationControl() {
IconManager* AtomBrowserMainParts::GetIconManager() { IconManager* AtomBrowserMainParts::GetIconManager() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!icon_manager_.get()) if (!icon_manager_.get())
icon_manager_.reset(new IconManager); icon_manager_ = std::make_unique<IconManager>();
return icon_manager_.get(); return icon_manager_.get();
} }

View file

@ -13,7 +13,7 @@ AtomNavigationThrottle::AtomNavigationThrottle(
content::NavigationHandle* navigation_handle) content::NavigationHandle* navigation_handle)
: content::NavigationThrottle(navigation_handle) {} : content::NavigationThrottle(navigation_handle) {}
AtomNavigationThrottle::~AtomNavigationThrottle() {} AtomNavigationThrottle::~AtomNavigationThrottle() = default;
const char* AtomNavigationThrottle::GetNameForLogging() { const char* AtomNavigationThrottle::GetNameForLogging() {
return "AtomNavigationThrottle"; return "AtomNavigationThrottle";

View file

@ -89,9 +89,9 @@ class AtomPermissionManager::PendingRequest {
size_t remaining_results_; size_t remaining_results_;
}; };
AtomPermissionManager::AtomPermissionManager() {} AtomPermissionManager::AtomPermissionManager() = default;
AtomPermissionManager::~AtomPermissionManager() {} AtomPermissionManager::~AtomPermissionManager() = default;
void AtomPermissionManager::SetPermissionRequestHandler( void AtomPermissionManager::SetPermissionRequestHandler(
const RequestHandler& handler) { const RequestHandler& handler) {

View file

@ -6,9 +6,9 @@
namespace electron { namespace electron {
AtomQuotaPermissionContext::AtomQuotaPermissionContext() {} AtomQuotaPermissionContext::AtomQuotaPermissionContext() = default;
AtomQuotaPermissionContext::~AtomQuotaPermissionContext() {} AtomQuotaPermissionContext::~AtomQuotaPermissionContext() = default;
void AtomQuotaPermissionContext::RequestQuotaPermission( void AtomQuotaPermissionContext::RequestQuotaPermission(
const content::StorageQuotaParams& params, const content::StorageQuotaParams& params,

View file

@ -11,9 +11,11 @@
namespace electron { namespace electron {
AtomSpeechRecognitionManagerDelegate::AtomSpeechRecognitionManagerDelegate() {} AtomSpeechRecognitionManagerDelegate::AtomSpeechRecognitionManagerDelegate() =
default;
AtomSpeechRecognitionManagerDelegate::~AtomSpeechRecognitionManagerDelegate() {} AtomSpeechRecognitionManagerDelegate::~AtomSpeechRecognitionManagerDelegate() =
default;
void AtomSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) {} void AtomSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) {}

View file

@ -32,9 +32,9 @@ AtomWebUIControllerFactory* AtomWebUIControllerFactory::GetInstance() {
return base::Singleton<AtomWebUIControllerFactory>::get(); return base::Singleton<AtomWebUIControllerFactory>::get();
} }
AtomWebUIControllerFactory::AtomWebUIControllerFactory() {} AtomWebUIControllerFactory::AtomWebUIControllerFactory() = default;
AtomWebUIControllerFactory::~AtomWebUIControllerFactory() {} AtomWebUIControllerFactory::~AtomWebUIControllerFactory() = default;
content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType( content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,

View file

@ -167,7 +167,7 @@ void Browser::DidFinishLaunching(const base::DictionaryValue& launch_info) {
const util::Promise<void*>& Browser::WhenReady(v8::Isolate* isolate) { const util::Promise<void*>& Browser::WhenReady(v8::Isolate* isolate) {
if (!ready_promise_) { if (!ready_promise_) {
ready_promise_.reset(new util::Promise<void*>(isolate)); ready_promise_ = std::make_unique<util::Promise<void*>>(isolate);
if (is_ready()) { if (is_ready()) {
ready_promise_->Resolve(); ready_promise_->Resolve();
} }

View file

@ -4,6 +4,8 @@
#include "shell/browser/browser_process_impl.h" #include "shell/browser/browser_process_impl.h"
#include <memory>
#include <utility> #include <utility>
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
@ -282,7 +284,7 @@ const std::string& BrowserProcessImpl::GetApplicationLocale() {
printing::PrintJobManager* BrowserProcessImpl::print_job_manager() { printing::PrintJobManager* BrowserProcessImpl::print_job_manager() {
#if BUILDFLAG(ENABLE_PRINTING) #if BUILDFLAG(ENABLE_PRINTING)
if (!print_job_manager_) if (!print_job_manager_)
print_job_manager_.reset(new printing::PrintJobManager()); print_job_manager_ = std::make_unique<printing::PrintJobManager>();
return print_job_manager_.get(); return print_job_manager_.get();
#else #else
return nullptr; return nullptr;

View file

@ -68,7 +68,7 @@ namespace {
const char kRootName[] = "<root>"; const char kRootName[] = "<root>";
struct FileSystem { struct FileSystem {
FileSystem() {} FileSystem() = default;
FileSystem(const std::string& type, FileSystem(const std::string& type,
const std::string& file_system_name, const std::string& file_system_name,
const std::string& root_url, const std::string& root_url,
@ -182,7 +182,7 @@ CommonWebContentsDelegate::CommonWebContentsDelegate()
base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()})), base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()})),
weak_factory_(this) {} weak_factory_(this) {}
CommonWebContentsDelegate::~CommonWebContentsDelegate() {} CommonWebContentsDelegate::~CommonWebContentsDelegate() = default;
void CommonWebContentsDelegate::InitWithWebContents( void CommonWebContentsDelegate::InitWithWebContents(
content::WebContents* web_contents, content::WebContents* web_contents,
@ -309,7 +309,8 @@ void CommonWebContentsDelegate::RunFileChooser(
std::unique_ptr<content::FileSelectListener> listener, std::unique_ptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) { const blink::mojom::FileChooserParams& params) {
if (!web_dialog_helper_) if (!web_dialog_helper_)
web_dialog_helper_.reset(new WebDialogHelper(owner_window(), offscreen_)); web_dialog_helper_ =
std::make_unique<WebDialogHelper>(owner_window(), offscreen_);
web_dialog_helper_->RunFileChooser(render_frame_host, std::move(listener), web_dialog_helper_->RunFileChooser(render_frame_host, std::move(listener),
params); params);
} }
@ -319,7 +320,8 @@ void CommonWebContentsDelegate::EnumerateDirectory(
std::unique_ptr<content::FileSelectListener> listener, std::unique_ptr<content::FileSelectListener> listener,
const base::FilePath& path) { const base::FilePath& path) {
if (!web_dialog_helper_) if (!web_dialog_helper_)
web_dialog_helper_.reset(new WebDialogHelper(owner_window(), offscreen_)); web_dialog_helper_ =
std::make_unique<WebDialogHelper>(owner_window(), offscreen_);
web_dialog_helper_->EnumerateDirectory(guest, std::move(listener), path); web_dialog_helper_->EnumerateDirectory(guest, std::move(listener), path);
} }

View file

@ -4,6 +4,8 @@
#include "shell/browser/javascript_environment.h" #include "shell/browser/javascript_environment.h"
#include <memory>
#include <string> #include <string>
#include "base/command_line.h" #include "base/command_line.h"
@ -66,7 +68,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) {
void JavascriptEnvironment::OnMessageLoopCreated() { void JavascriptEnvironment::OnMessageLoopCreated() {
DCHECK(!microtasks_runner_); DCHECK(!microtasks_runner_);
microtasks_runner_.reset(new MicrotasksRunner(isolate())); microtasks_runner_ = std::make_unique<MicrotasksRunner>(isolate());
base::MessageLoopCurrent::Get()->AddTaskObserver(microtasks_runner_.get()); base::MessageLoopCurrent::Get()->AddTaskObserver(microtasks_runner_.get());
} }

View file

@ -44,7 +44,7 @@ BluetoothChooser::BluetoothChooser(api::WebContents* contents,
const EventHandler& event_handler) const EventHandler& event_handler)
: api_web_contents_(contents), event_handler_(event_handler) {} : api_web_contents_(contents), event_handler_(event_handler) {}
BluetoothChooser::~BluetoothChooser() {} BluetoothChooser::~BluetoothChooser() = default;
void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) { void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
switch (presence) { switch (presence) {

View file

@ -46,7 +46,7 @@ LoginHandler::LoginHandler(net::URLRequest* request,
base::RetainedRef(this), std::move(request_details))); base::RetainedRef(this), std::move(request_details)));
} }
LoginHandler::~LoginHandler() {} LoginHandler::~LoginHandler() = default;
void LoginHandler::Login(const base::string16& username, void LoginHandler::Login(const base::string16& username,
const base::string16& password) { const base::string16& password) {

View file

@ -40,7 +40,7 @@ MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher()
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
} }
MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() = default;
const blink::MediaStreamDevices& const blink::MediaStreamDevices&
MediaCaptureDevicesDispatcher::GetAudioCaptureDevices() { MediaCaptureDevicesDispatcher::GetAudioCaptureDevices() {

View file

@ -15,7 +15,7 @@ NativeBrowserView::NativeBrowserView(
InspectableWebContents* inspectable_web_contents) InspectableWebContents* inspectable_web_contents)
: inspectable_web_contents_(inspectable_web_contents) {} : inspectable_web_contents_(inspectable_web_contents) {}
NativeBrowserView::~NativeBrowserView() {} NativeBrowserView::~NativeBrowserView() = default;
InspectableWebContentsView* NativeBrowserView::GetInspectableWebContentsView() { InspectableWebContentsView* NativeBrowserView::GetInspectableWebContentsView() {
return inspectable_web_contents_->GetView(); return inspectable_web_contents_->GetView();

View file

@ -15,7 +15,7 @@ NativeBrowserViewViews::NativeBrowserViewViews(
InspectableWebContents* inspectable_web_contents) InspectableWebContents* inspectable_web_contents)
: NativeBrowserView(inspectable_web_contents) {} : NativeBrowserView(inspectable_web_contents) {}
NativeBrowserViewViews::~NativeBrowserViewViews() {} NativeBrowserViewViews::~NativeBrowserViewViews() = default;
void NativeBrowserViewViews::SetAutoResizeFlags(uint8_t flags) { void NativeBrowserViewViews::SetAutoResizeFlags(uint8_t flags) {
auto_resize_flags_ = flags; auto_resize_flags_ = flags;

View file

@ -209,7 +209,7 @@ NativeWindowViews::NativeWindowViews(const mate::Dictionary& options,
#if defined(USE_X11) #if defined(USE_X11)
// Start monitoring window states. // Start monitoring window states.
window_state_watcher_.reset(new WindowStateWatcher(this)); window_state_watcher_ = std::make_unique<WindowStateWatcher>(this);
// Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set.
bool use_dark_theme = false; bool use_dark_theme = false;
@ -477,7 +477,7 @@ void NativeWindowViews::SetEnabledInternal(bool enable) {
tree_host->RemoveEventRewriter(event_disabler_.get()); tree_host->RemoveEventRewriter(event_disabler_.get());
event_disabler_.reset(); event_disabler_.reset();
} else { } else {
event_disabler_.reset(new EventDisabler); event_disabler_ = std::make_unique<EventDisabler>();
tree_host->AddEventRewriter(event_disabler_.get()); tree_host->AddEventRewriter(event_disabler_.get());
} }
#endif #endif
@ -997,7 +997,7 @@ void NativeWindowViews::SetMenu(AtomMenuModel* menu_model) {
} }
if (!global_menu_bar_ && ShouldUseGlobalMenuBar()) if (!global_menu_bar_ && ShouldUseGlobalMenuBar())
global_menu_bar_.reset(new GlobalMenuBarX11(this)); global_menu_bar_ = std::make_unique<GlobalMenuBarX11>(this);
// Use global application menu bar when possible. // Use global application menu bar when possible.
if (global_menu_bar_ && global_menu_bar_->IsServerStarted()) { if (global_menu_bar_ && global_menu_bar_->IsServerStarted()) {

View file

@ -24,7 +24,7 @@ NetworkContextServiceFactory::NetworkContextServiceFactory()
"ElectronNetworkContextService", "ElectronNetworkContextService",
BrowserContextDependencyManager::GetInstance()) {} BrowserContextDependencyManager::GetInstance()) {}
NetworkContextServiceFactory::~NetworkContextServiceFactory() {} NetworkContextServiceFactory::~NetworkContextServiceFactory() = default;
KeyedService* NetworkContextServiceFactory::BuildServiceInstanceFor( KeyedService* NetworkContextServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const { content::BrowserContext* context) const {

View file

@ -102,7 +102,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem
private: private:
friend class base::RefCounted<URLLoaderFactoryForSystem>; friend class base::RefCounted<URLLoaderFactoryForSystem>;
~URLLoaderFactoryForSystem() override {} ~URLLoaderFactoryForSystem() override = default;
SEQUENCE_CHECKER(sequence_checker_); SEQUENCE_CHECKER(sequence_checker_);
SystemNetworkContextManager* manager_; SystemNetworkContextManager* manager_;

View file

@ -20,7 +20,7 @@ namespace electron {
NodeDebugger::NodeDebugger(node::Environment* env) : env_(env) {} NodeDebugger::NodeDebugger(node::Environment* env) : env_(env) {}
NodeDebugger::~NodeDebugger() {} NodeDebugger::~NodeDebugger() = default;
void NodeDebugger::Start() { void NodeDebugger::Start() {
auto* inspector = env_->inspector_agent(); auto* inspector = env_->inspector_agent();

View file

@ -16,9 +16,9 @@ NotificationPresenter* NotificationPresenter::Create() {
return new NotificationPresenterLinux; return new NotificationPresenterLinux;
} }
NotificationPresenterLinux::NotificationPresenterLinux() {} NotificationPresenterLinux::NotificationPresenterLinux() = default;
NotificationPresenterLinux::~NotificationPresenterLinux() {} NotificationPresenterLinux::~NotificationPresenterLinux() = default;
Notification* NotificationPresenterLinux::CreateNotificationObject( Notification* NotificationPresenterLinux::CreateNotificationObject(
NotificationDelegate* delegate) { NotificationDelegate* delegate) {

View file

@ -10,7 +10,7 @@
namespace electron { namespace electron {
NotificationPresenter::NotificationPresenter() {} NotificationPresenter::NotificationPresenter() = default;
NotificationPresenter::~NotificationPresenter() { NotificationPresenter::~NotificationPresenter() {
for (Notification* notification : notifications_) for (Notification* notification : notifications_)

View file

@ -75,7 +75,7 @@ PlatformNotificationService::PlatformNotificationService(
AtomBrowserClient* browser_client) AtomBrowserClient* browser_client)
: browser_client_(browser_client) {} : browser_client_(browser_client) {}
PlatformNotificationService::~PlatformNotificationService() {} PlatformNotificationService::~PlatformNotificationService() = default;
void PlatformNotificationService::DisplayNotification( void PlatformNotificationService::DisplayNotification(
content::RenderProcessHost* render_process_host, content::RenderProcessHost* render_process_host,

View file

@ -82,7 +82,7 @@ OffScreenHostDisplayClient::OffScreenHostDisplayClient(
gfx::AcceleratedWidget widget, gfx::AcceleratedWidget widget,
OnPaintCallback callback) OnPaintCallback callback)
: viz::HostDisplayClient(widget), callback_(callback) {} : viz::HostDisplayClient(widget), callback_(callback) {}
OffScreenHostDisplayClient::~OffScreenHostDisplayClient() {} OffScreenHostDisplayClient::~OffScreenHostDisplayClient() = default;
void OffScreenHostDisplayClient::SetActive(bool active) { void OffScreenHostDisplayClient::SetActive(bool active) {
active_ = active; active_ = active;

View file

@ -126,10 +126,10 @@ class AtomBeginFrameTimer : public viz::DelayBasedTimeSourceClient {
AtomBeginFrameTimer(int frame_rate_threshold_us, AtomBeginFrameTimer(int frame_rate_threshold_us,
const base::Closure& callback) const base::Closure& callback)
: callback_(callback) { : callback_(callback) {
time_source_.reset(new viz::DelayBasedTimeSource( time_source_ = std::make_unique<viz::DelayBasedTimeSource>(
base::CreateSingleThreadTaskRunnerWithTraits( base::CreateSingleThreadTaskRunnerWithTraits(
{content::BrowserThread::UI}) {content::BrowserThread::UI})
.get())); .get());
time_source_->SetTimebaseAndInterval( time_source_->SetTimebaseAndInterval(
base::TimeTicks(), base::TimeTicks(),
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us)); base::TimeDelta::FromMicroseconds(frame_rate_threshold_us));
@ -232,13 +232,14 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
compositor_allocation_ = compositor_allocation_ =
compositor_allocator_.GetCurrentLocalSurfaceIdAllocation(); compositor_allocator_.GetCurrentLocalSurfaceIdAllocation();
delegated_frame_host_client_.reset(new AtomDelegatedFrameHostClient(this)); delegated_frame_host_client_ =
std::make_unique<AtomDelegatedFrameHostClient>(this);
delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>( delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>(
AllocateFrameSinkId(is_guest_view_hack), AllocateFrameSinkId(is_guest_view_hack),
delegated_frame_host_client_.get(), delegated_frame_host_client_.get(),
true /* should_register_frame_sink_id */); true /* should_register_frame_sink_id */);
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); root_layer_ = std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR);
bool opaque = SkColorGetA(background_color_) == SK_AlphaOPAQUE; bool opaque = SkColorGetA(background_color_) == SK_AlphaOPAQUE;
GetRootLayer()->SetFillsBoundsOpaquely(opaque); GetRootLayer()->SetFillsBoundsOpaquely(opaque);
@ -249,11 +250,11 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
ui::ContextFactoryPrivate* context_factory_private = ui::ContextFactoryPrivate* context_factory_private =
factory->GetContextFactoryPrivate(); factory->GetContextFactoryPrivate();
compositor_.reset( compositor_ = std::make_unique<ui::Compositor>(
new ui::Compositor(context_factory_private->AllocateFrameSinkId(), context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(), context_factory_private, content::GetContextFactory(), context_factory_private,
base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), false /* enable_pixel_canvas */,
false /* enable_pixel_canvas */, this)); this);
compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
compositor_->SetRootLayer(root_layer_.get()); compositor_->SetRootLayer(root_layer_.get());
@ -264,9 +265,9 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
InstallTransparency(); InstallTransparency();
if (content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()) { if (content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()) {
video_consumer_.reset(new OffScreenVideoConsumer( video_consumer_ = std::make_unique<OffScreenVideoConsumer>(
this, base::BindRepeating(&OffScreenRenderWidgetHostView::OnPaint, this, base::BindRepeating(&OffScreenRenderWidgetHostView::OnPaint,
weak_ptr_factory_.GetWeakPtr()))); weak_ptr_factory_.GetWeakPtr()));
video_consumer_->SetActive(IsPainting()); video_consumer_->SetActive(IsPainting());
video_consumer_->SetFrameRate(GetFrameRate()); video_consumer_->SetFrameRate(GetFrameRate());
} }
@ -280,9 +281,9 @@ OffScreenRenderWidgetHostView::~OffScreenRenderWidgetHostView() {
content::DelegatedFrameHost::HiddenCause::kOther); content::DelegatedFrameHost::HiddenCause::kOther);
delegated_frame_host_->DetachFromCompositor(); delegated_frame_host_->DetachFromCompositor();
delegated_frame_host_.reset(NULL); delegated_frame_host_.reset();
compositor_.reset(NULL); compositor_.reset();
root_layer_.reset(NULL); root_layer_.reset();
} }
content::BrowserAccessibilityManager* content::BrowserAccessibilityManager*
@ -539,7 +540,7 @@ void OffScreenRenderWidgetHostView::Destroy() {
if (!is_destroyed_) { if (!is_destroyed_) {
is_destroyed_ = true; is_destroyed_ = true;
if (parent_host_view_ != NULL) { if (parent_host_view_ != nullptr) {
CancelWidget(); CancelWidget();
} else { } else {
if (popup_host_view_) if (popup_host_view_)
@ -674,14 +675,14 @@ void OffScreenRenderWidgetHostView::CancelWidget() {
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);
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_) {
@ -759,7 +760,7 @@ bool OffScreenRenderWidgetHostView::UpdateNSViewAndDisplay() {
void OffScreenRenderWidgetHostView::OnPaint(const gfx::Rect& damage_rect, void OffScreenRenderWidgetHostView::OnPaint(const gfx::Rect& damage_rect,
const SkBitmap& bitmap) { const SkBitmap& bitmap) {
backing_.reset(new SkBitmap()); backing_ = std::make_unique<SkBitmap>();
backing_->allocN32Pixels(bitmap.width(), bitmap.height(), !transparent_); backing_->allocN32Pixels(bitmap.width(), bitmap.height(), !transparent_);
bitmap.readPixels(backing_->pixmap()); bitmap.readPixels(backing_->pixmap());
@ -1063,11 +1064,11 @@ void OffScreenRenderWidgetHostView::SetupFrameRate(bool force) {
if (begin_frame_timer_.get()) { if (begin_frame_timer_.get()) {
begin_frame_timer_->SetFrameRateThresholdUs(frame_rate_threshold_us_); begin_frame_timer_->SetFrameRateThresholdUs(frame_rate_threshold_us_);
} else { } else {
begin_frame_timer_.reset(new AtomBeginFrameTimer( begin_frame_timer_ = std::make_unique<AtomBeginFrameTimer>(
frame_rate_threshold_us_, frame_rate_threshold_us_,
base::BindRepeating( base::BindRepeating(
&OffScreenRenderWidgetHostView::OnBeginFrameTimerTick, &OffScreenRenderWidgetHostView::OnBeginFrameTimerTick,
weak_ptr_factory_.GetWeakPtr()))); weak_ptr_factory_.GetWeakPtr()));
} }
} }

View file

@ -4,10 +4,12 @@
#include "shell/browser/osr/osr_view_proxy.h" #include "shell/browser/osr/osr_view_proxy.h"
#include <memory>
namespace electron { namespace electron {
OffscreenViewProxy::OffscreenViewProxy(views::View* view) : view_(view) { OffscreenViewProxy::OffscreenViewProxy(views::View* view) : view_(view) {
view_bitmap_.reset(new SkBitmap); view_bitmap_ = std::make_unique<SkBitmap>();
} }
OffscreenViewProxy::~OffscreenViewProxy() { OffscreenViewProxy::~OffscreenViewProxy() {
@ -34,7 +36,7 @@ const SkBitmap* OffscreenViewProxy::GetBitmap() const {
void OffscreenViewProxy::SetBitmap(const SkBitmap& bitmap) { void OffscreenViewProxy::SetBitmap(const SkBitmap& bitmap) {
if (view_bounds_.width() == bitmap.width() && if (view_bounds_.width() == bitmap.width() &&
view_bounds_.height() == bitmap.height() && observer_) { view_bounds_.height() == bitmap.height() && observer_) {
view_bitmap_.reset(new SkBitmap(bitmap)); view_bitmap_ = std::make_unique<SkBitmap>(bitmap);
observer_->OnProxyViewPaint(view_bounds_); observer_->OnProxyViewPaint(view_bounds_);
} }
} }

View file

@ -48,7 +48,7 @@ ElectronRenderMessageFilter::ElectronRenderMessageFilter(
base::size(kRenderFilteredMessageClasses)), base::size(kRenderFilteredMessageClasses)),
browser_context_(browser_context) {} browser_context_(browser_context) {}
ElectronRenderMessageFilter::~ElectronRenderMessageFilter() {} ElectronRenderMessageFilter::~ElectronRenderMessageFilter() = default;
bool ElectronRenderMessageFilter::OnMessageReceived( bool ElectronRenderMessageFilter::OnMessageReceived(
const IPC::Message& message) { const IPC::Message& message) {

View file

@ -13,7 +13,7 @@ SessionPreferences::SessionPreferences(content::BrowserContext* context) {
context->SetUserData(&kLocatorKey, base::WrapUnique(this)); context->SetUserData(&kLocatorKey, base::WrapUnique(this));
} }
SessionPreferences::~SessionPreferences() {} SessionPreferences::~SessionPreferences() = default;
// static // static
SessionPreferences* SessionPreferences::FromBrowserContext( SessionPreferences* SessionPreferences::FromBrowserContext(

View file

@ -9,9 +9,9 @@
namespace electron { namespace electron {
SpecialStoragePolicy::SpecialStoragePolicy() {} SpecialStoragePolicy::SpecialStoragePolicy() = default;
SpecialStoragePolicy::~SpecialStoragePolicy() {} SpecialStoragePolicy::~SpecialStoragePolicy() = default;
bool SpecialStoragePolicy::IsStorageProtected(const GURL& origin) { bool SpecialStoragePolicy::IsStorageProtected(const GURL& origin) {
return true; return true;

View file

@ -17,7 +17,7 @@ bool AtomMenuModel::Delegate::GetAcceleratorForCommandId(
AtomMenuModel::AtomMenuModel(Delegate* delegate) AtomMenuModel::AtomMenuModel(Delegate* delegate)
: ui::SimpleMenuModel(delegate), delegate_(delegate) {} : ui::SimpleMenuModel(delegate), delegate_(delegate) {}
AtomMenuModel::~AtomMenuModel() {} AtomMenuModel::~AtomMenuModel() = default;
void AtomMenuModel::SetToolTip(int index, const base::string16& toolTip) { void AtomMenuModel::SetToolTip(int index, const base::string16& toolTip) {
int command_id = GetCommandIdAt(index); int command_id = GetCommandIdAt(index);

View file

@ -3,6 +3,8 @@
// found in the LICENSE file. // found in the LICENSE file.
#include <algorithm> #include <algorithm>
#include <memory>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -79,7 +81,7 @@ void AutofillPopup::CreateView(content::RenderFrameHost* frame_host,
} }
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(rwhv); auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(rwhv);
view_->view_proxy_.reset(new OffscreenViewProxy(view_)); view_->view_proxy_ = std::make_unique<OffscreenViewProxy>(view_);
osr_rwhv->AddViewProxy(view_->view_proxy_.get()); osr_rwhv->AddViewProxy(view_->view_proxy_.get());
} }
#endif #endif

View file

@ -92,9 +92,9 @@ void DevToolsManagerDelegate::StartHttpHandler() {
CreateSocketFactory(), user_dir, base::FilePath()); CreateSocketFactory(), user_dir, base::FilePath());
} }
DevToolsManagerDelegate::DevToolsManagerDelegate() {} DevToolsManagerDelegate::DevToolsManagerDelegate() = default;
DevToolsManagerDelegate::~DevToolsManagerDelegate() {} DevToolsManagerDelegate::~DevToolsManagerDelegate() = default;
void DevToolsManagerDelegate::Inspect(content::DevToolsAgentHost* agent_host) {} void DevToolsManagerDelegate::Inspect(content::DevToolsAgentHost* agent_host) {}

View file

@ -54,8 +54,8 @@ std::string GetMimeTypeForPath(const std::string& path) {
class BundledDataSource : public content::URLDataSource { class BundledDataSource : public content::URLDataSource {
public: public:
BundledDataSource() {} BundledDataSource() = default;
~BundledDataSource() override {} ~BundledDataSource() override = default;
// content::URLDataSource implementation. // content::URLDataSource implementation.
std::string GetSource() override { return kChromeUIDevToolsHost; } std::string GetSource() override { return kChromeUIDevToolsHost; }

View file

@ -2,6 +2,8 @@
// Use of this source code is governed by the MIT license that can be // Use of this source code is governed by the MIT license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include <memory>
#include "shell/browser/ui/file_dialog.h" #include "shell/browser/ui/file_dialog.h"
#include "shell/browser/ui/util_gtk.h" #include "shell/browser/ui/util_gtk.h"
@ -57,7 +59,7 @@ class FileChooserDialog {
confirm_text = gtk_util::kSaveLabel; confirm_text = gtk_util::kSaveLabel;
dialog_ = gtk_file_chooser_dialog_new( dialog_ = gtk_file_chooser_dialog_new(
settings.title.c_str(), NULL, action, gtk_util::kCancelLabel, settings.title.c_str(), nullptr, action, gtk_util::kCancelLabel,
GTK_RESPONSE_CANCEL, confirm_text, GTK_RESPONSE_ACCEPT, NULL); GTK_RESPONSE_CANCEL, confirm_text, GTK_RESPONSE_ACCEPT, NULL);
if (parent_) { if (parent_) {
parent_->SetEnabled(false); parent_->SetEnabled(false);
@ -140,15 +142,17 @@ class FileChooserDialog {
void RunSaveAsynchronous( void RunSaveAsynchronous(
electron::util::Promise<gin_helper::Dictionary> promise) { electron::util::Promise<gin_helper::Dictionary> promise) {
save_promise_.reset(new electron::util::Promise<gin_helper::Dictionary>( save_promise_ =
std::move(promise))); std::make_unique<electron::util::Promise<gin_helper::Dictionary>>(
std::move(promise));
RunAsynchronous(); RunAsynchronous();
} }
void RunOpenAsynchronous( void RunOpenAsynchronous(
electron::util::Promise<gin_helper::Dictionary> promise) { electron::util::Promise<gin_helper::Dictionary> promise) {
open_promise_.reset(new electron::util::Promise<gin_helper::Dictionary>( open_promise_ =
std::move(promise))); std::make_unique<electron::util::Promise<gin_helper::Dictionary>>(
std::move(promise));
RunAsynchronous(); RunAsynchronous();
} }
@ -162,7 +166,7 @@ class FileChooserDialog {
std::vector<base::FilePath> GetFileNames() const { std::vector<base::FilePath> GetFileNames() const {
std::vector<base::FilePath> paths; std::vector<base::FilePath> paths;
auto* filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog_)); auto* filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog_));
for (auto* iter = filenames; iter != NULL; iter = iter->next) { for (auto* iter = filenames; iter != nullptr; iter = iter->next) {
auto* filename = static_cast<char*>(iter->data); auto* filename = static_cast<char*>(iter->data);
paths.emplace_back(filename); paths.emplace_back(filename);
g_free(filename); g_free(filename);

View file

@ -8,9 +8,9 @@ namespace electron {
TrayIcon::BalloonOptions::BalloonOptions() = default; TrayIcon::BalloonOptions::BalloonOptions() = default;
TrayIcon::TrayIcon() {} TrayIcon::TrayIcon() = default;
TrayIcon::~TrayIcon() {} TrayIcon::~TrayIcon() = default;
void TrayIcon::SetPressedImage(ImageType image) {} void TrayIcon::SetPressedImage(ImageType image) {}

View file

@ -13,9 +13,9 @@
namespace electron { namespace electron {
TrayIconGtk::TrayIconGtk() {} TrayIconGtk::TrayIconGtk() = default;
TrayIconGtk::~TrayIconGtk() {} TrayIconGtk::~TrayIconGtk() = default;
void TrayIconGtk::SetImage(const gfx::Image& image) { void TrayIconGtk::SetImage(const gfx::Image& image) {
if (icon_) { if (icon_) {

View file

@ -30,9 +30,9 @@ bool IsDesktopEnvironmentUnity() {
namespace electron { namespace electron {
ViewsDelegate::ViewsDelegate() {} ViewsDelegate::ViewsDelegate() = default;
ViewsDelegate::~ViewsDelegate() {} ViewsDelegate::~ViewsDelegate() = default;
void ViewsDelegate::SaveWindowPlacement(const views::Widget* window, void ViewsDelegate::SaveWindowPlacement(const views::Widget* window,
const std::string& window_name, const std::string& window_name,
@ -70,13 +70,13 @@ bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow window) const {
#elif defined(OS_LINUX) && !defined(OS_CHROMEOS) #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const { gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
return NULL; return nullptr;
} }
#endif #endif
views::NonClientFrameView* ViewsDelegate::CreateDefaultNonClientFrameView( views::NonClientFrameView* ViewsDelegate::CreateDefaultNonClientFrameView(
views::Widget* widget) { views::Widget* widget) {
return NULL; return nullptr;
} }
void ViewsDelegate::AddRef() {} void ViewsDelegate::AddRef() {}

View file

@ -245,7 +245,7 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
if (view_proxy_.get()) { if (view_proxy_.get()) {
bitmap.allocN32Pixels(popup_->popup_bounds_in_view().width(), bitmap.allocN32Pixels(popup_->popup_bounds_in_view().width(),
popup_->popup_bounds_in_view().height(), true); popup_->popup_bounds_in_view().height(), true);
paint_canvas.reset(new cc::SkiaPaintCanvas(bitmap)); paint_canvas = std::make_unique<cc::SkiaPaintCanvas>(bitmap);
draw_canvas = new gfx::Canvas(paint_canvas.get(), 1.0); draw_canvas = new gfx::Canvas(paint_canvas.get(), 1.0);
} }
#endif #endif

View file

@ -22,9 +22,9 @@ const int kResizeAreaCornerSize = 16;
// static // static
const char FramelessView::kViewClassName[] = "FramelessView"; const char FramelessView::kViewClassName[] = "FramelessView";
FramelessView::FramelessView() {} FramelessView::FramelessView() = default;
FramelessView::~FramelessView() {} FramelessView::~FramelessView() = default;
void FramelessView::Init(NativeWindowViews* window, views::Widget* frame) { void FramelessView::Init(NativeWindowViews* window, views::Widget* frame) {
window_ = window; window_ = window;

View file

@ -58,21 +58,21 @@ namespace {
// Retrieved functions from libdbusmenu-glib. // Retrieved functions from libdbusmenu-glib.
// DbusmenuMenuItem methods: // DbusmenuMenuItem methods:
dbusmenu_menuitem_new_func menuitem_new = NULL; dbusmenu_menuitem_new_func menuitem_new = nullptr;
dbusmenu_menuitem_new_with_id_func menuitem_new_with_id = NULL; dbusmenu_menuitem_new_with_id_func menuitem_new_with_id = nullptr;
dbusmenu_menuitem_get_id_func menuitem_get_id = NULL; dbusmenu_menuitem_get_id_func menuitem_get_id = nullptr;
dbusmenu_menuitem_get_children_func menuitem_get_children = NULL; dbusmenu_menuitem_get_children_func menuitem_get_children = nullptr;
dbusmenu_menuitem_get_children_func menuitem_take_children = NULL; dbusmenu_menuitem_get_children_func menuitem_take_children = nullptr;
dbusmenu_menuitem_child_append_func menuitem_child_append = NULL; dbusmenu_menuitem_child_append_func menuitem_child_append = nullptr;
dbusmenu_menuitem_property_set_func menuitem_property_set = NULL; dbusmenu_menuitem_property_set_func menuitem_property_set = nullptr;
dbusmenu_menuitem_property_set_variant_func menuitem_property_set_variant = dbusmenu_menuitem_property_set_variant_func menuitem_property_set_variant =
NULL; nullptr;
dbusmenu_menuitem_property_set_bool_func menuitem_property_set_bool = NULL; dbusmenu_menuitem_property_set_bool_func menuitem_property_set_bool = nullptr;
dbusmenu_menuitem_property_set_int_func menuitem_property_set_int = NULL; dbusmenu_menuitem_property_set_int_func menuitem_property_set_int = nullptr;
// DbusmenuServer methods: // DbusmenuServer methods:
dbusmenu_server_new_func server_new = NULL; dbusmenu_server_new_func server_new = nullptr;
dbusmenu_server_set_root_func server_set_root = NULL; dbusmenu_server_set_root_func server_set_root = nullptr;
// Properties that we set on menu items: // Properties that we set on menu items:
const char kPropertyEnabled[] = "enabled"; const char kPropertyEnabled[] = "enabled";
@ -141,7 +141,7 @@ AtomMenuModel* ModelForMenuItem(DbusmenuMenuitem* item) {
bool GetMenuItemID(DbusmenuMenuitem* item, int* id) { bool GetMenuItemID(DbusmenuMenuitem* item, int* id) {
gpointer id_ptr = g_object_get_data(G_OBJECT(item), "menu-id"); gpointer id_ptr = g_object_get_data(G_OBJECT(item), "menu-id");
if (id_ptr != NULL) { if (id_ptr != nullptr) {
*id = GPOINTER_TO_INT(id_ptr) - 1; *id = GPOINTER_TO_INT(id_ptr) - 1;
return true; return true;
} }
@ -326,7 +326,7 @@ void GlobalMenuBarX11::OnSubMenuShow(DbusmenuMenuitem* item) {
// Clear children. // Clear children.
GList* children = menuitem_take_children(item); GList* children = menuitem_take_children(item);
g_list_foreach(children, reinterpret_cast<GFunc>(g_object_unref), NULL); g_list_foreach(children, reinterpret_cast<GFunc>(g_object_unref), nullptr);
g_list_free(children); g_list_free(children);
// Build children. // Build children.

View file

@ -4,6 +4,8 @@
#include "shell/browser/ui/views/inspectable_web_contents_view_views.h" #include "shell/browser/ui/views/inspectable_web_contents_view_views.h"
#include <memory>
#include <utility> #include <utility>
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
@ -36,7 +38,7 @@ class DevToolsWindowDelegate : public views::ClientView,
if (shell->GetDelegate()) if (shell->GetDelegate())
icon_ = shell->GetDelegate()->GetDevToolsWindowIcon(); icon_ = shell->GetDelegate()->GetDevToolsWindowIcon();
} }
~DevToolsWindowDelegate() override {} ~DevToolsWindowDelegate() override = default;
// views::WidgetDelegate: // views::WidgetDelegate:
void DeleteDelegate() override { delete this; } void DeleteDelegate() override { delete this; }
@ -154,7 +156,7 @@ void InspectableWebContentsViewViews::CloseDevTools() {
devtools_window_delegate_ = nullptr; devtools_window_delegate_ = nullptr;
} else { } else {
devtools_web_view_->SetVisible(false); devtools_web_view_->SetVisible(false);
devtools_web_view_->SetWebContents(NULL); devtools_web_view_->SetWebContents(nullptr);
Layout(); Layout();
} }
} }
@ -176,8 +178,8 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked, bool activate) {
CloseDevTools(); CloseDevTools();
if (!docked) { if (!docked) {
devtools_window_.reset(new views::Widget); devtools_window_ = std::make_unique<views::Widget>();
devtools_window_web_view_ = new views::WebView(NULL); devtools_window_web_view_ = new views::WebView(nullptr);
devtools_window_delegate_ = new DevToolsWindowDelegate( devtools_window_delegate_ = new DevToolsWindowDelegate(
this, devtools_window_web_view_, devtools_window_.get()); this, devtools_window_web_view_, devtools_window_.get());

View file

@ -39,7 +39,7 @@ const char MenuBar::kViewClassName[] = "ElectronMenuBar";
MenuBarColorUpdater::MenuBarColorUpdater(MenuBar* menu_bar) MenuBarColorUpdater::MenuBarColorUpdater(MenuBar* menu_bar)
: menu_bar_(menu_bar) {} : menu_bar_(menu_bar) {}
MenuBarColorUpdater::~MenuBarColorUpdater() {} MenuBarColorUpdater::~MenuBarColorUpdater() = default;
void MenuBarColorUpdater::OnDidChangeFocus(views::View* focused_before, void MenuBarColorUpdater::OnDidChangeFocus(views::View* focused_before,
views::View* focused_now) { views::View* focused_now) {

View file

@ -4,6 +4,8 @@
#include "shell/browser/ui/views/menu_delegate.h" #include "shell/browser/ui/views/menu_delegate.h"
#include <memory>
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
@ -19,7 +21,7 @@ namespace electron {
MenuDelegate::MenuDelegate(MenuBar* menu_bar) MenuDelegate::MenuDelegate(MenuBar* menu_bar)
: menu_bar_(menu_bar), id_(-1), hold_first_switch_(false) {} : menu_bar_(menu_bar), id_(-1), hold_first_switch_(false) {}
MenuDelegate::~MenuDelegate() {} MenuDelegate::~MenuDelegate() = default;
void MenuDelegate::RunMenu(AtomMenuModel* model, void MenuDelegate::RunMenu(AtomMenuModel* model,
views::Button* button, views::Button* button,
@ -35,14 +37,13 @@ void MenuDelegate::RunMenu(AtomMenuModel* model,
} }
id_ = button->tag(); id_ = button->tag();
adapter_.reset(new MenuModelAdapter(model)); adapter_ = std::make_unique<MenuModelAdapter>(model);
views::MenuItemView* item = new views::MenuItemView(this); views::MenuItemView* item = new views::MenuItemView(this);
static_cast<MenuModelAdapter*>(adapter_.get())->BuildMenu(item); static_cast<MenuModelAdapter*>(adapter_.get())->BuildMenu(item);
menu_runner_.reset(new views::MenuRunner( menu_runner_ = std::make_unique<views::MenuRunner>(
item, item, views::MenuRunner::CONTEXT_MENU | views::MenuRunner::HAS_MNEMONICS);
views::MenuRunner::CONTEXT_MENU | views::MenuRunner::HAS_MNEMONICS));
menu_runner_->RunMenuAt( menu_runner_->RunMenuAt(
button->GetWidget()->GetTopLevelWidget(), button->GetWidget()->GetTopLevelWidget(),
static_cast<views::MenuButton*>(button)->button_controller(), bounds, static_cast<views::MenuButton*>(button)->button_controller(), bounds,

View file

@ -9,7 +9,7 @@ namespace electron {
MenuModelAdapter::MenuModelAdapter(AtomMenuModel* menu_model) MenuModelAdapter::MenuModelAdapter(AtomMenuModel* menu_model)
: views::MenuModelAdapter(menu_model), menu_model_(menu_model) {} : views::MenuModelAdapter(menu_model), menu_model_(menu_model) {}
MenuModelAdapter::~MenuModelAdapter() {} MenuModelAdapter::~MenuModelAdapter() = default;
bool MenuModelAdapter::GetAccelerator(int id, bool MenuModelAdapter::GetAccelerator(int id,
ui::Accelerator* accelerator) const { ui::Accelerator* accelerator) const {

View file

@ -4,6 +4,8 @@
#include "shell/browser/ui/views/root_view.h" #include "shell/browser/ui/views/root_view.h"
#include <memory>
#include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/native_web_keyboard_event.h"
#include "shell/browser/native_window.h" #include "shell/browser/native_window.h"
#include "shell/browser/ui/views/menu_bar.h" #include "shell/browser/ui/views/menu_bar.h"
@ -41,7 +43,7 @@ RootView::RootView(NativeWindow* window)
set_owned_by_client(); set_owned_by_client();
} }
RootView::~RootView() {} RootView::~RootView() = default;
void RootView::SetMenu(AtomMenuModel* menu_model) { void RootView::SetMenu(AtomMenuModel* menu_model) {
if (menu_model == nullptr) { if (menu_model == nullptr) {
@ -60,7 +62,7 @@ void RootView::SetMenu(AtomMenuModel* menu_model) {
return; return;
if (!menu_bar_) { if (!menu_bar_) {
menu_bar_.reset(new MenuBar(this)); menu_bar_ = std::make_unique<MenuBar>(this);
menu_bar_->set_owned_by_client(); menu_bar_->set_owned_by_client();
if (!menu_bar_autohide_) if (!menu_bar_autohide_)
SetMenuBarVisibility(true); SetMenuBarVisibility(true);

View file

@ -22,8 +22,9 @@ namespace electron {
SubmenuButton::SubmenuButton(const base::string16& title, SubmenuButton::SubmenuButton(const base::string16& title,
views::MenuButtonListener* menu_button_listener, views::MenuButtonListener* menu_button_listener,
const SkColor& background_color) const SkColor& background_color)
: views::MenuButton(gfx::RemoveAcceleratorChar(title, '&', NULL, NULL), : views::MenuButton(
menu_button_listener), gfx::RemoveAcceleratorChar(title, '&', nullptr, nullptr),
menu_button_listener),
background_color_(background_color) { background_color_(background_color) {
#if defined(OS_LINUX) #if defined(OS_LINUX)
// Dont' use native style border. // Dont' use native style border.
@ -40,7 +41,7 @@ SubmenuButton::SubmenuButton(const base::string16& title,
color_utils::BlendTowardMaxContrast(background_color_, 0x81)); color_utils::BlendTowardMaxContrast(background_color_, 0x81));
} }
SubmenuButton::~SubmenuButton() {} SubmenuButton::~SubmenuButton() = default;
std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple() std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
const { const {

View file

@ -8,9 +8,9 @@
namespace electron { namespace electron {
EventDisabler::EventDisabler() {} EventDisabler::EventDisabler() = default;
EventDisabler::~EventDisabler() {} EventDisabler::~EventDisabler() = default;
ui::EventRewriteStatus EventDisabler::RewriteEvent( ui::EventRewriteStatus EventDisabler::RewriteEvent(
const ui::Event& event, const ui::Event& event,

View file

@ -70,7 +70,7 @@ bool ShouldUseGlobalMenuBar() {
} }
dbus::MessageReader reader(response.get()); dbus::MessageReader reader(response.get());
dbus::MessageReader array_reader(NULL); dbus::MessageReader array_reader(nullptr);
if (!reader.PopArray(&array_reader)) { if (!reader.PopArray(&array_reader)) {
bus->ShutdownAndBlock(); bus->ShutdownAndBlock();
return false; return false;

View file

@ -62,7 +62,7 @@ WebContentsPermissionHelper::WebContentsPermissionHelper(
content::WebContents* web_contents) content::WebContents* web_contents)
: web_contents_(web_contents) {} : web_contents_(web_contents) {}
WebContentsPermissionHelper::~WebContentsPermissionHelper() {} WebContentsPermissionHelper::~WebContentsPermissionHelper() = default;
void WebContentsPermissionHelper::RequestPermission( void WebContentsPermissionHelper::RequestPermission(
content::PermissionType permission, content::PermissionType permission,

View file

@ -24,7 +24,7 @@ WebContentsZoomController::WebContentsZoomController(
host_zoom_map_ = content::HostZoomMap::GetForWebContents(web_contents); host_zoom_map_ = content::HostZoomMap::GetForWebContents(web_contents);
} }
WebContentsZoomController::~WebContentsZoomController() {} WebContentsZoomController::~WebContentsZoomController() = default;
void WebContentsZoomController::AddObserver( void WebContentsZoomController::AddObserver(
WebContentsZoomController::Observer* observer) { WebContentsZoomController::Observer* observer) {

View file

@ -4,6 +4,8 @@
#include "shell/browser/web_dialog_helper.h" #include "shell/browser/web_dialog_helper.h"
#include <memory>
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -77,7 +79,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
private: private:
friend class base::RefCounted<FileSelectHelper>; friend class base::RefCounted<FileSelectHelper>;
~FileSelectHelper() override {} ~FileSelectHelper() override = default;
// net::DirectoryLister::DirectoryListerDelegate // net::DirectoryLister::DirectoryListerDelegate
void OnListFile( void OnListFile(
@ -106,8 +108,8 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
DCHECK(!lister_base_dir_.empty()); DCHECK(!lister_base_dir_.empty());
DCHECK(lister_paths_.empty()); DCHECK(lister_paths_.empty());
lister_.reset(new net::DirectoryLister( lister_ = std::make_unique<net::DirectoryLister>(
lister_base_dir_, net::DirectoryLister::NO_SORT_RECURSIVE, this)); lister_base_dir_, net::DirectoryLister::NO_SORT_RECURSIVE, this);
lister_->Start(); lister_->Start();
// It is difficult for callers to know how long to keep a reference to // It is difficult for callers to know how long to keep a reference to
// this instance. We AddRef() here to keep the instance alive after we // this instance. We AddRef() here to keep the instance alive after we
@ -294,7 +296,7 @@ namespace electron {
WebDialogHelper::WebDialogHelper(NativeWindow* window, bool offscreen) WebDialogHelper::WebDialogHelper(NativeWindow* window, bool offscreen)
: window_(window), offscreen_(offscreen), weak_factory_(this) {} : window_(window), offscreen_(offscreen), weak_factory_(this) {}
WebDialogHelper::~WebDialogHelper() {} WebDialogHelper::~WebDialogHelper() = default;
void WebDialogHelper::RunFileChooser( void WebDialogHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,

View file

@ -11,9 +11,9 @@
namespace electron { namespace electron {
WebViewManager::WebViewManager() {} WebViewManager::WebViewManager() = default;
WebViewManager::~WebViewManager() {} WebViewManager::~WebViewManager() = default;
void WebViewManager::AddGuest(int guest_instance_id, void WebViewManager::AddGuest(int guest_instance_id,
int element_instance_id, int element_instance_id,

View file

@ -96,8 +96,8 @@ void WindowList::DestroyAllWindows() {
window->CloseImmediately(); // e.g. Destroy() window->CloseImmediately(); // e.g. Destroy()
} }
WindowList::WindowList() {} WindowList::WindowList() = default;
WindowList::~WindowList() {} WindowList::~WindowList() = default;
} // namespace electron } // namespace electron

View file

@ -50,7 +50,7 @@ ZoomLevelDelegate::ZoomLevelDelegate(PrefService* pref_service,
partition_key_ = GetHash(partition_path); partition_key_ = GetHash(partition_path);
} }
ZoomLevelDelegate::~ZoomLevelDelegate() {} ZoomLevelDelegate::~ZoomLevelDelegate() = default;
void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) { void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) {
if (content::ZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel())) if (content::ZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel()))

View file

@ -4,13 +4,15 @@
#include "shell/common/api/locker.h" #include "shell/common/api/locker.h"
#include <memory>
namespace mate { namespace mate {
Locker::Locker(v8::Isolate* isolate) { Locker::Locker(v8::Isolate* isolate) {
if (IsBrowserProcess()) if (IsBrowserProcess())
locker_.reset(new v8::Locker(isolate)); locker_ = std::make_unique<v8::Locker>(isolate);
} }
Locker::~Locker() {} Locker::~Locker() = default;
} // namespace mate } // namespace mate

View file

@ -32,7 +32,7 @@ RemoteCallbackFreer::RemoteCallbackFreer(v8::Isolate* isolate,
context_id_(context_id), context_id_(context_id),
object_id_(object_id) {} object_id_(object_id) {}
RemoteCallbackFreer::~RemoteCallbackFreer() {} RemoteCallbackFreer::~RemoteCallbackFreer() = default;
void RemoteCallbackFreer::RunDestructor() { void RemoteCallbackFreer::RunDestructor() {
auto* channel = "ELECTRON_RENDERER_RELEASE_CALLBACK"; auto* channel = "ELECTRON_RENDERER_RELEASE_CALLBACK";

View file

@ -57,7 +57,7 @@ RemoteObjectFreer::RemoteObjectFreer(v8::Isolate* isolate,
} }
} }
RemoteObjectFreer::~RemoteObjectFreer() {} RemoteObjectFreer::~RemoteObjectFreer() = default;
void RemoteObjectFreer::RunDestructor() { void RemoteObjectFreer::RunDestructor() {
content::RenderFrame* render_frame = content::RenderFrame* render_frame =

View file

@ -11,7 +11,7 @@
namespace asar { namespace asar {
ScopedTemporaryFile::ScopedTemporaryFile() {} ScopedTemporaryFile::ScopedTemporaryFile() = default;
ScopedTemporaryFile::~ScopedTemporaryFile() { ScopedTemporaryFile::~ScopedTemporaryFile() {
if (!path_.empty()) { if (!path_.empty()) {

View file

@ -40,7 +40,7 @@ CrashReporter::CrashReporter() {
// process_type_ will be empty for browser process // process_type_ will be empty for browser process
} }
CrashReporter::~CrashReporter() {} CrashReporter::~CrashReporter() = default;
bool CrashReporter::IsInitialized() { bool CrashReporter::IsInitialized() {
return is_initialized_; return is_initialized_;

View file

@ -8,6 +8,8 @@
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <memory>
#include <string> #include <string>
#include "base/debug/crash_logging.h" #include "base/debug/crash_logging.h"
@ -38,7 +40,7 @@ static const off_t kMaxMinidumpFileSize = 1258291;
CrashReporterLinux::CrashReporterLinux() : pid_(getpid()) { CrashReporterLinux::CrashReporterLinux() : pid_(getpid()) {
// Set the base process start time value. // Set the base process start time value.
struct timeval tv; struct timeval tv;
if (!gettimeofday(&tv, NULL)) { if (!gettimeofday(&tv, nullptr)) {
uint64_t ret = tv.tv_sec; uint64_t ret = tv.tv_sec;
ret *= 1000; ret *= 1000;
ret += tv.tv_usec / 1000; ret += tv.tv_usec / 1000;
@ -49,7 +51,7 @@ CrashReporterLinux::CrashReporterLinux() : pid_(getpid()) {
base::SetLinuxDistro(base::GetLinuxDistro()); base::SetLinuxDistro(base::GetLinuxDistro());
} }
CrashReporterLinux::~CrashReporterLinux() {} CrashReporterLinux::~CrashReporterLinux() = default;
void CrashReporterLinux::Init(const std::string& product_name, void CrashReporterLinux::Init(const std::string& product_name,
const std::string& company_name, const std::string& company_name,
@ -62,7 +64,7 @@ void CrashReporterLinux::Init(const std::string& product_name,
upload_url_ = submit_url; upload_url_ = submit_url;
upload_to_server_ = upload_to_server; upload_to_server_ = upload_to_server;
crash_keys_.reset(new CrashKeyStorage()); crash_keys_ = std::make_unique<CrashKeyStorage>();
for (StringMap::const_iterator iter = upload_parameters_.begin(); for (StringMap::const_iterator iter = upload_parameters_.begin();
iter != upload_parameters_.end(); ++iter) iter != upload_parameters_.end(); ++iter)
crash_keys_->SetKeyValue(iter->first.c_str(), iter->second.c_str()); crash_keys_->SetKeyValue(iter->first.c_str(), iter->second.c_str());
@ -91,10 +93,10 @@ void CrashReporterLinux::EnableCrashDumping(const base::FilePath& crashes_dir) {
MinidumpDescriptor minidump_descriptor(crashes_dir.value()); MinidumpDescriptor minidump_descriptor(crashes_dir.value());
minidump_descriptor.set_size_limit(kMaxMinidumpFileSize); minidump_descriptor.set_size_limit(kMaxMinidumpFileSize);
breakpad_.reset(new ExceptionHandler(minidump_descriptor, NULL, CrashDone, breakpad_ = std::make_unique<ExceptionHandler>(minidump_descriptor, nullptr,
this, CrashDone, this,
true, // Install handlers. true, // Install handlers.
-1)); -1);
} }
bool CrashReporterLinux::CrashDone(const MinidumpDescriptor& minidump, bool CrashReporterLinux::CrashDone(const MinidumpDescriptor& minidump,

View file

@ -166,7 +166,7 @@ class MimeWriter {
MimeWriter::MimeWriter(int fd, const char* const mime_boundary) MimeWriter::MimeWriter(int fd, const char* const mime_boundary)
: fd_(fd), mime_boundary_(mime_boundary) {} : fd_(fd), mime_boundary_(mime_boundary) {}
MimeWriter::~MimeWriter() {} MimeWriter::~MimeWriter() = default;
void MimeWriter::AddBoundary() { void MimeWriter::AddBoundary() {
AddString(mime_boundary_); AddString(mime_boundary_);
@ -349,12 +349,12 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
static const char kWgetBinary[] = "/usr/bin/wget"; static const char kWgetBinary[] = "/usr/bin/wget";
const char* args[] = { const char* args[] = {
kWgetBinary, header, post_file, info.upload_url, kWgetBinary, header, post_file, info.upload_url,
"--timeout=60", // Set a timeout so we don't hang forever. "--timeout=60", // Set a timeout so we don't hang forever.
"--tries=1", // Don't retry if the upload fails. "--tries=1", // Don't retry if the upload fails.
"--quiet", // Be silent. "--quiet", // Be silent.
"-O", // output reply to /dev/null. "-O", // output reply to /dev/null.
"/dev/fd/3", NULL, "/dev/fd/3", nullptr,
}; };
static const char msg[] = static const char msg[] =
"Cannot upload crash dump: cannot exec " "Cannot upload crash dump: cannot exec "
@ -437,7 +437,7 @@ void HandleCrashReportId(const char* buf,
// Write crash dump id to crash log as: seconds_since_epoch,crash_id // Write crash dump id to crash log as: seconds_since_epoch,crash_id
struct kernel_timeval tv; struct kernel_timeval tv;
if (!sys_gettimeofday(&tv, NULL)) { if (!sys_gettimeofday(&tv, nullptr)) {
uint64_t time = kernel_timeval_to_ms(&tv) / 1000; uint64_t time = kernel_timeval_to_ms(&tv) / 1000;
char time_str[kUint64StringSize]; char time_str[kUint64StringSize];
const unsigned time_len = my_uint64_len(time); const unsigned time_len = my_uint64_len(time);
@ -465,7 +465,7 @@ void HandleCrashDump(const BreakpadInfo& info) {
size_t dump_size; size_t dump_size;
uint8_t* dump_data; uint8_t* dump_data;
google_breakpad::PageAllocator allocator; google_breakpad::PageAllocator allocator;
const char* exe_buf = NULL; const char* exe_buf = nullptr;
if (info.fd != -1) { if (info.fd != -1) {
// Dump is provided with an open FD. // Dump is provided with an open FD.
@ -614,7 +614,7 @@ void HandleCrashDump(const BreakpadInfo& info) {
if (info.process_start_time > 0) { if (info.process_start_time > 0) {
struct kernel_timeval tv; struct kernel_timeval tv;
if (!sys_gettimeofday(&tv, NULL)) { if (!sys_gettimeofday(&tv, nullptr)) {
uint64_t time = kernel_timeval_to_ms(&tv); uint64_t time = kernel_timeval_to_ms(&tv);
if (time > info.process_start_time) { if (time > info.process_start_time) {
time -= info.process_start_time; time -= info.process_start_time;
@ -723,7 +723,7 @@ void HandleCrashDump(const BreakpadInfo& info) {
WaitForCrashReportUploadProcess(fds[0], kCrashIdLength, id_buf); WaitForCrashReportUploadProcess(fds[0], kCrashIdLength, id_buf);
HandleCrashReportId(id_buf, bytes_read, kCrashIdLength); HandleCrashReportId(id_buf, bytes_read, kCrashIdLength);
if (sys_waitpid(upload_child, NULL, WNOHANG) == 0) { if (sys_waitpid(upload_child, nullptr, WNOHANG) == 0) {
// Upload process is still around, kill it. // Upload process is still around, kill it.
sys_kill(upload_child, SIGKILL); sys_kill(upload_child, SIGKILL);
} }
@ -739,7 +739,7 @@ void HandleCrashDump(const BreakpadInfo& info) {
// Main browser process. // Main browser process.
if (child <= 0) if (child <= 0)
return; return;
(void)HANDLE_EINTR(sys_waitpid(child, NULL, 0)); (void)HANDLE_EINTR(sys_waitpid(child, nullptr, 0));
} }
size_t WriteLog(const char* buf, size_t nbytes) { size_t WriteLog(const char* buf, size_t nbytes) {

View file

@ -102,10 +102,9 @@ class RefCountedGlobal
SafeV8Function::SafeV8Function(v8::Isolate* isolate, v8::Local<v8::Value> value) SafeV8Function::SafeV8Function(v8::Isolate* isolate, v8::Local<v8::Value> value)
: v8_function_(new RefCountedGlobal<v8::Function>(isolate, value)) {} : v8_function_(new RefCountedGlobal<v8::Function>(isolate, value)) {}
SafeV8Function::SafeV8Function(const SafeV8Function& other) SafeV8Function::SafeV8Function(const SafeV8Function& other) = default;
: v8_function_(other.v8_function_) {}
SafeV8Function::~SafeV8Function() {} SafeV8Function::~SafeV8Function() = default;
bool SafeV8Function::IsAlive() const { bool SafeV8Function::IsAlive() const {
return v8_function_.get() && v8_function_->IsAlive(); return v8_function_.get() && v8_function_->IsAlive();

View file

@ -106,10 +106,9 @@ class RefCountedGlobal
SafeV8Function::SafeV8Function(v8::Isolate* isolate, v8::Local<v8::Value> value) SafeV8Function::SafeV8Function(v8::Isolate* isolate, v8::Local<v8::Value> value)
: v8_function_(new RefCountedGlobal<v8::Function>(isolate, value)) {} : v8_function_(new RefCountedGlobal<v8::Function>(isolate, value)) {}
SafeV8Function::SafeV8Function(const SafeV8Function& other) SafeV8Function::SafeV8Function(const SafeV8Function& other) = default;
: v8_function_(other.v8_function_) {}
SafeV8Function::~SafeV8Function() {} SafeV8Function::~SafeV8Function() = default;
bool SafeV8Function::IsAlive() const { bool SafeV8Function::IsAlive() const {
return v8_function_.get() && v8_function_->IsAlive(); return v8_function_.get() && v8_function_->IsAlive();

View file

@ -122,7 +122,7 @@ class V8ValueConverter::ScopedUniquenessGuard {
DISALLOW_COPY_AND_ASSIGN(ScopedUniquenessGuard); DISALLOW_COPY_AND_ASSIGN(ScopedUniquenessGuard);
}; };
V8ValueConverter::V8ValueConverter() {} V8ValueConverter::V8ValueConverter() = default;
void V8ValueConverter::SetRegExpAllowed(bool val) { void V8ValueConverter::SetRegExpAllowed(bool val) {
reg_exp_allowed_ = val; reg_exp_allowed_ = val;
@ -386,7 +386,7 @@ std::unique_ptr<base::Value> V8ValueConverter::FromV8Array(
// that context, but change back after val is converted. // that context, but change back after val is converted.
if (!val->CreationContext().IsEmpty() && if (!val->CreationContext().IsEmpty() &&
val->CreationContext() != isolate->GetCurrentContext()) val->CreationContext() != isolate->GetCurrentContext())
scope.reset(new v8::Context::Scope(val->CreationContext())); scope = std::make_unique<v8::Context::Scope>(val->CreationContext());
std::unique_ptr<base::ListValue> result(new base::ListValue()); std::unique_ptr<base::ListValue> result(new base::ListValue());
@ -442,7 +442,7 @@ std::unique_ptr<base::Value> V8ValueConverter::FromV8Object(
// that context, but change back after val is converted. // that context, but change back after val is converted.
if (!val->CreationContext().IsEmpty() && if (!val->CreationContext().IsEmpty() &&
val->CreationContext() != isolate->GetCurrentContext()) val->CreationContext() != isolate->GetCurrentContext())
scope.reset(new v8::Context::Scope(val->CreationContext())); scope = std::make_unique<v8::Context::Scope>(val->CreationContext());
auto result = std::make_unique<base::DictionaryValue>(); auto result = std::make_unique<base::DictionaryValue>();
v8::Local<v8::Array> property_names; v8::Local<v8::Array> property_names;

View file

@ -17,7 +17,7 @@ NodeBindingsLinux::NodeBindingsLinux(BrowserEnvironment browser_env)
epoll_ctl(epoll_, EPOLL_CTL_ADD, backend_fd, &ev); epoll_ctl(epoll_, EPOLL_CTL_ADD, backend_fd, &ev);
} }
NodeBindingsLinux::~NodeBindingsLinux() {} NodeBindingsLinux::~NodeBindingsLinux() = default;
void NodeBindingsLinux::RunMessageLoop() { void NodeBindingsLinux::RunMessageLoop() {
// Get notified when libuv's watcher queue changes. // Get notified when libuv's watcher queue changes.

View file

@ -5,6 +5,8 @@
#include "shell/renderer/api/atom_api_spell_check_client.h" #include "shell/renderer/api/atom_api_spell_check_client.h"
#include <map> #include <map>
#include <memory>
#include <set> #include <set>
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
@ -55,7 +57,7 @@ class SpellCheckClient::SpellcheckRequest {
const base::string16& text, const base::string16& text,
std::unique_ptr<blink::WebTextCheckingCompletion> completion) std::unique_ptr<blink::WebTextCheckingCompletion> completion)
: text_(text), completion_(std::move(completion)) {} : text_(text), completion_(std::move(completion)) {}
~SpellcheckRequest() {} ~SpellcheckRequest() = default;
const base::string16& text() const { return text_; } const base::string16& text() const { return text_; }
blink::WebTextCheckingCompletion* completion() { return completion_.get(); } blink::WebTextCheckingCompletion* completion() { return completion_.get(); }
@ -105,8 +107,8 @@ void SpellCheckClient::RequestCheckingOfText(
pending_request_param_->completion()->DidCancelCheckingText(); pending_request_param_->completion()->DidCancelCheckingText();
} }
pending_request_param_.reset( pending_request_param_ =
new SpellcheckRequest(text, std::move(completionCallback))); std::make_unique<SpellcheckRequest>(text, std::move(completionCallback));
base::ThreadTaskRunnerHandle::Get()->PostTask( base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, FROM_HERE,

View file

@ -100,7 +100,7 @@ class RenderFrameStatus final : public content::RenderFrameObserver {
public: public:
explicit RenderFrameStatus(content::RenderFrame* render_frame) explicit RenderFrameStatus(content::RenderFrame* render_frame)
: content::RenderFrameObserver(render_frame) {} : content::RenderFrameObserver(render_frame) {}
~RenderFrameStatus() final {} ~RenderFrameStatus() final = default;
bool is_ok() { return render_frame() != nullptr; } bool is_ok() { return render_frame() != nullptr; }
@ -113,7 +113,7 @@ class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
explicit ScriptExecutionCallback( explicit ScriptExecutionCallback(
electron::util::Promise<v8::Local<v8::Value>> promise) electron::util::Promise<v8::Local<v8::Value>> promise)
: promise_(std::move(promise)) {} : promise_(std::move(promise)) {}
~ScriptExecutionCallback() override {} ~ScriptExecutionCallback() override = default;
void Completed( void Completed(
const blink::WebVector<v8::Local<v8::Value>>& result) override { const blink::WebVector<v8::Local<v8::Value>>& result) override {

View file

@ -125,7 +125,7 @@ AtomSandboxedRendererClient::AtomSandboxedRendererClient() {
metrics_ = base::ProcessMetrics::CreateCurrentProcessMetrics(); metrics_ = base::ProcessMetrics::CreateCurrentProcessMetrics();
} }
AtomSandboxedRendererClient::~AtomSandboxedRendererClient() {} AtomSandboxedRendererClient::~AtomSandboxedRendererClient() = default;
void AtomSandboxedRendererClient::InitializeBindings( void AtomSandboxedRendererClient::InitializeBindings(
v8::Local<v8::Object> binding, v8::Local<v8::Object> binding,

View file

@ -17,7 +17,7 @@ ContentSettingsObserver::ContentSettingsObserver(
render_frame->GetWebFrame()->SetContentSettingsClient(this); render_frame->GetWebFrame()->SetContentSettingsClient(this);
} }
ContentSettingsObserver::~ContentSettingsObserver() {} ContentSettingsObserver::~ContentSettingsObserver() = default;
bool ContentSettingsObserver::AllowDatabase() { bool ContentSettingsObserver::AllowDatabase() {
blink::WebFrame* frame = render_frame()->GetWebFrame(); blink::WebFrame* frame = render_frame()->GetWebFrame();

View file

@ -106,7 +106,7 @@ RendererClientBase::RendererClientBase() {
command_line->GetSwitchValueASCII(::switches::kRendererClientId); command_line->GetSwitchValueASCII(::switches::kRendererClientId);
} }
RendererClientBase::~RendererClientBase() {} RendererClientBase::~RendererClientBase() = default;
void RendererClientBase::DidCreateScriptContext( void RendererClientBase::DidCreateScriptContext(
v8::Handle<v8::Context> context, v8::Handle<v8::Context> context,
@ -200,8 +200,8 @@ void RendererClientBase::RenderThreadStarted() {
blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file"); blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file");
blink::SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI("file"); blink::SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI("file");
prescient_networking_dispatcher_.reset( prescient_networking_dispatcher_ =
new network_hints::PrescientNetworkingDispatcher()); std::make_unique<network_hints::PrescientNetworkingDispatcher>();
#if defined(OS_WIN) #if defined(OS_WIN)
// Set ApplicationUserModelID in renderer process. // Set ApplicationUserModelID in renderer process.

View file

@ -67,7 +67,7 @@ AtomContentUtilityClient::AtomContentUtilityClient() : elevated_(false) {
#endif #endif
} }
AtomContentUtilityClient::~AtomContentUtilityClient() {} AtomContentUtilityClient::~AtomContentUtilityClient() = default;
// The guts of this came from the chromium implementation // The guts of this came from the chromium implementation
// https://cs.chromium.org/chromium/src/chrome/utility/ // https://cs.chromium.org/chromium/src/chrome/utility/