Commit 6ea9bf60 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[cleanup] Use for..of and nullptr in devtools ui bindings

R=yangguo@chromium.org

Change-Id: I6930da9f938db2f3bfe4c5062dce30fc4847f3a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401037
Auto-Submit: Simon Zünd <szuend@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805691}
parent 6d189bdd
...@@ -171,7 +171,7 @@ Browser* FindBrowser(content::WebContents* web_contents) { ...@@ -171,7 +171,7 @@ Browser* FindBrowser(content::WebContents* web_contents) {
if (tab_index != TabStripModel::kNoTab) if (tab_index != TabStripModel::kNoTab)
return browser; return browser;
} }
return NULL; return nullptr;
} }
// DevToolsUIDefaultDelegate -------------------------------------------------- // DevToolsUIDefaultDelegate --------------------------------------------------
...@@ -658,14 +658,14 @@ void DevToolsUIBindings::FrontendWebContentsObserver::DidFinishNavigation( ...@@ -658,14 +658,14 @@ void DevToolsUIBindings::FrontendWebContentsObserver::DidFinishNavigation(
DevToolsUIBindings* DevToolsUIBindings::ForWebContents( DevToolsUIBindings* DevToolsUIBindings::ForWebContents(
content::WebContents* web_contents) { content::WebContents* web_contents) {
if (!g_devtools_ui_bindings_instances.IsCreated()) if (!g_devtools_ui_bindings_instances.IsCreated())
return NULL; return nullptr;
DevToolsUIBindingsList* instances = DevToolsUIBindingsList* instances =
g_devtools_ui_bindings_instances.Pointer(); g_devtools_ui_bindings_instances.Pointer();
for (auto it(instances->begin()); it != instances->end(); ++it) { for (DevToolsUIBindings* binding : *instances) {
if ((*it)->web_contents() == web_contents) if (binding->web_contents() == web_contents)
return *it; return binding;
} }
return NULL; return nullptr;
} }
DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents) DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment