[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

@ -927,12 +927,12 @@ void App::DisableDomainBlockingFor3DAPIs(mate::Arguments* args) {
}
bool App::IsAccessibilitySupportEnabled() {
auto ax_state = content::BrowserAccessibilityState::GetInstance();
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
return ax_state->IsAccessibleBrowser();
}
void App::SetAccessibilitySupportEnabled(bool enabled) {
auto ax_state = content::BrowserAccessibilityState::GetInstance();
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
if (enabled) {
ax_state->OnScreenReaderDetected();
} else {
@ -1054,7 +1054,7 @@ void App::GetFileIcon(const base::FilePath& path, mate::Arguments* args) {
return;
}
auto icon_manager = g_browser_process->GetIconManager();
auto* icon_manager = g_browser_process->GetIconManager();
gfx::Image* icon =
icon_manager->LookupIconFromFilepath(normalized_path, icon_size);
if (icon) {
@ -1132,7 +1132,7 @@ void App::EnableMixedSandbox(mate::Arguments* args) {
return;
}
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(::switches::kNoSandbox)) {
#if defined(OS_WIN)
const base::CommandLine::CharType* noSandboxArg = L"--no-sandbox";
@ -1263,7 +1263,7 @@ void App::BuildPrototype(v8::Isolate* isolate,
namespace {
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",
base::CompareCase::INSENSITIVE_ASCII) ||
@ -1301,7 +1301,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> context,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
mate::Dictionary dict(isolate, exports);
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
// Chromium to draw.
const auto view = web_contents()->GetRenderWidgetHostView();
auto* const view = web_contents()->GetRenderWidgetHostView();
view->Show();
view->SetSize(window()->GetContentSize());
@ -408,7 +408,7 @@ void BrowserWindow::BuildPrototype(v8::Isolate* isolate,
// static
v8::Local<v8::Value> BrowserWindow::From(v8::Isolate* isolate,
NativeWindow* native_window) {
auto existing = TrackableObject::FromWrappedClass(isolate, native_window);
auto* existing = TrackableObject::FromWrappedClass(isolate, native_window);
if (existing)
return existing->GetWrapper();
else

View file

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

View file

@ -207,7 +207,7 @@ void DownloadItem::BuildPrototype(v8::Isolate* isolate,
// static
mate::Handle<DownloadItem> DownloadItem::Create(v8::Isolate* isolate,
content::DownloadItem* item) {
auto existing = TrackableObject::FromWrappedClass(isolate, item);
auto* existing = TrackableObject::FromWrappedClass(isolate, item);
if (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) {
CompletionCallback callback;
args->GetNext(&callback);
auto getter = browser_context_->GetRequestContext();
auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&Protocol::UnregisterProtocolInIO,
@ -95,7 +95,7 @@ void Protocol::UnregisterProtocol(const std::string& scheme,
Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>(
auto* job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory());
if (!job_factory->HasProtocolHandler(scheme))
return PROTOCOL_NOT_REGISTERED;
@ -105,7 +105,7 @@ Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
void Protocol::IsProtocolHandled(const std::string& scheme,
const BooleanCallback& callback) {
auto getter = browser_context_->GetRequestContext();
auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::IsProtocolHandledInIO, base::RetainedRef(getter),
@ -124,7 +124,7 @@ void Protocol::UninterceptProtocol(const std::string& scheme,
mate::Arguments* args) {
CompletionCallback callback;
args->GetNext(&callback);
auto getter = browser_context_->GetRequestContext();
auto* getter = browser_context_->GetRequestContext();
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&Protocol::UninterceptProtocolInIO,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -75,7 +75,7 @@ void EventSubscriberBase::On(const std::string& event_name) {
v8::HandleScope handle_scope(isolate_);
auto fn_template = g_cached_template.Get(isolate_);
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(
isolate_, isolate_->GetCurrentContext(), fn_template->GetFunction(),
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 source = static_cast<const unsigned char*>(bitmap.getPixels());
auto target = node::Buffer::Data(local_buffer);
auto* source = static_cast<const unsigned char*>(bitmap.getPixels());
auto* target = node::Buffer::Data(local_buffer);
for (int y = 0; y < bitmap.height(); ++y) {
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,
const content::SavePageType& save_type) {
auto download_manager = content::BrowserContext::GetDownloadManager(
auto* download_manager = content::BrowserContext::GetDownloadManager(
web_contents_->GetBrowserContext());
download_manager->AddObserver(this);
// 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(
base::SupportsUserData* wrapped) {
if (wrapped) {
auto id = static_cast<IDUserData*>(wrapped->GetUserData(kTrackedObjectKey));
auto* id = static_cast<IDUserData*>(
wrapped->GetUserData(kTrackedObjectKey));
if (id)
return *id;
}