[chromium-style] auto variable type must not deduce to a raw pointer type

This commit is contained in:
Jeremy Apthorp 2018-04-17 15:41:47 -07:00
parent 667c43398c
commit a635f078c6
61 changed files with 189 additions and 188 deletions

View file

@ -135,7 +135,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec, void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
const char* separator, const char* separator,
const char* cmd_switch) { const char* cmd_switch) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
auto string_with_separator = command_line->GetSwitchValueASCII(cmd_switch); auto string_with_separator = command_line->GetSwitchValueASCII(cmd_switch);
if (!string_with_separator.empty()) if (!string_with_separator.empty())
*vec = base::SplitString(string_with_separator, separator, *vec = base::SplitString(string_with_separator, separator,
@ -146,7 +146,7 @@ void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
void AddPepperFlashFromCommandLine( void AddPepperFlashFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) { std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath flash_path = base::FilePath flash_path =
command_line->GetSwitchValuePath(switches::kPpapiFlashPath); command_line->GetSwitchValuePath(switches::kPpapiFlashPath);
if (flash_path.empty()) if (flash_path.empty())
@ -161,7 +161,7 @@ void AddPepperFlashFromCommandLine(
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
void AddWidevineCdmFromCommandLine( void AddWidevineCdmFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) { std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath widevine_cdm_path = base::FilePath widevine_cdm_path =
command_line->GetSwitchValuePath(switches::kWidevineCdmPath); command_line->GetSwitchValuePath(switches::kWidevineCdmPath);
if (widevine_cdm_path.empty()) if (widevine_cdm_path.empty())

View file

@ -39,7 +39,7 @@
namespace { namespace {
#ifdef ENABLE_RUN_AS_NODE #ifdef ENABLE_RUN_AS_NODE
const auto kRunAsNode = "ELECTRON_RUN_AS_NODE"; const char kRunAsNode[] = "ELECTRON_RUN_AS_NODE";
#endif #endif
#if defined(ENABLE_RUN_AS_NODE) || defined(OS_WIN) #if defined(ENABLE_RUN_AS_NODE) || defined(OS_WIN)

View file

@ -61,7 +61,7 @@ AtomMainDelegate::AtomMainDelegate() {}
AtomMainDelegate::~AtomMainDelegate() {} AtomMainDelegate::~AtomMainDelegate() {}
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
logging::LoggingSettings settings; logging::LoggingSettings settings;
#if defined(OS_WIN) #if defined(OS_WIN)
@ -129,7 +129,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
void AtomMainDelegate::PreSandboxStartup() { void AtomMainDelegate::PreSandboxStartup() {
brightray::MainDelegate::PreSandboxStartup(); brightray::MainDelegate::PreSandboxStartup();
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = std::string process_type =
command_line->GetSwitchValueASCII(::switches::kProcessType); command_line->GetSwitchValueASCII(::switches::kProcessType);

View file

@ -17,7 +17,7 @@ bool IsUrlArg(const base::CommandLine::CharType* arg) {
// the first character must be a letter for this to be a URL // the first character must be a letter for this to be a URL
auto c = *arg; auto c = *arg;
if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) { if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) {
for (auto p = arg + 1; *p; ++p) { for (auto* p = arg + 1; *p; ++p) {
c = *p; c = *p;
// colon indicates that the argument starts with a URI scheme // colon indicates that the argument starts with a URI scheme
@ -1377,7 +1377,7 @@ bool IsBlacklistedArg(const base::CommandLine::CharType* arg) {
static const char* prefixes[] = {"--", "-", "/"}; static const char* prefixes[] = {"--", "-", "/"};
int prefix_length = 0; int prefix_length = 0;
for (auto& prefix : prefixes) { for (auto*& prefix : prefixes) {
if (base::StartsWith(a, prefix, base::CompareCase::SENSITIVE)) { if (base::StartsWith(a, prefix, base::CompareCase::SENSITIVE)) {
prefix_length = strlen(prefix); prefix_length = strlen(prefix);
break; break;

View file

@ -927,12 +927,12 @@ void App::DisableDomainBlockingFor3DAPIs(mate::Arguments* args) {
} }
bool App::IsAccessibilitySupportEnabled() { bool App::IsAccessibilitySupportEnabled() {
auto ax_state = content::BrowserAccessibilityState::GetInstance(); auto* ax_state = content::BrowserAccessibilityState::GetInstance();
return ax_state->IsAccessibleBrowser(); return ax_state->IsAccessibleBrowser();
} }
void App::SetAccessibilitySupportEnabled(bool enabled) { void App::SetAccessibilitySupportEnabled(bool enabled) {
auto ax_state = content::BrowserAccessibilityState::GetInstance(); auto* ax_state = content::BrowserAccessibilityState::GetInstance();
if (enabled) { if (enabled) {
ax_state->OnScreenReaderDetected(); ax_state->OnScreenReaderDetected();
} else { } else {
@ -1054,7 +1054,7 @@ void App::GetFileIcon(const base::FilePath& path, mate::Arguments* args) {
return; return;
} }
auto icon_manager = g_browser_process->GetIconManager(); auto* icon_manager = g_browser_process->GetIconManager();
gfx::Image* icon = gfx::Image* icon =
icon_manager->LookupIconFromFilepath(normalized_path, icon_size); icon_manager->LookupIconFromFilepath(normalized_path, icon_size);
if (icon) { if (icon) {
@ -1132,7 +1132,7 @@ void App::EnableMixedSandbox(mate::Arguments* args) {
return; return;
} }
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(::switches::kNoSandbox)) { if (command_line->HasSwitch(::switches::kNoSandbox)) {
#if defined(OS_WIN) #if defined(OS_WIN)
const base::CommandLine::CharType* noSandboxArg = L"--no-sandbox"; const base::CommandLine::CharType* noSandboxArg = L"--no-sandbox";
@ -1263,7 +1263,7 @@ void App::BuildPrototype(v8::Isolate* isolate,
namespace { namespace {
void AppendSwitch(const std::string& switch_string, mate::Arguments* args) { void AppendSwitch(const std::string& switch_string, mate::Arguments* args) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
if (base::EndsWith(switch_string, "-path", if (base::EndsWith(switch_string, "-path",
base::CompareCase::INSENSITIVE_ASCII) || base::CompareCase::INSENSITIVE_ASCII) ||
@ -1301,7 +1301,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
void* priv) { void* priv) {
v8::Isolate* isolate = context->GetIsolate(); v8::Isolate* isolate = context->GetIsolate();
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
mate::Dictionary dict(isolate, exports); mate::Dictionary dict(isolate, exports);
dict.Set("App", atom::api::App::GetConstructor(isolate)->GetFunction()); dict.Set("App", atom::api::App::GetConstructor(isolate)->GetFunction());

View file

@ -135,7 +135,7 @@ void BrowserWindow::DidFirstVisuallyNonEmptyPaint() {
// When there is a non-empty first paint, resize the RenderWidget to force // When there is a non-empty first paint, resize the RenderWidget to force
// Chromium to draw. // Chromium to draw.
const auto view = web_contents()->GetRenderWidgetHostView(); auto* const view = web_contents()->GetRenderWidgetHostView();
view->Show(); view->Show();
view->SetSize(window()->GetContentSize()); view->SetSize(window()->GetContentSize());
@ -408,7 +408,7 @@ void BrowserWindow::BuildPrototype(v8::Isolate* isolate,
// static // static
v8::Local<v8::Value> BrowserWindow::From(v8::Isolate* isolate, v8::Local<v8::Value> BrowserWindow::From(v8::Isolate* isolate,
NativeWindow* native_window) { NativeWindow* native_window) {
auto existing = TrackableObject::FromWrappedClass(isolate, native_window); auto* existing = TrackableObject::FromWrappedClass(isolate, native_window);
if (existing) if (existing)
return existing->GetWrapper(); return existing->GetWrapper();
else else

View file

@ -250,7 +250,7 @@ Cookies::~Cookies() {}
void Cookies::Get(const base::DictionaryValue& filter, void Cookies::Get(const base::DictionaryValue& filter,
const GetCallback& callback) { const GetCallback& callback) {
std::unique_ptr<base::DictionaryValue> copied(filter.CreateDeepCopy()); std::unique_ptr<base::DictionaryValue> copied(filter.CreateDeepCopy());
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::BindOnce(GetCookiesOnIO, base::RetainedRef(getter), Passed(&copied), base::BindOnce(GetCookiesOnIO, base::RetainedRef(getter), Passed(&copied),
@ -260,7 +260,7 @@ void Cookies::Get(const base::DictionaryValue& filter,
void Cookies::Remove(const GURL& url, void Cookies::Remove(const GURL& url,
const std::string& name, const std::string& name,
const base::Closure& callback) { const base::Closure& callback) {
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::BindOnce(RemoveCookieOnIOThread, base::RetainedRef(getter), url, base::BindOnce(RemoveCookieOnIOThread, base::RetainedRef(getter), url,
@ -270,7 +270,7 @@ void Cookies::Remove(const GURL& url,
void Cookies::Set(const base::DictionaryValue& details, void Cookies::Set(const base::DictionaryValue& details,
const SetCallback& callback) { const SetCallback& callback) {
std::unique_ptr<base::DictionaryValue> copied(details.CreateDeepCopy()); std::unique_ptr<base::DictionaryValue> copied(details.CreateDeepCopy());
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::BindOnce(SetCookieOnIO, base::RetainedRef(getter), Passed(&copied), base::BindOnce(SetCookieOnIO, base::RetainedRef(getter), Passed(&copied),
@ -278,7 +278,7 @@ void Cookies::Set(const base::DictionaryValue& details,
} }
void Cookies::FlushStore(const base::Closure& callback) { void Cookies::FlushStore(const base::Closure& callback) {
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::BindOnce(FlushCookieStoreOnIOThread, base::RetainedRef(getter), base::BindOnce(FlushCookieStoreOnIOThread, base::RetainedRef(getter),

View file

@ -207,7 +207,7 @@ void DownloadItem::BuildPrototype(v8::Isolate* isolate,
// static // static
mate::Handle<DownloadItem> DownloadItem::Create(v8::Isolate* isolate, mate::Handle<DownloadItem> DownloadItem::Create(v8::Isolate* isolate,
content::DownloadItem* item) { content::DownloadItem* item) {
auto existing = TrackableObject::FromWrappedClass(isolate, item); auto* existing = TrackableObject::FromWrappedClass(isolate, item);
if (existing) if (existing)
return mate::CreateHandle(isolate, static_cast<DownloadItem*>(existing)); return mate::CreateHandle(isolate, static_cast<DownloadItem*>(existing));

View file

@ -83,7 +83,7 @@ void Protocol::UnregisterProtocol(const std::string& scheme,
mate::Arguments* args) { mate::Arguments* args) {
CompletionCallback callback; CompletionCallback callback;
args->GetNext(&callback); args->GetNext(&callback);
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult( content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&Protocol::UnregisterProtocolInIO, base::BindOnce(&Protocol::UnregisterProtocolInIO,
@ -95,7 +95,7 @@ void Protocol::UnregisterProtocol(const std::string& scheme,
Protocol::ProtocolError Protocol::UnregisterProtocolInIO( Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter, scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme) { const std::string& scheme) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>( auto* job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory()); request_context_getter->job_factory());
if (!job_factory->HasProtocolHandler(scheme)) if (!job_factory->HasProtocolHandler(scheme))
return PROTOCOL_NOT_REGISTERED; return PROTOCOL_NOT_REGISTERED;
@ -105,7 +105,7 @@ Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
void Protocol::IsProtocolHandled(const std::string& scheme, void Protocol::IsProtocolHandled(const std::string& scheme,
const BooleanCallback& callback) { const BooleanCallback& callback) {
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult( content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::IsProtocolHandledInIO, base::RetainedRef(getter), base::Bind(&Protocol::IsProtocolHandledInIO, base::RetainedRef(getter),
@ -124,7 +124,7 @@ void Protocol::UninterceptProtocol(const std::string& scheme,
mate::Arguments* args) { mate::Arguments* args) {
CompletionCallback callback; CompletionCallback callback;
args->GetNext(&callback); args->GetNext(&callback);
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult( content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&Protocol::UninterceptProtocolInIO, base::BindOnce(&Protocol::UninterceptProtocolInIO,

View file

@ -100,7 +100,7 @@ class Protocol : public mate::TrackableObject<Protocol> {
mate::Arguments* args) { mate::Arguments* args) {
CompletionCallback callback; CompletionCallback callback;
args->GetNext(&callback); args->GetNext(&callback);
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult( content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&Protocol::RegisterProtocolInIO<RequestJob>, base::BindOnce(&Protocol::RegisterProtocolInIO<RequestJob>,
@ -113,7 +113,7 @@ class Protocol : public mate::TrackableObject<Protocol> {
v8::Isolate* isolate, v8::Isolate* isolate,
const std::string& scheme, const std::string& scheme,
const Handler& handler) { const Handler& handler) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>( auto* job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory()); request_context_getter->job_factory());
if (job_factory->IsHandledProtocol(scheme)) if (job_factory->IsHandledProtocol(scheme))
return PROTOCOL_REGISTERED; return PROTOCOL_REGISTERED;
@ -146,7 +146,7 @@ class Protocol : public mate::TrackableObject<Protocol> {
mate::Arguments* args) { mate::Arguments* args) {
CompletionCallback callback; CompletionCallback callback;
args->GetNext(&callback); args->GetNext(&callback);
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult( content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&Protocol::InterceptProtocolInIO<RequestJob>, base::BindOnce(&Protocol::InterceptProtocolInIO<RequestJob>,
@ -159,7 +159,7 @@ class Protocol : public mate::TrackableObject<Protocol> {
v8::Isolate* isolate, v8::Isolate* isolate,
const std::string& scheme, const std::string& scheme,
const Handler& handler) { const Handler& handler) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>( auto* job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory()); request_context_getter->job_factory());
if (!job_factory->IsHandledProtocol(scheme)) if (!job_factory->IsHandledProtocol(scheme))
return PROTOCOL_NOT_REGISTERED; return PROTOCOL_NOT_REGISTERED;

View file

@ -326,14 +326,14 @@ void DoCacheActionInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter, const scoped_refptr<net::URLRequestContextGetter>& context_getter,
Session::CacheAction action, Session::CacheAction action,
const net::CompletionCallback& callback) { const net::CompletionCallback& callback) {
auto request_context = context_getter->GetURLRequestContext(); auto* request_context = context_getter->GetURLRequestContext();
auto http_cache = request_context->http_transaction_factory()->GetCache(); auto* http_cache = request_context->http_transaction_factory()->GetCache();
if (!http_cache) if (!http_cache)
RunCallbackInUI<int>(callback, net::ERR_FAILED); RunCallbackInUI<int>(callback, net::ERR_FAILED);
// Call GetBackend and make the backend's ptr accessable in OnGetBackend. // Call GetBackend and make the backend's ptr accessable in OnGetBackend.
using BackendPtr = disk_cache::Backend*; using BackendPtr = disk_cache::Backend*;
auto* backend_ptr = new BackendPtr(nullptr); auto** backend_ptr = new BackendPtr(nullptr);
net::CompletionCallback on_get_backend = net::CompletionCallback on_get_backend =
base::Bind(&OnGetBackend, base::Owned(backend_ptr), action, callback); base::Bind(&OnGetBackend, base::Owned(backend_ptr), action, callback);
int rv = http_cache->GetBackend(backend_ptr, on_get_backend); int rv = http_cache->GetBackend(backend_ptr, on_get_backend);
@ -344,7 +344,7 @@ void DoCacheActionInIO(
void SetProxyInIO(scoped_refptr<net::URLRequestContextGetter> getter, void SetProxyInIO(scoped_refptr<net::URLRequestContextGetter> getter,
const net::ProxyConfig& config, const net::ProxyConfig& config,
const base::Closure& callback) { const base::Closure& callback) {
auto proxy_service = getter->GetURLRequestContext()->proxy_service(); auto* proxy_service = getter->GetURLRequestContext()->proxy_service();
proxy_service->ResetConfigService( proxy_service->ResetConfigService(
base::WrapUnique(new net::ProxyConfigServiceFixed(config))); base::WrapUnique(new net::ProxyConfigServiceFixed(config)));
// Refetches and applies the new pac script if provided. // Refetches and applies the new pac script if provided.
@ -355,7 +355,7 @@ void SetProxyInIO(scoped_refptr<net::URLRequestContextGetter> getter,
void SetCertVerifyProcInIO( void SetCertVerifyProcInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter, const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const AtomCertVerifier::VerifyProc& proc) { const AtomCertVerifier::VerifyProc& proc) {
auto request_context = context_getter->GetURLRequestContext(); auto* request_context = context_getter->GetURLRequestContext();
static_cast<AtomCertVerifier*>(request_context->cert_verifier()) static_cast<AtomCertVerifier*>(request_context->cert_verifier())
->SetVerifyProc(proc); ->SetVerifyProc(proc);
} }
@ -363,8 +363,8 @@ void SetCertVerifyProcInIO(
void ClearHostResolverCacheInIO( void ClearHostResolverCacheInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter, const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const base::Closure& callback) { const base::Closure& callback) {
auto request_context = context_getter->GetURLRequestContext(); auto* request_context = context_getter->GetURLRequestContext();
auto cache = request_context->host_resolver()->GetHostCache(); auto* cache = request_context->host_resolver()->GetHostCache();
if (cache) { if (cache) {
cache->clear(); cache->clear();
DCHECK_EQ(0u, cache->size()); DCHECK_EQ(0u, cache->size());
@ -377,12 +377,12 @@ void ClearAuthCacheInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter, const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const ClearAuthCacheOptions& options, const ClearAuthCacheOptions& options,
const base::Closure& callback) { const base::Closure& callback) {
auto request_context = context_getter->GetURLRequestContext(); auto* request_context = context_getter->GetURLRequestContext();
auto network_session = auto* network_session =
request_context->http_transaction_factory()->GetSession(); request_context->http_transaction_factory()->GetSession();
if (network_session) { if (network_session) {
if (options.type == "password") { if (options.type == "password") {
auto auth_cache = network_session->http_auth_cache(); auto* auth_cache = network_session->http_auth_cache();
if (!options.origin.is_empty()) { if (!options.origin.is_empty()) {
auth_cache->Remove( auth_cache->Remove(
options.origin, options.realm, options.auth_scheme, options.origin, options.realm, options.auth_scheme,
@ -391,7 +391,7 @@ void ClearAuthCacheInIO(
auth_cache->ClearEntriesAddedWithin(base::TimeDelta::Max()); auth_cache->ClearEntriesAddedWithin(base::TimeDelta::Max());
} }
} else if (options.type == "clientCertificate") { } else if (options.type == "clientCertificate") {
auto client_auth_cache = network_session->ssl_client_auth_cache(); auto* client_auth_cache = network_session->ssl_client_auth_cache();
client_auth_cache->Remove(net::HostPortPair::FromURL(options.origin)); client_auth_cache->Remove(net::HostPortPair::FromURL(options.origin));
} }
network_session->CloseAllConnections(); network_session->CloseAllConnections();
@ -403,10 +403,10 @@ void ClearAuthCacheInIO(
void AllowNTLMCredentialsForDomainsInIO( void AllowNTLMCredentialsForDomainsInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter, const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const std::string& domains) { const std::string& domains) {
auto request_context = context_getter->GetURLRequestContext(); auto* request_context = context_getter->GetURLRequestContext();
auto auth_handler = request_context->http_auth_handler_factory(); auto* auth_handler = request_context->http_auth_handler_factory();
if (auth_handler) { if (auth_handler) {
auto auth_preferences = const_cast<net::HttpAuthPreferences*>( auto* auth_preferences = const_cast<net::HttpAuthPreferences*>(
auth_handler->http_auth_preferences()); auth_handler->http_auth_preferences());
if (auth_preferences) if (auth_preferences)
auth_preferences->set_server_whitelist(domains); auth_preferences->set_server_whitelist(domains);
@ -453,7 +453,7 @@ void SetDevToolsNetworkEmulationClientIdInIO(
// Clear protocol handlers in IO thread. // Clear protocol handlers in IO thread.
void ClearJobFactoryInIO( void ClearJobFactoryInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter) { scoped_refptr<brightray::URLRequestContextGetter> request_context_getter) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>( auto* job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory()); request_context_getter->job_factory());
if (job_factory) if (job_factory)
job_factory->Clear(); job_factory->Clear();
@ -492,7 +492,7 @@ Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)
} }
Session::~Session() { Session::~Session() {
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::BindOnce(ClearJobFactoryInIO, base::RetainedRef(getter))); base::BindOnce(ClearJobFactoryInIO, base::RetainedRef(getter)));
@ -541,7 +541,7 @@ void Session::ClearStorageData(mate::Arguments* args) {
args->GetNext(&options); args->GetNext(&options);
args->GetNext(&callback); args->GetNext(&callback);
auto storage_partition = auto* storage_partition =
content::BrowserContext::GetStoragePartition(browser_context(), nullptr); content::BrowserContext::GetStoragePartition(browser_context(), nullptr);
if (options.storage_types & StoragePartition::REMOVE_DATA_MASK_COOKIES) { if (options.storage_types & StoragePartition::REMOVE_DATA_MASK_COOKIES) {
// Reset media device id salt when cookies are cleared. // Reset media device id salt when cookies are cleared.
@ -555,14 +555,14 @@ void Session::ClearStorageData(mate::Arguments* args) {
} }
void Session::FlushStorageData() { void Session::FlushStorageData() {
auto storage_partition = auto* storage_partition =
content::BrowserContext::GetStoragePartition(browser_context(), nullptr); content::BrowserContext::GetStoragePartition(browser_context(), nullptr);
storage_partition->Flush(); storage_partition->Flush();
} }
void Session::SetProxy(const net::ProxyConfig& config, void Session::SetProxy(const net::ProxyConfig& config,
const base::Closure& callback) { const base::Closure& callback) {
auto getter = browser_context_->GetRequestContext(); auto* getter = browser_context_->GetRequestContext();
BrowserThread::PostTask( BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::BindOnce(&SetProxyInIO, base::RetainedRef(getter), config, base::BindOnce(&SetProxyInIO, base::RetainedRef(getter), config,
@ -631,7 +631,7 @@ void Session::SetPermissionRequestHandler(v8::Local<v8::Value> val,
args->ThrowError("Must pass null or function"); args->ThrowError("Must pass null or function");
return; return;
} }
auto permission_manager = static_cast<AtomPermissionManager*>( auto* permission_manager = static_cast<AtomPermissionManager*>(
browser_context()->GetPermissionManager()); browser_context()->GetPermissionManager());
permission_manager->SetPermissionRequestHandler(handler); permission_manager->SetPermissionRequestHandler(handler);
} }
@ -725,7 +725,7 @@ void Session::CreateInterruptedDownload(const mate::Dictionary& options) {
isolate(), "Must pass an offset value less than length."))); isolate(), "Must pass an offset value less than length.")));
return; return;
} }
auto download_manager = auto* download_manager =
content::BrowserContext::GetDownloadManager(browser_context()); content::BrowserContext::GetDownloadManager(browser_context());
download_manager->GetDelegate()->GetNextId(base::Bind( download_manager->GetDelegate()->GetNextId(base::Bind(
&DownloadIdCallback, download_manager, path, url_chain, mime_type, offset, &DownloadIdCallback, download_manager, path, url_chain, mime_type, offset,
@ -772,7 +772,7 @@ v8::Local<v8::Value> Session::WebRequest(v8::Isolate* isolate) {
// static // static
mate::Handle<Session> Session::CreateFrom(v8::Isolate* isolate, mate::Handle<Session> Session::CreateFrom(v8::Isolate* isolate,
AtomBrowserContext* browser_context) { AtomBrowserContext* browser_context) {
auto existing = TrackableObject::FromWrappedClass(isolate, browser_context); auto* existing = TrackableObject::FromWrappedClass(isolate, browser_context);
if (existing) if (existing)
return mate::CreateHandle(isolate, static_cast<Session*>(existing)); return mate::CreateHandle(isolate, static_cast<Session*>(existing));

View file

@ -38,7 +38,7 @@ struct Converter<scoped_refptr<const net::IOBufferWithSize>> {
*out = nullptr; *out = nullptr;
return true; return true;
} }
auto data = node::Buffer::Data(val); auto* data = node::Buffer::Data(val);
if (!data) { if (!data) {
// This is an error as size is positive but data is null. // This is an error as size is positive but data is null.
return false; return false;
@ -138,7 +138,7 @@ URLRequest::~URLRequest() {
// static // static
mate::WrappableBase* URLRequest::New(mate::Arguments* args) { mate::WrappableBase* URLRequest::New(mate::Arguments* args) {
auto isolate = args->isolate(); auto* isolate = args->isolate();
v8::Local<v8::Object> options; v8::Local<v8::Object> options;
args->GetNext(&options); args->GetNext(&options);
mate::Dictionary dict(isolate, options); mate::Dictionary dict(isolate, options);
@ -157,8 +157,8 @@ mate::WrappableBase* URLRequest::New(mate::Arguments* args) {
// Use the default session if not specified. // Use the default session if not specified.
session = Session::FromPartition(isolate, ""); session = Session::FromPartition(isolate, "");
} }
auto browser_context = session->browser_context(); auto* browser_context = session->browser_context();
auto api_url_request = new URLRequest(args->isolate(), args->GetThis()); auto* api_url_request = new URLRequest(args->isolate(), args->GetThis());
auto atom_url_request = AtomURLRequest::Create( auto atom_url_request = AtomURLRequest::Create(
browser_context, method, url, redirect_policy, api_url_request); browser_context, method, url, redirect_policy, api_url_request);

View file

@ -275,12 +275,12 @@ namespace {
content::ServiceWorkerContext* GetServiceWorkerContext( content::ServiceWorkerContext* GetServiceWorkerContext(
const content::WebContents* web_contents) { const content::WebContents* web_contents) {
auto context = web_contents->GetBrowserContext(); auto* context = web_contents->GetBrowserContext();
auto site_instance = web_contents->GetSiteInstance(); auto* site_instance = web_contents->GetSiteInstance();
if (!context || !site_instance) if (!context || !site_instance)
return nullptr; return nullptr;
auto storage_partition = auto* storage_partition =
content::BrowserContext::GetStoragePartition(context, site_instance); content::BrowserContext::GetStoragePartition(context, site_instance);
if (!storage_partition) if (!storage_partition)
return nullptr; return nullptr;
@ -486,7 +486,7 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
NativeWindow* owner_window = nullptr; NativeWindow* owner_window = nullptr;
if (embedder_) { if (embedder_) {
// New WebContents's owner_window is the embedder's owner_window. // New WebContents's owner_window is the embedder's owner_window.
auto relay = auto* relay =
NativeWindowRelay::FromWebContents(embedder_->web_contents()); NativeWindowRelay::FromWebContents(embedder_->web_contents());
if (relay) if (relay)
owner_window = relay->window.get(); owner_window = relay->window.get();
@ -675,7 +675,7 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
void WebContents::EnterFullscreenModeForTab(content::WebContents* source, void WebContents::EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) { const GURL& origin) {
auto permission_helper = WebContentsPermissionHelper::FromWebContents(source); auto* permission_helper = WebContentsPermissionHelper::FromWebContents(source);
auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab, auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab,
base::Unretained(this), source, origin); base::Unretained(this), source, origin);
permission_helper->RequestFullscreenPermission(callback); permission_helper->RequestFullscreenPermission(callback);
@ -754,7 +754,7 @@ void WebContents::RequestMediaAccessPermission(
content::WebContents* web_contents, content::WebContents* web_contents,
const content::MediaStreamRequest& request, const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) { const content::MediaResponseCallback& callback) {
auto permission_helper = auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents); WebContentsPermissionHelper::FromWebContents(web_contents);
permission_helper->RequestMediaAccessPermission(request, callback); permission_helper->RequestMediaAccessPermission(request, callback);
} }
@ -762,7 +762,7 @@ void WebContents::RequestMediaAccessPermission(
void WebContents::RequestToLockMouse(content::WebContents* web_contents, void WebContents::RequestToLockMouse(content::WebContents* web_contents,
bool user_gesture, bool user_gesture,
bool last_unlocked_by_target) { bool last_unlocked_by_target) {
auto permission_helper = auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents); WebContentsPermissionHelper::FromWebContents(web_contents);
permission_helper->RequestPointerLockPermission(user_gesture); permission_helper->RequestPointerLockPermission(user_gesture);
} }
@ -789,7 +789,7 @@ void WebContents::BeforeUnloadFired(const base::TimeTicks& proceed_time) {
} }
void WebContents::RenderViewCreated(content::RenderViewHost* render_view_host) { void WebContents::RenderViewCreated(content::RenderViewHost* render_view_host) {
const auto impl = content::RenderWidgetHostImpl::FromID( auto* const impl = content::RenderWidgetHostImpl::FromID(
render_view_host->GetProcess()->GetID(), render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID()); render_view_host->GetRoutingID());
if (impl) if (impl)
@ -807,7 +807,7 @@ void WebContents::RenderProcessGone(base::TerminationStatus status) {
void WebContents::PluginCrashed(const base::FilePath& plugin_path, void WebContents::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) { base::ProcessId plugin_pid) {
content::WebPluginInfo info; content::WebPluginInfo info;
auto plugin_service = content::PluginService::GetInstance(); auto* plugin_service = content::PluginService::GetInstance();
plugin_service->GetPluginInfoByPath(plugin_path, &info); plugin_service->GetPluginInfoByPath(plugin_path, &info);
Emit("plugin-crashed", info.name, info.version); Emit("plugin-crashed", info.name, info.version);
} }
@ -1129,7 +1129,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
// Set the background color of RenderWidgetHostView. // Set the background color of RenderWidgetHostView.
// We have to call it right after LoadURL because the RenderViewHost is only // We have to call it right after LoadURL because the RenderViewHost is only
// created after loading a page. // created after loading a page.
const auto view = web_contents()->GetRenderWidgetHostView(); auto* const view = web_contents()->GetRenderWidgetHostView();
if (view) { if (view) {
auto* web_preferences = WebContentsPreferences::From(web_contents()); auto* web_preferences = WebContentsPreferences::From(web_contents());
std::string color_name; std::string color_name;
@ -1143,8 +1143,8 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
} }
void WebContents::DownloadURL(const GURL& url) { void WebContents::DownloadURL(const GURL& url) {
auto browser_context = web_contents()->GetBrowserContext(); auto* browser_context = web_contents()->GetBrowserContext();
auto download_manager = auto* download_manager =
content::BrowserContext::GetDownloadManager(browser_context); content::BrowserContext::GetDownloadManager(browser_context);
download_manager->DownloadUrl( download_manager->DownloadUrl(
@ -1223,7 +1223,7 @@ std::string WebContents::GetUserAgent() {
bool WebContents::SavePage(const base::FilePath& full_file_path, bool WebContents::SavePage(const base::FilePath& full_file_path,
const content::SavePageType& save_type, const content::SavePageType& save_type,
const SavePageHandler::SavePageCallback& callback) { const SavePageHandler::SavePageCallback& callback) {
auto handler = new SavePageHandler(web_contents(), callback); auto* handler = new SavePageHandler(web_contents(), callback);
return handler->Handle(full_file_path, save_type); return handler->Handle(full_file_path, save_type);
} }
@ -1280,9 +1280,9 @@ void WebContents::EnableDeviceEmulation(
if (type_ == REMOTE) if (type_ == REMOTE)
return; return;
auto frame_host = web_contents()->GetMainFrame(); auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) { if (frame_host) {
auto widget_host = auto* widget_host =
frame_host ? frame_host->GetView()->GetRenderWidgetHost() : nullptr; frame_host ? frame_host->GetView()->GetRenderWidgetHost() : nullptr;
if (!widget_host) if (!widget_host)
return; return;
@ -1295,9 +1295,9 @@ void WebContents::DisableDeviceEmulation() {
if (type_ == REMOTE) if (type_ == REMOTE)
return; return;
auto frame_host = web_contents()->GetMainFrame(); auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) { if (frame_host) {
auto widget_host = auto* widget_host =
frame_host ? frame_host->GetView()->GetRenderWidgetHost() : nullptr; frame_host ? frame_host->GetView()->GetRenderWidgetHost() : nullptr;
if (!widget_host) if (!widget_host)
return; return;
@ -1343,7 +1343,7 @@ void WebContents::InspectServiceWorker() {
} }
void WebContents::HasServiceWorker(const base::Callback<void(bool)>& callback) { void WebContents::HasServiceWorker(const base::Callback<void(bool)>& callback) {
auto context = GetServiceWorkerContext(web_contents()); auto* context = GetServiceWorkerContext(web_contents());
if (!context) if (!context)
return; return;
@ -1358,7 +1358,7 @@ void WebContents::HasServiceWorker(const base::Callback<void(bool)>& callback) {
} }
}; };
auto wrapped_callback = new WrappedCallback(callback); auto* wrapped_callback = new WrappedCallback(callback);
context->CheckHasServiceWorker( context->CheckHasServiceWorker(
web_contents()->GetLastCommittedURL(), GURL::EmptyGURL(), web_contents()->GetLastCommittedURL(), GURL::EmptyGURL(),
@ -1367,7 +1367,7 @@ void WebContents::HasServiceWorker(const base::Callback<void(bool)>& callback) {
void WebContents::UnregisterServiceWorker( void WebContents::UnregisterServiceWorker(
const base::Callback<void(bool)>& callback) { const base::Callback<void(bool)>& callback) {
auto context = GetServiceWorkerContext(web_contents()); auto* context = GetServiceWorkerContext(web_contents());
if (!context) if (!context)
return; return;
@ -1393,7 +1393,7 @@ void WebContents::Print(mate::Arguments* args) {
args->ThrowError(); args->ThrowError();
return; return;
} }
auto print_view_manager_basic_ptr = auto* print_view_manager_basic_ptr =
printing::PrintViewManagerBasic::FromWebContents(web_contents()); printing::PrintViewManagerBasic::FromWebContents(web_contents());
if (args->Length() == 2) { if (args->Length() == 2) {
base::Callback<void(bool)> callback; base::Callback<void(bool)> callback;
@ -1505,14 +1505,14 @@ void WebContents::StopFindInPage(content::StopFindAction action) {
void WebContents::ShowDefinitionForSelection() { void WebContents::ShowDefinitionForSelection() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
const auto view = web_contents()->GetRenderWidgetHostView(); auto* const view = web_contents()->GetRenderWidgetHostView();
if (view) if (view)
view->ShowDefinitionForSelection(); view->ShowDefinitionForSelection();
#endif #endif
} }
void WebContents::CopyImageAt(int x, int y) { void WebContents::CopyImageAt(int x, int y) {
const auto host = web_contents()->GetMainFrame(); auto* const host = web_contents()->GetMainFrame();
if (host) if (host)
host->CopyImageAt(x, y); host->CopyImageAt(x, y);
} }
@ -1544,7 +1544,7 @@ void WebContents::TabTraverse(bool reverse) {
bool WebContents::SendIPCMessage(bool all_frames, bool WebContents::SendIPCMessage(bool all_frames,
const base::string16& channel, const base::string16& channel,
const base::ListValue& args) { const base::ListValue& args) {
auto frame_host = web_contents()->GetMainFrame(); auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) { if (frame_host) {
return frame_host->Send(new AtomFrameMsg_Message( return frame_host->Send(new AtomFrameMsg_Message(
frame_host->GetRoutingID(), all_frames, channel, args)); frame_host->GetRoutingID(), all_frames, channel, args));
@ -1554,7 +1554,7 @@ bool WebContents::SendIPCMessage(bool all_frames,
void WebContents::SendInputEvent(v8::Isolate* isolate, void WebContents::SendInputEvent(v8::Isolate* isolate,
v8::Local<v8::Value> input_event) { v8::Local<v8::Value> input_event) {
const auto view = static_cast<content::RenderWidgetHostViewBase*>( auto* const view = static_cast<content::RenderWidgetHostViewBase*>(
web_contents()->GetRenderWidgetHostView()); web_contents()->GetRenderWidgetHostView());
if (!view) if (!view)
return; return;
@ -1597,7 +1597,7 @@ void WebContents::BeginFrameSubscription(mate::Arguments* args) {
return; return;
} }
const auto view = web_contents()->GetRenderWidgetHostView(); auto* const view = web_contents()->GetRenderWidgetHostView();
if (view) { if (view) {
std::unique_ptr<FrameSubscriber> frame_subscriber( std::unique_ptr<FrameSubscriber> frame_subscriber(
new FrameSubscriber(isolate(), view, callback, only_dirty)); new FrameSubscriber(isolate(), view, callback, only_dirty));
@ -1606,7 +1606,7 @@ void WebContents::BeginFrameSubscription(mate::Arguments* args) {
} }
void WebContents::EndFrameSubscription() { void WebContents::EndFrameSubscription() {
const auto view = web_contents()->GetRenderWidgetHostView(); auto* const view = web_contents()->GetRenderWidgetHostView();
if (view) if (view)
view->EndFrameSubscription(); view->EndFrameSubscription();
} }
@ -1659,7 +1659,7 @@ void WebContents::CapturePage(mate::Arguments* args) {
return; return;
} }
const auto view = web_contents()->GetRenderWidgetHostView(); auto* const view = web_contents()->GetRenderWidgetHostView();
if (!view) { if (!view) {
callback.Run(gfx::Image()); callback.Run(gfx::Image());
return; return;
@ -1787,7 +1787,7 @@ void WebContents::Invalidate() {
osr_rwhv->Invalidate(); osr_rwhv->Invalidate();
#endif #endif
} else { } else {
const auto window = owner_window(); auto* const window = owner_window();
if (window) if (window)
window->Invalidate(); window->Invalidate();
} }
@ -1795,7 +1795,7 @@ void WebContents::Invalidate() {
gfx::Size WebContents::GetSizeForNewRenderView(content::WebContents* wc) const { gfx::Size WebContents::GetSizeForNewRenderView(content::WebContents* wc) const {
if (IsOffScreen() && wc == web_contents()) { if (IsOffScreen() && wc == web_contents()) {
auto relay = NativeWindowRelay::FromWebContents(web_contents()); auto* relay = NativeWindowRelay::FromWebContents(web_contents());
if (relay) { if (relay) {
return relay->window->GetSize(); return relay->window->GetSize();
} }
@ -1877,7 +1877,7 @@ content::WebContents* WebContents::HostWebContents() {
void WebContents::SetEmbedder(const WebContents* embedder) { void WebContents::SetEmbedder(const WebContents* embedder) {
if (embedder) { if (embedder) {
NativeWindow* owner_window = nullptr; NativeWindow* owner_window = nullptr;
auto relay = NativeWindowRelay::FromWebContents(embedder->web_contents()); auto* relay = NativeWindowRelay::FromWebContents(embedder->web_contents());
if (relay) { if (relay) {
owner_window = relay->window.get(); owner_window = relay->window.get();
} }
@ -2054,7 +2054,7 @@ mate::Handle<WebContents> WebContents::CreateFrom(
v8::Isolate* isolate, v8::Isolate* isolate,
content::WebContents* web_contents) { content::WebContents* web_contents) {
// We have an existing WebContents object in JS. // We have an existing WebContents object in JS.
auto existing = TrackableObject::FromWrappedClass(isolate, web_contents); auto* existing = TrackableObject::FromWrappedClass(isolate, web_contents);
if (existing) if (existing)
return mate::CreateHandle(isolate, static_cast<WebContents*>(existing)); return mate::CreateHandle(isolate, static_cast<WebContents*>(existing));

View file

@ -11,7 +11,7 @@ namespace atom {
namespace api { namespace api {
bool WebContents::IsFocused() const { bool WebContents::IsFocused() const {
auto view = web_contents()->GetRenderWidgetHostView(); auto* view = web_contents()->GetRenderWidgetHostView();
if (!view) return false; if (!view) return false;
if (GetType() != BACKGROUND_PAGE) { if (GetType() != BACKGROUND_PAGE) {

View file

@ -23,7 +23,7 @@ void AddGuest(int guest_instance_id,
content::WebContents* embedder, content::WebContents* embedder,
content::WebContents* guest_web_contents, content::WebContents* guest_web_contents,
const base::DictionaryValue& options) { const base::DictionaryValue& options) {
auto manager = atom::WebViewManager::GetWebViewManager(embedder); auto* manager = atom::WebViewManager::GetWebViewManager(embedder);
if (manager) if (manager)
manager->AddGuest(guest_instance_id, element_instance_id, embedder, manager->AddGuest(guest_instance_id, element_instance_id, embedder,
guest_web_contents); guest_web_contents);
@ -38,7 +38,7 @@ void AddGuest(int guest_instance_id,
} }
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) { void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
auto manager = atom::WebViewManager::GetWebViewManager(embedder); auto* manager = atom::WebViewManager::GetWebViewManager(embedder);
if (manager) if (manager)
manager->RemoveGuest(guest_instance_id); manager->RemoveGuest(guest_instance_id);
} }

View file

@ -75,7 +75,7 @@ void EventSubscriberBase::On(const std::string& event_name) {
v8::HandleScope handle_scope(isolate_); v8::HandleScope handle_scope(isolate_);
auto fn_template = g_cached_template.Get(isolate_); auto fn_template = g_cached_template.Get(isolate_);
auto event = mate::StringToV8(isolate_, event_name); auto event = mate::StringToV8(isolate_, event_name);
auto js_handler_data = new JSHandlerData(isolate_, this); auto* js_handler_data = new JSHandlerData(isolate_, this);
v8::Local<v8::Value> fn = internal::BindFunctionWith( v8::Local<v8::Value> fn = internal::BindFunctionWith(
isolate_, isolate_->GetCurrentContext(), fn_template->GetFunction(), isolate_, isolate_->GetCurrentContext(), fn_template->GetFunction(),
js_handler_data->handle_.Get(isolate_), event); js_handler_data->handle_.Get(isolate_), event);

View file

@ -87,8 +87,8 @@ void FrameSubscriber::OnFrameDelivered(const FrameCaptureCallback& callback,
auto local_buffer = buffer.ToLocalChecked(); auto local_buffer = buffer.ToLocalChecked();
{ {
auto source = static_cast<const unsigned char*>(bitmap.getPixels()); auto* source = static_cast<const unsigned char*>(bitmap.getPixels());
auto target = node::Buffer::Data(local_buffer); auto* target = node::Buffer::Data(local_buffer);
for (int y = 0; y < bitmap.height(); ++y) { for (int y = 0; y < bitmap.height(); ++y) {
memcpy(target, source, rgb_row_size); memcpy(target, source, rgb_row_size);

View file

@ -30,7 +30,7 @@ void SavePageHandler::OnDownloadCreated(content::DownloadManager* manager,
bool SavePageHandler::Handle(const base::FilePath& full_path, bool SavePageHandler::Handle(const base::FilePath& full_path,
const content::SavePageType& save_type) { const content::SavePageType& save_type) {
auto download_manager = content::BrowserContext::GetDownloadManager( auto* download_manager = content::BrowserContext::GetDownloadManager(
web_contents_->GetBrowserContext()); web_contents_->GetBrowserContext());
download_manager->AddObserver(this); download_manager->AddObserver(this);
// Chromium will create a 'foo_files' directory under the directory of saving // Chromium will create a 'foo_files' directory under the directory of saving

View file

@ -54,7 +54,8 @@ void TrackableObjectBase::AttachAsUserData(base::SupportsUserData* wrapped) {
int32_t TrackableObjectBase::GetIDFromWrappedClass( int32_t TrackableObjectBase::GetIDFromWrappedClass(
base::SupportsUserData* wrapped) { base::SupportsUserData* wrapped) {
if (wrapped) { if (wrapped) {
auto id = static_cast<IDUserData*>(wrapped->GetUserData(kTrackedObjectKey)); auto* id = static_cast<IDUserData*>(
wrapped->GetUserData(kTrackedObjectKey));
if (id) if (id)
return *id; return *id;
} }

View file

@ -120,7 +120,7 @@ bool AtomBrowserClient::ShouldCreateNewSiteInstance(
// a new SiteInstance // a new SiteInstance
return true; return true;
} }
auto web_contents = auto* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host); content::WebContents::FromRenderFrameHost(render_frame_host);
if (!ChildWebContentsTracker::IsChildWebContents(web_contents)) { if (!ChildWebContentsTracker::IsChildWebContents(web_contents)) {
// Root WebContents should always create new process to make sure // Root WebContents should always create new process to make sure
@ -252,7 +252,7 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
site_per_affinities[affinity] = candidate_instance; site_per_affinities[affinity] = candidate_instance;
*new_instance = candidate_instance; *new_instance = candidate_instance;
// Remember the original web contents for the pending renderer process. // Remember the original web contents for the pending renderer process.
auto pending_process = candidate_instance->GetProcess(); auto* pending_process = candidate_instance->GetProcess();
pending_processes_[pending_process->GetID()] = web_contents; pending_processes_[pending_process->GetID()] = web_contents;
} }
} else { } else {
@ -272,7 +272,7 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
*new_instance = candidate_instance; *new_instance = candidate_instance;
// Remember the original web contents for the pending renderer process. // Remember the original web contents for the pending renderer process.
auto pending_process = candidate_instance->GetProcess(); auto* pending_process = candidate_instance->GetProcess();
pending_processes_[pending_process->GetID()] = web_contents; pending_processes_[pending_process->GetID()] = web_contents;
} }
} }
@ -343,8 +343,8 @@ void AtomBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost* host) {
void AtomBrowserClient::GetGeolocationRequestContext( void AtomBrowserClient::GetGeolocationRequestContext(
base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)> base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)>
callback) { callback) {
auto io_thread = AtomBrowserMainParts::Get()->io_thread(); auto* io_thread = AtomBrowserMainParts::Get()->io_thread();
auto context = io_thread->GetRequestContext(); auto* context = io_thread->GetRequestContext();
base::ThreadTaskRunnerHandle::Get()->PostTask( base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(std::move(callback), base::RetainedRef(context))); base::BindOnce(std::move(callback), base::RetainedRef(context)));
@ -483,7 +483,7 @@ void AtomBrowserClient::WebNotificationAllowed(
callback.Run(false, false); callback.Run(false, false);
return; return;
} }
auto permission_helper = auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents); WebContentsPermissionHelper::FromWebContents(web_contents);
if (!permission_helper) { if (!permission_helper) {
callback.Run(false, false); callback.Run(false, false);

View file

@ -150,7 +150,7 @@ AtomBrowserContext::CreateURLRequestJobFactory(
url::kWssScheme, url::kWssScheme,
base::WrapUnique(new HttpProtocolHandler(url::kWssScheme))); base::WrapUnique(new HttpProtocolHandler(url::kWssScheme)));
auto host_resolver = auto* host_resolver =
url_request_context_getter()->GetURLRequestContext()->host_resolver(); url_request_context_getter()->GetURLRequestContext()->host_resolver();
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver)); url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver));
@ -171,7 +171,7 @@ AtomBrowserContext::CreateHttpCacheBackendFactory(
content::DownloadManagerDelegate* 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_.reset(
new AtomDownloadManagerDelegate(download_manager)); new AtomDownloadManagerDelegate(download_manager));
} }

View file

@ -78,13 +78,13 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
const base::FilePath& default_path) { const base::FilePath& default_path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
auto item = download_manager_->GetDownload(download_id); auto* item = download_manager_->GetDownload(download_id);
if (!item) if (!item)
return; return;
NativeWindow* window = nullptr; NativeWindow* window = nullptr;
content::WebContents* web_contents = item->GetWebContents(); content::WebContents* web_contents = item->GetWebContents();
auto relay = auto* relay =
web_contents ? NativeWindowRelay::FromWebContents(web_contents) : nullptr; web_contents ? NativeWindowRelay::FromWebContents(web_contents) : nullptr;
if (relay) if (relay)
window = relay->window.get(); window = relay->window.get();

View file

@ -76,7 +76,7 @@ void AtomPermissionManager::SetPermissionRequestHandler(
if (handler.is_null() && !pending_requests_.IsEmpty()) { if (handler.is_null() && !pending_requests_.IsEmpty()) {
for (PendingRequestsMap::const_iterator iter(&pending_requests_); for (PendingRequestsMap::const_iterator iter(&pending_requests_);
!iter.IsAtEnd(); iter.Advance()) { !iter.IsAtEnd(); iter.Advance()) {
auto request = iter.GetCurrentValue(); auto* request = iter.GetCurrentValue();
if (!WebContentsDestroyed(request->render_process_id())) if (!WebContentsDestroyed(request->render_process_id()))
request->RunCallback(); request->RunCallback();
} }
@ -146,7 +146,7 @@ int AtomPermissionManager::RequestPermissionsWithDetails(
return kNoPendingOperation; return kNoPendingOperation;
} }
auto web_contents = auto* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host); content::WebContents::FromRenderFrameHost(render_frame_host);
int request_id = pending_requests_.Add(std::make_unique<PendingRequest>( int request_id = pending_requests_.Add(std::make_unique<PendingRequest>(
render_frame_host, permissions, response_callback)); render_frame_host, permissions, response_callback));
@ -175,7 +175,7 @@ void AtomPermissionManager::OnPermissionResponse(
int request_id, int request_id,
int permission_id, int permission_id,
blink::mojom::PermissionStatus status) { blink::mojom::PermissionStatus status) {
auto pending_request = pending_requests_.Lookup(request_id); auto* pending_request = pending_requests_.Lookup(request_id);
if (!pending_request) if (!pending_request)
return; return;
@ -187,7 +187,7 @@ void AtomPermissionManager::OnPermissionResponse(
} }
void AtomPermissionManager::CancelPermissionRequest(int request_id) { void AtomPermissionManager::CancelPermissionRequest(int request_id) {
auto pending_request = pending_requests_.Lookup(request_id); auto* pending_request = pending_requests_.Lookup(request_id);
if (!pending_request) if (!pending_request)
return; return;

View file

@ -57,7 +57,7 @@ void HandleExternalProtocolInUI(
if (!web_contents) if (!web_contents)
return; return;
auto permission_helper = auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents); WebContentsPermissionHelper::FromWebContents(web_contents);
if (!permission_helper) if (!permission_helper)
return; return;

View file

@ -9,7 +9,7 @@
namespace atom { namespace atom {
void BridgeTaskRunner::MessageLoopIsReady() { void BridgeTaskRunner::MessageLoopIsReady() {
auto message_loop = base::MessageLoop::current(); auto* message_loop = base::MessageLoop::current();
CHECK(message_loop); CHECK(message_loop);
for (TaskPair& task : tasks_) { for (TaskPair& task : tasks_) {
message_loop->task_runner()->PostDelayedTask( message_loop->task_runner()->PostDelayedTask(
@ -24,7 +24,7 @@ void BridgeTaskRunner::MessageLoopIsReady() {
bool BridgeTaskRunner::PostDelayedTask(const base::Location& from_here, bool BridgeTaskRunner::PostDelayedTask(const base::Location& from_here,
base::OnceClosure task, base::OnceClosure task,
base::TimeDelta delay) { base::TimeDelta delay) {
auto message_loop = base::MessageLoop::current(); auto* message_loop = base::MessageLoop::current();
if (!message_loop) { if (!message_loop) {
tasks_.push_back(std::make_tuple(from_here, std::move(task), delay)); tasks_.push_back(std::make_tuple(from_here, std::move(task), delay));
return true; return true;
@ -35,7 +35,7 @@ bool BridgeTaskRunner::PostDelayedTask(const base::Location& from_here,
} }
bool BridgeTaskRunner::RunsTasksInCurrentSequence() const { bool BridgeTaskRunner::RunsTasksInCurrentSequence() const {
auto message_loop = base::MessageLoop::current(); auto* message_loop = base::MessageLoop::current();
if (!message_loop) if (!message_loop)
return true; return true;
@ -46,7 +46,7 @@ bool BridgeTaskRunner::PostNonNestableDelayedTask(
const base::Location& from_here, const base::Location& from_here,
base::OnceClosure task, base::OnceClosure task,
base::TimeDelta delay) { base::TimeDelta delay) {
auto message_loop = base::MessageLoop::current(); auto* message_loop = base::MessageLoop::current();
if (!message_loop) { if (!message_loop) {
non_nestable_tasks_.push_back( non_nestable_tasks_.push_back(
std::make_tuple(from_here, std::move(task), delay)); std::make_tuple(from_here, std::move(task), delay));

View file

@ -256,7 +256,7 @@ std::string Browser::DockGetBadgeText() {
} }
void Browser::DockHide() { void Browser::DockHide() {
for (const auto& window : WindowList::GetWindows()) for (auto* const& window : WindowList::GetWindows())
[window->GetNativeWindow() setCanHide:NO]; [window->GetNativeWindow() setCanHide:NO];
ProcessSerialNumber psn = { 0, kCurrentProcess }; ProcessSerialNumber psn = { 0, kCurrentProcess };

View file

@ -57,7 +57,7 @@ struct FileSystem {
std::string RegisterFileSystem(content::WebContents* web_contents, std::string RegisterFileSystem(content::WebContents* web_contents,
const base::FilePath& path) { const base::FilePath& path) {
auto isolated_context = storage::IsolatedContext::GetInstance(); auto* isolated_context = storage::IsolatedContext::GetInstance();
std::string root_name(kRootName); std::string root_name(kRootName);
std::string file_system_id = isolated_context->RegisterFileSystemForPath( std::string file_system_id = isolated_context->RegisterFileSystemForPath(
storage::kFileSystemTypeNativeLocal, std::string(), path, &root_name); storage::kFileSystemTypeNativeLocal, std::string(), path, &root_name);
@ -113,13 +113,13 @@ void AppendToFile(const base::FilePath& path, const std::string& content) {
} }
PrefService* GetPrefService(content::WebContents* web_contents) { PrefService* GetPrefService(content::WebContents* web_contents) {
auto context = web_contents->GetBrowserContext(); auto* context = web_contents->GetBrowserContext();
return static_cast<atom::AtomBrowserContext*>(context)->prefs(); return static_cast<atom::AtomBrowserContext*>(context)->prefs();
} }
std::set<std::string> GetAddedFileSystemPaths( std::set<std::string> GetAddedFileSystemPaths(
content::WebContents* web_contents) { content::WebContents* web_contents) {
auto pref_service = GetPrefService(web_contents); auto* pref_service = GetPrefService(web_contents);
const base::DictionaryValue* file_system_paths_value = const base::DictionaryValue* file_system_paths_value =
pref_service->GetDictionary(prefs::kDevToolsFileSystemPaths); pref_service->GetDictionary(prefs::kDevToolsFileSystemPaths);
std::set<std::string> result; std::set<std::string> result;
@ -176,7 +176,7 @@ void CommonWebContentsDelegate::SetOwnerWindow(
NativeWindow* owner_window) { NativeWindow* owner_window) {
owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr; owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr;
auto relay = std::make_unique<NativeWindowRelay>(owner_window_); auto relay = std::make_unique<NativeWindowRelay>(owner_window_);
auto relay_key = relay->key; auto* relay_key = relay->key;
if (owner_window) { if (owner_window) {
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS)
autofill_popup_.reset(new AutofillPopup()); autofill_popup_.reset(new AutofillPopup());
@ -383,7 +383,7 @@ void CommonWebContentsDelegate::DevToolsAddFileSystem(
std::unique_ptr<base::DictionaryValue> file_system_value( std::unique_ptr<base::DictionaryValue> file_system_value(
CreateFileSystemValue(file_system)); CreateFileSystemValue(file_system));
auto pref_service = GetPrefService(GetDevToolsWebContents()); auto* pref_service = GetPrefService(GetDevToolsWebContents());
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths); DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->SetWithoutPathExpansion(path.AsUTF8Unsafe(), update.Get()->SetWithoutPathExpansion(path.AsUTF8Unsafe(),
std::make_unique<base::Value>()); std::make_unique<base::Value>());
@ -401,7 +401,7 @@ void CommonWebContentsDelegate::DevToolsRemoveFileSystem(
storage::IsolatedContext::GetInstance()->RevokeFileSystemByPath( storage::IsolatedContext::GetInstance()->RevokeFileSystemByPath(
file_system_path); file_system_path);
auto pref_service = GetPrefService(GetDevToolsWebContents()); auto* pref_service = GetPrefService(GetDevToolsWebContents());
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths); DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->RemoveWithoutPathExpansion(path, nullptr); update.Get()->RemoveWithoutPathExpansion(path, nullptr);

View file

@ -38,7 +38,7 @@ void JavascriptEnvironment::OnMessageLoopDestroying() {
} }
bool JavascriptEnvironment::Initialize() { bool JavascriptEnvironment::Initialize() {
auto cmd = base::CommandLine::ForCurrentProcess(); auto* cmd = base::CommandLine::ForCurrentProcess();
// --js-flags. // --js-flags.
std::string js_flags = cmd->GetSwitchValueASCII(switches::kJavaScriptFlags); std::string js_flags = cmd->GetSwitchValueASCII(switches::kJavaScriptFlags);

View file

@ -165,7 +165,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
} }
- (void)updateAccessibilityEnabled:(BOOL)enabled { - (void)updateAccessibilityEnabled:(BOOL)enabled {
auto ax_state = content::BrowserAccessibilityState::GetInstance(); auto* ax_state = content::BrowserAccessibilityState::GetInstance();
if (enabled) { if (enabled) {
ax_state->OnScreenReaderDetected(); ax_state->OnScreenReaderDetected();

View file

@ -197,7 +197,7 @@ void ReadFromResponseObject(const base::DictionaryValue& response,
if (!response.GetString("statusLine", &status_line)) if (!response.GetString("statusLine", &status_line))
status_line = container.second; status_line = container.second;
if (response.GetDictionary("responseHeaders", &dict)) { if (response.GetDictionary("responseHeaders", &dict)) {
auto headers = container.first; auto* headers = container.first;
*headers = new net::HttpResponseHeaders(""); *headers = new net::HttpResponseHeaders("");
(*headers)->ReplaceStatusLine(status_line); (*headers)->ReplaceStatusLine(status_line);
for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd();

View file

@ -105,7 +105,7 @@ void AtomURLRequest::DoInitialize(
redirect_policy_ = redirect_policy; redirect_policy_ = redirect_policy;
request_context_getter_ = request_context_getter; request_context_getter_ = request_context_getter;
request_context_getter_->AddObserver(this); request_context_getter_->AddObserver(this);
auto context = request_context_getter_->GetURLRequestContext(); auto* context = request_context_getter_->GetURLRequestContext();
if (!context) { if (!context) {
// Called after shutdown. // Called after shutdown.
DoCancelWithError("Cannot start a request after shutdown.", true); DoCancelWithError("Cannot start a request after shutdown.", true);
@ -238,14 +238,14 @@ void AtomURLRequest::DoWriteBuffer(
if (buffer) { if (buffer) {
// Handling potential empty buffers. // Handling potential empty buffers.
using internal::UploadOwnedIOBufferElementReader; using internal::UploadOwnedIOBufferElementReader;
auto element_reader = auto* element_reader =
UploadOwnedIOBufferElementReader::CreateWithBuffer(std::move(buffer)); UploadOwnedIOBufferElementReader::CreateWithBuffer(std::move(buffer));
upload_element_readers_.push_back( upload_element_readers_.push_back(
std::unique_ptr<net::UploadElementReader>(element_reader)); std::unique_ptr<net::UploadElementReader>(element_reader));
} }
if (is_last) { if (is_last) {
auto elements_upload_data_stream = new net::ElementsUploadDataStream( auto* elements_upload_data_stream = new net::ElementsUploadDataStream(
std::move(upload_element_readers_), 0); std::move(upload_element_readers_), 0);
request_->set_upload( request_->set_upload(
std::unique_ptr<net::UploadDataStream>(elements_upload_data_stream)); std::unique_ptr<net::UploadDataStream>(elements_upload_data_stream));

View file

@ -18,7 +18,7 @@ NodeDebugger::NodeDebugger(node::Environment* env) : env_(env) {}
NodeDebugger::~NodeDebugger() {} NodeDebugger::~NodeDebugger() {}
void NodeDebugger::Start(node::MultiIsolatePlatform* platform) { void NodeDebugger::Start(node::MultiIsolatePlatform* platform) {
auto inspector = env_->inspector_agent(); auto* inspector = env_->inspector_agent();
if (inspector == nullptr) if (inspector == nullptr)
return; return;

View file

@ -74,7 +74,7 @@ void GenerateAcceleratorTable(AcceleratorTable* table,
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
atom::AtomMenuModel::ItemType type = model->GetTypeAt(i); atom::AtomMenuModel::ItemType type = model->GetTypeAt(i);
if (type == atom::AtomMenuModel::TYPE_SUBMENU) { if (type == atom::AtomMenuModel::TYPE_SUBMENU) {
auto submodel = model->GetSubmenuModelAt(i); auto* submodel = model->GetSubmenuModelAt(i);
GenerateAcceleratorTable(table, submodel); GenerateAcceleratorTable(table, submodel);
} else { } else {
ui::Accelerator accelerator; ui::Accelerator accelerator;

View file

@ -68,7 +68,7 @@
- (void)panelDidEnd:(NSWindow*)sheet - (void)panelDidEnd:(NSWindow*)sheet
returnCode:(int)returnCode returnCode:(int)returnCode
contextInfo:(void*)contextInfo { contextInfo:(void*)contextInfo {
auto cert_db = net::CertDatabase::GetInstance(); auto* cert_db = net::CertDatabase::GetInstance();
// This forces Chromium to reload the certificate since it might be trusted // This forces Chromium to reload the certificate since it might be trusted
// now. // now.
cert_db->NotifyObserversCertDBChanged(); cert_db->NotifyObserversCertDBChanged();
@ -86,7 +86,7 @@ void ShowCertificateTrust(atom::NativeWindow* parent_window,
const scoped_refptr<net::X509Certificate>& cert, const scoped_refptr<net::X509Certificate>& cert,
const std::string& message, const std::string& message,
const ShowTrustCallback& callback) { const ShowTrustCallback& callback) {
auto sec_policy = SecPolicyCreateBasicX509(); auto* sec_policy = SecPolicyCreateBasicX509();
auto cert_chain = auto cert_chain =
net::x509_util::CreateSecCertificateArrayForX509Certificate(cert.get()); net::x509_util::CreateSecCertificateArrayForX509Certificate(cert.get());
SecTrustRef trust = nullptr; SecTrustRef trust = nullptr;

View file

@ -54,8 +54,8 @@ void WebContentsPermissionHelper::RequestPermission(
const base::Callback<void(bool)>& callback, const base::Callback<void(bool)>& callback,
bool user_gesture, bool user_gesture,
const base::DictionaryValue* details) { const base::DictionaryValue* details) {
auto rfh = web_contents_->GetMainFrame(); auto* rfh = web_contents_->GetMainFrame();
auto permission_manager = static_cast<AtomPermissionManager*>( auto* permission_manager = static_cast<AtomPermissionManager*>(
web_contents_->GetBrowserContext()->GetPermissionManager()); web_contents_->GetBrowserContext()->GetPermissionManager());
auto origin = web_contents_->GetLastCommittedURL(); auto origin = web_contents_->GetLastCommittedURL();
permission_manager->RequestPermissionWithDetails( permission_manager->RequestPermissionWithDetails(

View file

@ -33,7 +33,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
FileSelectHelper(content::RenderFrameHost* render_frame_host, FileSelectHelper(content::RenderFrameHost* render_frame_host,
const content::FileChooserParams::Mode& mode) const content::FileChooserParams::Mode& mode)
: render_frame_host_(render_frame_host), mode_(mode) { : render_frame_host_(render_frame_host), mode_(mode) {
auto web_contents = auto* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host); content::WebContents::FromRenderFrameHost(render_frame_host);
content::WebContentsObserver::Observe(web_contents); content::WebContentsObserver::Observe(web_contents);
} }
@ -71,7 +71,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
} }
if (render_frame_host_ && !paths.empty()) { if (render_frame_host_ && !paths.empty()) {
auto browser_context = static_cast<atom::AtomBrowserContext*>( auto* browser_context = static_cast<atom::AtomBrowserContext*>(
render_frame_host_->GetProcess()->GetBrowserContext()); render_frame_host_->GetProcess()->GetBrowserContext());
browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory, browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory,
paths[0].DirName()); paths[0].DirName());

View file

@ -61,7 +61,7 @@ void WebViewGuestDelegate::SetSize(const SetSizeParams& params) {
enable_auto_size &= !min_auto_size_.IsEmpty() && !max_auto_size_.IsEmpty(); enable_auto_size &= !min_auto_size_.IsEmpty() && !max_auto_size_.IsEmpty();
auto rvh = web_contents()->GetRenderViewHost(); auto* rvh = web_contents()->GetRenderViewHost();
if (enable_auto_size) { if (enable_auto_size) {
// Autosize is being enabled. // Autosize is being enabled.
rvh->EnableAutoResize(min_auto_size_, max_auto_size_); rvh->EnableAutoResize(min_auto_size_, max_auto_size_);
@ -120,7 +120,7 @@ void WebViewGuestDelegate::DidAttach(int guest_proxy_routing_id) {
embedder_zoom_controller_ = embedder_zoom_controller_ =
WebContentsZoomController::FromWebContents(embedder_web_contents_); WebContentsZoomController::FromWebContents(embedder_web_contents_);
auto zoom_controller = api_web_contents_->GetZoomController(); auto* zoom_controller = api_web_contents_->GetZoomController();
embedder_zoom_controller_->AddObserver(this); embedder_zoom_controller_->AddObserver(this);
zoom_controller->SetEmbedderZoomController(embedder_zoom_controller_); zoom_controller->SetEmbedderZoomController(embedder_zoom_controller_);
} }
@ -210,8 +210,8 @@ content::WebContents* WebViewGuestDelegate::CreateNewGuestWindow(
guest_params.initial_size = guest_params.initial_size =
embedder_web_contents_->GetContainerBounds().size(); embedder_web_contents_->GetContainerBounds().size();
guest_params.context = embedder_web_contents_->GetNativeView(); guest_params.context = embedder_web_contents_->GetNativeView();
auto guest_contents = content::WebContents::Create(guest_params); auto* guest_contents = content::WebContents::Create(guest_params);
auto guest_contents_impl = auto* guest_contents_impl =
static_cast<content::WebContentsImpl*>(guest_contents); static_cast<content::WebContentsImpl*>(guest_contents);
guest_contents_impl->GetView()->CreateViewForWidget( guest_contents_impl->GetView()->CreateViewForWidget(
guest_contents->GetRenderViewHost()->GetWidget(), false); guest_contents->GetRenderViewHost()->GetWidget(), false);

View file

@ -74,9 +74,9 @@ bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,
// static // static
WebViewManager* WebViewManager::GetWebViewManager( WebViewManager* WebViewManager::GetWebViewManager(
content::WebContents* web_contents) { content::WebContents* web_contents) {
auto context = web_contents->GetBrowserContext(); auto* context = web_contents->GetBrowserContext();
if (context) { if (context) {
auto manager = context->GetGuestManager(); auto* manager = context->GetGuestManager();
return static_cast<WebViewManager*>(manager); return static_cast<WebViewManager*>(manager);
} else { } else {
return nullptr; return nullptr;

View file

@ -84,7 +84,7 @@ void WindowList::CloseAllWindows() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
std::reverse(windows.begin(), windows.end()); std::reverse(windows.begin(), windows.end());
#endif #endif
for (const auto& window : windows) for (auto* const& window : windows)
if (!window->IsClosed()) if (!window->IsClosed())
window->Close(); window->Close();
} }
@ -92,7 +92,7 @@ void WindowList::CloseAllWindows() {
// static // static
void WindowList::DestroyAllWindows() { void WindowList::DestroyAllWindows() {
WindowVector windows = GetInstance()->windows_; WindowVector windows = GetInstance()->windows_;
for (const auto& window : windows) for (auto* const& window : windows)
window->CloseImmediately(); // e.g. Destroy() window->CloseImmediately(); // e.g. Destroy()
} }

View file

@ -35,7 +35,7 @@ void RemoteCallbackFreer::RunDestructor() {
base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK"); base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK");
base::ListValue args; base::ListValue args;
args.AppendInteger(object_id_); args.AppendInteger(object_id_);
auto frame_host = web_contents()->GetMainFrame(); auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) { if (frame_host) {
frame_host->Send(new AtomFrameMsg_Message(frame_host->GetRoutingID(), false, frame_host->Send(new AtomFrameMsg_Message(frame_host->GetRoutingID(), false,
channel, args)); channel, args));

View file

@ -17,7 +17,7 @@
namespace crash_reporter { namespace crash_reporter {
CrashReporter::CrashReporter() { CrashReporter::CrashReporter() {
auto cmd = base::CommandLine::ForCurrentProcess(); auto* cmd = base::CommandLine::ForCurrentProcess();
is_browser_ = cmd->GetSwitchValueASCII(switches::kProcessType).empty(); is_browser_ = cmd->GetSwitchValueASCII(switches::kProcessType).empty();
} }
@ -102,7 +102,7 @@ CrashReporter* CrashReporter::GetInstance() {
#endif #endif
void CrashReporter::StartInstance(const mate::Dictionary& options) { void CrashReporter::StartInstance(const mate::Dictionary& options) {
auto reporter = GetInstance(); auto* reporter = GetInstance();
if (!reporter) if (!reporter)
return; return;

View file

@ -127,7 +127,7 @@ std::map<std::string, std::string> CrashReporterMac::GetParameters() const {
std::map<std::string, std::string> ret; std::map<std::string, std::string> ret;
crashpad::SimpleStringDictionary::Iterator iter(*simple_string_dictionary_); crashpad::SimpleStringDictionary::Iterator iter(*simple_string_dictionary_);
for(;;) { for(;;) {
const auto entry = iter.Next(); auto* const entry = iter.Next();
if (!entry) break; if (!entry) break;
ret[entry->key] = entry->value; ret[entry->key] = entry->value;
} }

View file

@ -114,7 +114,7 @@ std::unique_ptr<const char* []> StringVectorToArgArray(
} }
base::FilePath GetResourcesPath(bool is_browser) { base::FilePath GetResourcesPath(bool is_browser) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath exec_path(command_line->GetProgram()); base::FilePath exec_path(command_line->GetProgram());
PathService::Get(base::FILE_EXE, &exec_path); PathService::Get(base::FILE_EXE, &exec_path);

View file

@ -95,7 +95,7 @@ class FrameSpellChecker : public content::RenderFrameVisitor {
main_frame_ = nullptr; main_frame_ = nullptr;
} }
bool Visit(content::RenderFrame* render_frame) override { bool Visit(content::RenderFrame* render_frame) override {
auto view = render_frame->GetRenderView(); auto* view = render_frame->GetRenderView();
if (view->GetMainRenderFrame() == main_frame_ || if (view->GetMainRenderFrame() == main_frame_ ||
(render_frame->IsMainFrame() && render_frame == main_frame_)) { (render_frame->IsMainFrame() && render_frame == main_frame_)) {
render_frame->GetWebFrame()->SetTextCheckClient(spell_check_client_); render_frame->GetWebFrame()->SetTextCheckClient(spell_check_client_);
@ -173,7 +173,7 @@ v8::Local<v8::Value> WebFrame::RegisterEmbedderCustomElement(
void WebFrame::RegisterElementResizeCallback( void WebFrame::RegisterElementResizeCallback(
int element_instance_id, int element_instance_id,
const GuestViewContainer::ResizeCallback& callback) { const GuestViewContainer::ResizeCallback& callback) {
auto guest_view_container = GuestViewContainer::FromID(element_instance_id); auto* guest_view_container = GuestViewContainer::FromID(element_instance_id);
if (guest_view_container) if (guest_view_container)
guest_view_container->RegisterElementResizeCallback(callback); guest_view_container->RegisterElementResizeCallback(callback);
} }

View file

@ -210,7 +210,7 @@ void AutofillAgent::DoFocusChangeComplete() {
if (focused_node_was_last_clicked_ && was_focused_before_now_) { if (focused_node_was_last_clicked_ && was_focused_before_now_) {
ShowSuggestionsOptions options; ShowSuggestionsOptions options;
options.autofill_on_empty_values = true; options.autofill_on_empty_values = true;
auto input_element = ToWebInputElement(&element); auto* input_element = ToWebInputElement(&element);
if (input_element) if (input_element)
ShowSuggestions(*input_element, options); ShowSuggestions(*input_element, options);
} }

View file

@ -126,7 +126,7 @@ void AtomRenderFrameObserver::OnDestruct() {
} }
void AtomRenderFrameObserver::CreateIsolatedWorldContext() { void AtomRenderFrameObserver::CreateIsolatedWorldContext() {
auto frame = render_frame_->GetWebFrame(); auto* frame = render_frame_->GetWebFrame();
// This maps to the name shown in the context combo box in the Console tab // This maps to the name shown in the context combo box in the Console tab
// of the dev tools. // of the dev tools.

View file

@ -60,7 +60,7 @@ v8::Local<v8::Value> GetBinding(v8::Isolate* isolate,
return exports; return exports;
} }
auto mod = node::get_builtin_module(module_key.c_str()); auto* mod = node::get_builtin_module(module_key.c_str());
if (!mod) { if (!mod) {
char errmsg[1024]; char errmsg[1024];
@ -84,7 +84,7 @@ base::CommandLine::StringVector GetArgv() {
void InitializeBindings(v8::Local<v8::Object> binding, void InitializeBindings(v8::Local<v8::Object> binding,
v8::Local<v8::Context> context) { v8::Local<v8::Context> context) {
auto isolate = context->GetIsolate(); auto* isolate = context->GetIsolate();
mate::Dictionary b(isolate, binding); mate::Dictionary b(isolate, binding);
b.SetMethod("get", GetBinding); b.SetMethod("get", GetBinding);
b.SetMethod("crash", AtomBindings::Crash); b.SetMethod("crash", AtomBindings::Crash);
@ -111,7 +111,7 @@ class AtomSandboxedRenderFrameObserver : public AtomRenderFrameObserver {
if (!frame) if (!frame)
return; return;
auto isolate = blink::MainThreadIsolate(); auto* isolate = blink::MainThreadIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
auto context = frame->MainWorldScriptContext(); auto context = frame->MainWorldScriptContext();
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
@ -160,7 +160,7 @@ void AtomSandboxedRendererClient::DidCreateScriptContext(
base::FilePath preload_script_path = base::FilePath preload_script_path =
command_line->GetSwitchValuePath(switches::kPreloadScript); command_line->GetSwitchValuePath(switches::kPreloadScript);
auto isolate = context->GetIsolate(); auto* isolate = context->GetIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
// Wrap the bundle into a function that receives the binding object and the // Wrap the bundle into a function that receives the binding object and the
@ -191,7 +191,7 @@ void AtomSandboxedRendererClient::WillReleaseScriptContext(
if (!render_frame->IsMainFrame()) if (!render_frame->IsMainFrame())
return; return;
auto isolate = context->GetIsolate(); auto* isolate = context->GetIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
InvokeIpcCallback(context, "onExit", std::vector<v8::Local<v8::Value>>()); InvokeIpcCallback(context, "onExit", std::vector<v8::Local<v8::Value>>());
@ -201,7 +201,7 @@ void AtomSandboxedRendererClient::InvokeIpcCallback(
v8::Handle<v8::Context> context, v8::Handle<v8::Context> context,
const std::string& callback_name, const std::string& callback_name,
std::vector<v8::Handle<v8::Value>> args) { std::vector<v8::Handle<v8::Value>> args) {
auto isolate = context->GetIsolate(); auto* isolate = context->GetIsolate();
auto binding_key = mate::ConvertToV8(isolate, kIpcKey)->ToString(); auto binding_key = mate::ConvertToV8(isolate, kIpcKey)->ToString();
auto private_binding_key = v8::Private::ForApi(isolate, binding_key); auto private_binding_key = v8::Private::ForApi(isolate, binding_key);
auto global_object = context->Global(); auto global_object = context->Global();

View file

@ -227,7 +227,7 @@ void BrowserMainParts::PreMainMessageLoopStart() {
// Initialize ui::ResourceBundle. // Initialize ui::ResourceBundle.
ui::ResourceBundle::InitSharedInstanceWithLocale( ui::ResourceBundle::InitSharedInstanceWithLocale(
"", nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); "", nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
auto cmd_line = base::CommandLine::ForCurrentProcess(); auto* cmd_line = base::CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(switches::kLang)) { if (cmd_line->HasSwitch(switches::kLang)) {
const std::string locale = cmd_line->GetSwitchValueASCII(switches::kLang); const std::string locale = cmd_line->GetSwitchValueASCII(switches::kLang);
const base::FilePath locale_file_path = const base::FilePath locale_file_path =
@ -258,7 +258,7 @@ void BrowserMainParts::PreMainMessageLoopRun() {
WebUIControllerFactory::GetInstance()); WebUIControllerFactory::GetInstance());
// --remote-debugging-port // --remote-debugging-port
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kRemoteDebuggingPort)) if (command_line->HasSwitch(switches::kRemoteDebuggingPort))
DevToolsManagerDelegate::StartHttpHandler(); DevToolsManagerDelegate::StartHttpHandler();
} }

View file

@ -6,7 +6,7 @@ namespace brightray {
InspectableWebContents* InspectableWebContents::Create( InspectableWebContents* InspectableWebContents::Create(
const content::WebContents::CreateParams& create_params) { const content::WebContents::CreateParams& create_params) {
auto contents = content::WebContents::Create(create_params); auto* contents = content::WebContents::Create(create_params);
return Create(contents); return Create(contents);
} }

View file

@ -203,10 +203,10 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
delegate_(nullptr), delegate_(nullptr),
web_contents_(web_contents), web_contents_(web_contents),
weak_factory_(this) { weak_factory_(this) {
auto context = auto* context =
static_cast<BrowserContext*>(web_contents_->GetBrowserContext()); static_cast<BrowserContext*>(web_contents_->GetBrowserContext());
pref_service_ = context->prefs(); pref_service_ = context->prefs();
auto bounds_dict = pref_service_->GetDictionary(kDevToolsBoundsPref); auto* bounds_dict = pref_service_->GetDictionary(kDevToolsBoundsPref);
if (bounds_dict) { if (bounds_dict) {
DictionaryToRect(*bounds_dict, &devtools_bounds_); DictionaryToRect(*bounds_dict, &devtools_bounds_);
// Sometimes the devtools window is out of screen or has too small size. // Sometimes the devtools window is out of screen or has too small size.
@ -719,7 +719,7 @@ bool InspectableWebContentsImpl::ShouldCreateWebContents(
void InspectableWebContentsImpl::HandleKeyboardEvent( void InspectableWebContentsImpl::HandleKeyboardEvent(
content::WebContents* source, content::WebContents* source,
const content::NativeWebKeyboardEvent& event) { const content::NativeWebKeyboardEvent& event) {
auto delegate = web_contents_->GetDelegate(); auto* delegate = web_contents_->GetDelegate();
if (delegate) if (delegate)
delegate->HandleKeyboardEvent(source, event); delegate->HandleKeyboardEvent(source, event);
} }
@ -733,7 +733,7 @@ content::ColorChooser* InspectableWebContentsImpl::OpenColorChooser(
content::WebContents* source, content::WebContents* source,
SkColor color, SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) { const std::vector<content::ColorSuggestion>& suggestions) {
auto delegate = web_contents_->GetDelegate(); auto* delegate = web_contents_->GetDelegate();
if (delegate) if (delegate)
return delegate->OpenColorChooser(source, color, suggestions); return delegate->OpenColorChooser(source, color, suggestions);
return nullptr; return nullptr;
@ -742,7 +742,7 @@ content::ColorChooser* InspectableWebContentsImpl::OpenColorChooser(
void InspectableWebContentsImpl::RunFileChooser( void InspectableWebContentsImpl::RunFileChooser(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) { const content::FileChooserParams& params) {
auto delegate = web_contents_->GetDelegate(); auto* delegate = web_contents_->GetDelegate();
if (delegate) if (delegate)
delegate->RunFileChooser(render_frame_host, params); delegate->RunFileChooser(render_frame_host, params);
} }
@ -751,7 +751,7 @@ void InspectableWebContentsImpl::EnumerateDirectory(
content::WebContents* source, content::WebContents* source,
int request_id, int request_id,
const base::FilePath& path) { const base::FilePath& path) {
auto delegate = web_contents_->GetDelegate(); auto* delegate = web_contents_->GetDelegate();
if (delegate) if (delegate)
delegate->EnumerateDirectory(source, request_id, path); delegate->EnumerateDirectory(source, request_id, path);
} }

View file

@ -28,8 +28,8 @@ LibNotifyLoader libnotify_loader_;
const std::set<std::string>& GetServerCapabilities() { const std::set<std::string>& GetServerCapabilities() {
static std::set<std::string> caps; static std::set<std::string> caps;
if (caps.empty()) { if (caps.empty()) {
auto capabilities = libnotify_loader_.notify_get_server_caps(); auto* capabilities = libnotify_loader_.notify_get_server_caps();
for (auto l = capabilities; l != nullptr; l = l->next) for (auto* l = capabilities; l != nullptr; l = l->next)
caps.insert(static_cast<const char*>(l->data)); caps.insert(static_cast<const char*>(l->data));
g_list_free_full(capabilities, g_free); g_list_free_full(capabilities, g_free);
} }

View file

@ -31,7 +31,7 @@
name:NSWindowDidBecomeMainNotification name:NSWindowDidBecomeMainNotification
object:nil]; object:nil];
auto contents = inspectableWebContentsView_->inspectable_web_contents()->GetWebContents(); auto* contents = inspectableWebContentsView_->inspectable_web_contents()->GetWebContents();
auto contentsView = contents->GetNativeView(); auto contentsView = contents->GetNativeView();
[contentsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [contentsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self addSubview:contentsView]; [self addSubview:contentsView];
@ -63,9 +63,9 @@
if (visible == devtools_visible_) if (visible == devtools_visible_)
return; return;
auto inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents(); auto* inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents();
auto webContents = inspectable_web_contents->GetWebContents(); auto* webContents = inspectable_web_contents->GetWebContents();
auto devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents(); auto* devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents();
auto devToolsView = devToolsWebContents->GetNativeView(); auto devToolsView = devToolsWebContents->GetNativeView();
if (visible && devtools_docked_) { if (visible && devtools_docked_) {
@ -120,8 +120,8 @@
// Switch to new state. // Switch to new state.
devtools_docked_ = docked; devtools_docked_ = docked;
if (!docked) { if (!docked) {
auto inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents(); auto* inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents();
auto devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents(); auto* devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents();
auto devToolsView = devToolsWebContents->GetNativeView(); auto devToolsView = devToolsWebContents->GetNativeView();
auto styleMask = NSTitledWindowMask | NSClosableWindowMask | auto styleMask = NSTitledWindowMask | NSClosableWindowMask |
@ -184,10 +184,10 @@
} }
- (void)viewDidBecomeFirstResponder:(NSNotification*)notification { - (void)viewDidBecomeFirstResponder:(NSNotification*)notification {
auto inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents(); auto* inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents();
if (!inspectable_web_contents) if (!inspectable_web_contents)
return; return;
auto webContents = inspectable_web_contents->GetWebContents(); auto* webContents = inspectable_web_contents->GetWebContents();
auto webContentsView = webContents->GetNativeView(); auto webContentsView = webContents->GetNativeView();
NSView* view = [notification object]; NSView* view = [notification object];
@ -196,7 +196,7 @@
return; return;
} }
auto devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents(); auto* devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents();
if (!devToolsWebContents) if (!devToolsWebContents)
return; return;
auto devToolsView = devToolsWebContents->GetNativeView(); auto devToolsView = devToolsWebContents->GetNativeView();

View file

@ -20,14 +20,14 @@
- (void)userNotificationCenter:(NSUserNotificationCenter*)center - (void)userNotificationCenter:(NSUserNotificationCenter*)center
didDeliverNotification:(NSUserNotification*)notif { didDeliverNotification:(NSUserNotification*)notif {
auto notification = presenter_->GetNotification(notif); auto* notification = presenter_->GetNotification(notif);
if (notification) if (notification)
notification->NotificationDisplayed(); notification->NotificationDisplayed();
} }
- (void)userNotificationCenter:(NSUserNotificationCenter*)center - (void)userNotificationCenter:(NSUserNotificationCenter*)center
didActivateNotification:(NSUserNotification *)notif { didActivateNotification:(NSUserNotification *)notif {
auto notification = presenter_->GetNotification(notif); auto* notification = presenter_->GetNotification(notif);
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) { if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) {
LOG(INFO) << "Notification activated (" << [notif.identifier UTF8String] << ")"; LOG(INFO) << "Notification activated (" << [notif.identifier UTF8String] << ")";

View file

@ -17,7 +17,7 @@ NotificationPresenter* NotificationPresenter::Create() {
CocoaNotification* NotificationPresenterMac::GetNotification( CocoaNotification* NotificationPresenterMac::GetNotification(
NSUserNotification* ns_notification) { NSUserNotification* ns_notification) {
for (Notification* notification : notifications()) { for (Notification* notification : notifications()) {
auto native_notification = static_cast<CocoaNotification*>(notification); auto* native_notification = static_cast<CocoaNotification*>(notification);
if ([native_notification->notification().identifier if ([native_notification->notification().identifier
isEqual:ns_notification.identifier]) isEqual:ns_notification.identifier])
return native_notification; return native_notification;

View file

@ -43,7 +43,7 @@ NetLog::~NetLog() {
} }
void NetLog::StartLogging() { void NetLog::StartLogging() {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kLogNetLog)) if (!command_line->HasSwitch(switches::kLogNetLog))
return; return;

View file

@ -23,7 +23,7 @@ const char kIgnoreConnectionsLimit[] = "ignore-connections-limit";
} // namespace } // namespace
NetworkDelegate::NetworkDelegate() { NetworkDelegate::NetworkDelegate() {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(kIgnoreConnectionsLimit)) { if (command_line->HasSwitch(kIgnoreConnectionsLimit)) {
std::string value = std::string value =
command_line->GetSwitchValueASCII(kIgnoreConnectionsLimit); command_line->GetSwitchValueASCII(kIgnoreConnectionsLimit);

View file

@ -105,7 +105,7 @@ void PlatformNotificationService::DisplayNotification(
const content::PlatformNotificationData& notification_data, const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources, const content::NotificationResources& notification_resources,
base::Closure* cancel_callback) { base::Closure* cancel_callback) {
auto presenter = browser_client_->GetNotificationPresenter(); auto* presenter = browser_client_->GetNotificationPresenter();
if (!presenter) if (!presenter)
return; return;
NotificationDelegateImpl* delegate = NotificationDelegateImpl* delegate =

View file

@ -87,7 +87,7 @@ URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
net::HttpCache::BackendFactory* net::HttpCache::BackendFactory*
URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory( URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(
const base::FilePath& base_path) { const base::FilePath& base_path) {
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
int max_size = 0; int max_size = 0;
base::StringToInt(command_line->GetSwitchValueASCII(switches::kDiskCacheSize), base::StringToInt(command_line->GetSwitchValueASCII(switches::kDiskCacheSize),
&max_size); &max_size);

View file

@ -53,7 +53,7 @@ content::WebUIController* WebUIControllerFactory::CreateWebUIControllerForURL(
content::WebUI* web_ui, content::WebUI* web_ui,
const GURL& url) const { const GURL& url) const {
if (url.host() == kChromeUIDevToolsBundledHost) { if (url.host() == kChromeUIDevToolsBundledHost) {
auto browser_context = web_ui->GetWebContents()->GetBrowserContext(); auto* browser_context = web_ui->GetWebContents()->GetBrowserContext();
return new DevToolsUI(browser_context, web_ui); return new DevToolsUI(browser_context, web_ui);
} }
return nullptr; return nullptr;

View file

@ -368,7 +368,7 @@ void PrintViewManagerBase::DisconnectFromCurrentPrintJob() {
} }
void PrintViewManagerBase::PrintingDone(bool success) { void PrintViewManagerBase::PrintingDone(bool success) {
auto host = web_contents()->GetRenderViewHost(); auto* host = web_contents()->GetRenderViewHost();
if (print_job_.get()) { if (print_job_.get()) {
if (host) if (host)
host->Send(new PrintMsg_PrintingDone(host->GetRoutingID(), success)); host->Send(new PrintMsg_PrintingDone(host->GetRoutingID(), success));

View file

@ -321,7 +321,7 @@ bool DisplayProfileInUseError(const base::FilePath& lock_path,
bool IsChromeProcess(pid_t pid) { bool IsChromeProcess(pid_t pid) {
base::FilePath other_chrome_path(base::GetProcessExecutablePath(pid)); base::FilePath other_chrome_path(base::GetProcessExecutablePath(pid));
auto command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath exec_path(command_line->GetProgram()); base::FilePath exec_path(command_line->GetProgram());
PathService::Get(base::FILE_EXE, &exec_path); PathService::Get(base::FILE_EXE, &exec_path);