[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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -53,7 +53,7 @@ content::WebUIController* WebUIControllerFactory::CreateWebUIControllerForURL(
content::WebUI* web_ui,
const GURL& url) const {
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 nullptr;