summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2015-01-21 12:13:07 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-21 20:14:22 +0000
commit7df36b27afc2da124eb826718773fd75ac078f65 (patch)
treed2cdceaed95876ed55707cdbc0064af73188c345
parentb2514129e3a9d6961b573da1bfca9df9e55fa0b1 (diff)
downloadchromium_src-7df36b27afc2da124eb826718773fd75ac078f65.zip
chromium_src-7df36b27afc2da124eb826718773fd75ac078f65.tar.gz
chromium_src-7df36b27afc2da124eb826718773fd75ac078f65.tar.bz2
GuestViewBase: More C++ 11'ification
1. Use auto some more where it makes sense to use it. 2. Use for range loops where possible, and useful. 3. Use nullptr keyword instead of NULL define. 4. General cleanup. BUG=none Review URL: https://codereview.chromium.org/862943003 Cr-Commit-Position: refs/heads/master@{#312406}
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc8
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.h4
-rw-r--r--content/browser/browser_plugin/browser_plugin_message_filter.cc11
-rw-r--r--content/browser/browser_plugin/browser_plugin_message_filter.h8
-rw-r--r--content/renderer/browser_plugin/browser_plugin.cc16
-rw-r--r--extensions/browser/guest_view/app_view/app_view_guest.cc14
-rw-r--r--extensions/browser/guest_view/extension_options/extension_options_guest.cc12
-rw-r--r--extensions/browser/guest_view/guest_view_base.cc14
-rw-r--r--extensions/browser/guest_view/guest_view_manager.cc35
-rw-r--r--extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc4
-rw-r--r--extensions/browser/guest_view/web_view/web_view_guest.cc10
-rw-r--r--extensions/renderer/guest_view/extensions_guest_view_container.cc7
12 files changed, 67 insertions, 76 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 55e3814..269d4ab 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -124,7 +124,7 @@ void BrowserPluginGuest::Init() {
void BrowserPluginGuest::WillDestroy() {
is_in_destruction_ = true;
- owner_web_contents_ = NULL;
+ owner_web_contents_ = nullptr;
attached_ = false;
}
@@ -302,7 +302,7 @@ BrowserPluginGuest* BrowserPluginGuest::Create(
WebContentsImpl* web_contents,
BrowserPluginGuestDelegate* delegate) {
return new BrowserPluginGuest(
- web_contents->opener() != NULL, web_contents, delegate);
+ web_contents->opener() != nullptr, web_contents, delegate);
}
// static
@@ -319,7 +319,7 @@ bool BrowserPluginGuest::IsGuest(RenderViewHostImpl* render_view_host) {
RenderWidgetHostView* BrowserPluginGuest::GetOwnerRenderWidgetHostView() {
if (!owner_web_contents_)
- return NULL;
+ return nullptr;
return owner_web_contents_->GetRenderWidgetHostView();
}
@@ -760,7 +760,7 @@ void BrowserPluginGuest::OnSetFocus(int browser_plugin_instance_id,
bool focused,
blink::WebFocusType focus_type) {
RenderWidgetHostView* rwhv = web_contents()->GetRenderWidgetHostView();
- RenderWidgetHost* rwh = rwhv ? rwhv->GetRenderWidgetHost() : NULL;
+ RenderWidgetHost* rwh = rwhv ? rwhv->GetRenderWidgetHost() : nullptr;
SetFocus(rwh, focused, focus_type);
}
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index 59be6c2..0941782 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -140,11 +140,11 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestSizer,
bool OnMessageReceivedFromEmbedder(const IPC::Message& message);
WebContentsImpl* embedder_web_contents() const {
- return attached_ ? owner_web_contents_ : NULL;
+ return attached_ ? owner_web_contents_ : nullptr;
}
// Returns the embedder's RenderWidgetHostView if it is available.
- // Returns NULL otherwise.
+ // Returns nullptr otherwise.
RenderWidgetHostView* GetOwnerRenderWidgetHostView();
bool focused() const { return focused_; }
diff --git a/content/browser/browser_plugin/browser_plugin_message_filter.cc b/content/browser/browser_plugin/browser_plugin_message_filter.cc
index c39476d..5f044f3 100644
--- a/content/browser/browser_plugin/browser_plugin_message_filter.cc
+++ b/content/browser/browser_plugin/browser_plugin_message_filter.cc
@@ -33,8 +33,8 @@ bool BrowserPluginMessageFilter::OnMessageReceived(
// a BrowserPluginGuestManager.
if (BrowserPluginGuest::ShouldForwardToBrowserPluginGuest(message)) {
ForwardMessageToGuest(message);
- // We always swallow messages destined for BrowserPluginGuestManager because
- // we're on the UI thread and fallback code is expected to be run on the IO
+ // We always swallow messages destined for BrowserPluginGuest because we're
+ // on the UI thread and fallback code is expected to be run on the IO
// thread.
return true;
}
@@ -54,14 +54,13 @@ void BrowserPluginMessageFilter::OverrideThreadForMessage(
void BrowserPluginMessageFilter::ForwardMessageToGuest(
const IPC::Message& message) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- RenderViewHost* rvh = RenderViewHost::FromID(render_process_id_,
- message.routing_id());
+ auto rvh = RenderViewHost::FromID(render_process_id_, message.routing_id());
if (!rvh)
return;
- WebContents* embedder_web_contents = WebContents::FromRenderViewHost(rvh);
+ auto embedder_web_contents = WebContents::FromRenderViewHost(rvh);
- int browser_plugin_instance_id = 0;
+ int browser_plugin_instance_id = browser_plugin::kInstanceIDNone;
// All allowed messages must have instance_id as their first parameter.
PickleIterator iter(message);
bool success = iter.ReadInt(&browser_plugin_instance_id);
diff --git a/content/browser/browser_plugin/browser_plugin_message_filter.h b/content/browser/browser_plugin/browser_plugin_message_filter.h
index 672f6de..9c89f81 100644
--- a/content/browser/browser_plugin/browser_plugin_message_filter.h
+++ b/content/browser/browser_plugin/browser_plugin_message_filter.h
@@ -7,17 +7,13 @@
#include "content/public/browser/browser_message_filter.h"
-struct FrameHostMsg_BuffersSwappedACK_Params;
-
namespace content {
-class BrowserContext;
-
// This class filters out incoming IPC messages for the guest renderer process
// on the IPC thread before other message filters handle them.
class BrowserPluginMessageFilter : public BrowserMessageFilter {
public:
- BrowserPluginMessageFilter(int render_process_id);
+ explicit BrowserPluginMessageFilter(int render_process_id);
// BrowserMessageFilter implementation.
void OverrideThreadForMessage(const IPC::Message& message,
@@ -33,7 +29,7 @@ class BrowserPluginMessageFilter : public BrowserMessageFilter {
void ForwardMessageToGuest(const IPC::Message& message);
- int render_process_id_;
+ const int render_process_id_;
DISALLOW_COPY_AND_ASSIGN(BrowserPluginMessageFilter);
};
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index b463abc..ee7383a 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -51,20 +51,20 @@ namespace content {
BrowserPlugin* BrowserPlugin::GetFromNode(blink::WebNode& node) {
blink::WebPluginContainer* container = node.pluginContainer();
if (!container)
- return NULL;
+ return nullptr;
PluginContainerMap* browser_plugins = g_plugin_container_map.Pointer();
PluginContainerMap::iterator it = browser_plugins->find(container);
- return it == browser_plugins->end() ? NULL : it->second;
+ return it == browser_plugins->end() ? nullptr : it->second;
}
BrowserPlugin::BrowserPlugin(RenderFrame* render_frame,
scoped_ptr<BrowserPluginDelegate> delegate)
: attached_(false),
render_view_routing_id_(render_frame->GetRenderView()->GetRoutingID()),
- container_(NULL),
+ container_(nullptr),
last_device_scale_factor_(GetDeviceScaleFactor()),
- sad_guest_(NULL),
+ sad_guest_(nullptr),
guest_crashed_(false),
plugin_focused_(false),
visible_(true),
@@ -154,7 +154,7 @@ void BrowserPlugin::Detach() {
EnableCompositing(false);
if (compositing_helper_.get()) {
compositing_helper_->OnContainerDestroy();
- compositing_helper_ = NULL;
+ compositing_helper_ = nullptr;
}
BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_Detach(
@@ -263,7 +263,7 @@ void BrowserPlugin::OnShouldAcceptTouchEvents(int browser_plugin_instance_id,
void BrowserPlugin::ShowSadGraphic() {
// If the BrowserPlugin is scheduled to be deleted, then container_ will be
- // NULL so we shouldn't attempt to access it.
+ // nullptr so we shouldn't attempt to access it.
if (container_)
container_->invalidate();
}
@@ -351,7 +351,7 @@ void BrowserPlugin::EnableCompositing(bool enable) {
if (!enable) {
DCHECK(compositing_helper_.get());
compositing_helper_->OnContainerDestroy();
- compositing_helper_ = NULL;
+ compositing_helper_ = nullptr;
}
}
@@ -362,7 +362,7 @@ void BrowserPlugin::destroy() {
g_plugin_container_map.Get().erase(container_);
}
- container_ = NULL;
+ container_ = nullptr;
// Will be a no-op if the mouse is not currently locked.
auto render_view = RenderViewImpl::FromRoutingID(render_view_routing_id());
if (render_view)
diff --git a/extensions/browser/guest_view/app_view/app_view_guest.cc b/extensions/browser/guest_view/app_view/app_view_guest.cc
index 86d6524..4030b27 100644
--- a/extensions/browser/guest_view/app_view/app_view_guest.cc
+++ b/extensions/browser/guest_view/app_view/app_view_guest.cc
@@ -113,7 +113,7 @@ AppViewGuest::~AppViewGuest() {
}
WindowController* AppViewGuest::GetExtensionWindowController() const {
- return NULL;
+ return nullptr;
}
content::WebContents* AppViewGuest::GetAssociatedWebContents() const {
@@ -184,13 +184,13 @@ void AppViewGuest::CreateWebContents(
const WebContentsCreatedCallback& callback) {
std::string app_id;
if (!create_params.GetString(appview::kAppID, &app_id)) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
- const base::DictionaryValue* data = NULL;
+ const base::DictionaryValue* data = nullptr;
if (!create_params.GetDictionary(appview::kData, &data)) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
@@ -202,7 +202,7 @@ void AppViewGuest::CreateWebContents(
if (!guest_extension || !guest_extension->is_platform_app() ||
!embedder_extension | !embedder_extension->is_platform_app()) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
@@ -261,7 +261,7 @@ void AppViewGuest::CompleteCreateWebContents(
const Extension* guest_extension,
const WebContentsCreatedCallback& callback) {
if (!url.is_valid()) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
url_ = url;
@@ -284,7 +284,7 @@ void AppViewGuest::LaunchAppAndFireEvent(
extension_host->extension()->id(),
app_runtime::OnEmbedRequested::kEventName);
if (!has_event_listener) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
index 1cb98b5..85adb71 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
@@ -70,7 +70,7 @@ void ExtensionOptionsGuest::CreateWebContents(
create_params.GetString(extensionoptions::kExtensionId, &extension_id);
if (!crx_file::id_util::IdIsValid(extension_id)) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
@@ -78,14 +78,14 @@ void ExtensionOptionsGuest::CreateWebContents(
if (crx_file::id_util::IdIsValid(embedder_extension_id) &&
extension_id != embedder_extension_id) {
// Extensions cannot embed other extensions' options pages.
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
GURL extension_url =
extensions::Extension::GetBaseURLFromExtensionId(extension_id);
if (!extension_url.is_valid()) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
@@ -97,13 +97,13 @@ void ExtensionOptionsGuest::CreateWebContents(
if (!extension) {
// The ID was valid but the extension didn't exist. Typically this will
// happen when an extension is disabled.
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
options_page_ = extensions::OptionsPageInfo::GetOptionsPage(extension);
if (!options_page_.is_valid()) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
@@ -190,7 +190,7 @@ content::WebContents* ExtensionOptionsGuest::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
if (!extension_options_guest_delegate_)
- return NULL;
+ return nullptr;
// Don't allow external URLs with the CURRENT_TAB disposition be opened in
// this guest view, change the disposition to NEW_FOREGROUND_TAB.
diff --git a/extensions/browser/guest_view/guest_view_base.cc b/extensions/browser/guest_view/guest_view_base.cc
index ce2f6ec..8b38272 100644
--- a/extensions/browser/guest_view/guest_view_base.cc
+++ b/extensions/browser/guest_view/guest_view_base.cc
@@ -171,7 +171,7 @@ void GuestViewBase::Init(const base::DictionaryValue& create_params,
owner_web_contents()->GetRenderViewHost());
owner_extension_id_ = owner_extension ? owner_extension->id() : std::string();
- // Ok for |owner_extension| to be NULL, the embedder might be WebUI.
+ // Ok for |owner_extension| to be nullptr, the embedder might be WebUI.
Feature::Availability availability = feature->IsAvailableToContext(
owner_extension,
process_map->GetMostLikelyContextType(
@@ -182,7 +182,7 @@ void GuestViewBase::Init(const base::DictionaryValue& create_params,
// The derived class did not create a WebContents so this class serves no
// purpose. Let's self-destruct.
delete this;
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
@@ -275,7 +275,7 @@ GuestViewBase* GuestViewBase::Create(
auto it = guest_view_registry.Get().find(view_type);
if (it == guest_view_registry.Get().end()) {
NOTREACHED();
- return NULL;
+ return nullptr;
}
return it->second.Run(browser_context, owner_web_contents, guest_instance_id);
}
@@ -284,7 +284,7 @@ GuestViewBase* GuestViewBase::Create(
GuestViewBase* GuestViewBase::FromWebContents(WebContents* web_contents) {
WebContentsGuestViewMap* guest_map = webcontents_guestview_map.Pointer();
auto it = guest_map->find(web_contents);
- return it == guest_map->end() ? NULL : it->second;
+ return it == guest_map->end() ? nullptr : it->second;
}
// static
@@ -292,13 +292,13 @@ GuestViewBase* GuestViewBase::From(int owner_process_id,
int guest_instance_id) {
auto host = content::RenderProcessHost::FromID(owner_process_id);
if (!host)
- return NULL;
+ return nullptr;
content::WebContents* guest_web_contents =
GuestViewManager::FromBrowserContext(host->GetBrowserContext())->
GetGuestByInstanceIDSafely(guest_instance_id, owner_process_id);
if (!guest_web_contents)
- return NULL;
+ return nullptr;
return GuestViewBase::FromWebContents(guest_web_contents);
}
@@ -617,7 +617,7 @@ void GuestViewBase::CompleteInit(
// The derived class did not create a WebContents so this class serves no
// purpose. Let's self-destruct.
delete this;
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
InitWithWebContents(*create_params, guest_web_contents);
diff --git a/extensions/browser/guest_view/guest_view_manager.cc b/extensions/browser/guest_view/guest_view_manager.cc
index 99e174d..4e0c48a 100644
--- a/extensions/browser/guest_view/guest_view_manager.cc
+++ b/extensions/browser/guest_view/guest_view_manager.cc
@@ -28,7 +28,7 @@ using content::WebContents;
namespace extensions {
// static
-GuestViewManagerFactory* GuestViewManager::factory_ = NULL;
+GuestViewManagerFactory* GuestViewManager::factory_ = nullptr;
GuestViewManager::GuestViewManager(content::BrowserContext* context)
: current_instance_id_(0), last_instance_id_removed_(0), context_(context) {
@@ -58,7 +58,7 @@ content::WebContents* GuestViewManager::GetGuestByInstanceIDSafely(
int embedder_render_process_id) {
if (!CanEmbedderAccessInstanceIDMaybeKill(embedder_render_process_id,
guest_instance_id)) {
- return NULL;
+ return nullptr;
}
return GetGuestByInstanceID(guest_instance_id);
}
@@ -79,8 +79,8 @@ void GuestViewManager::AttachGuest(
auto rvh = content::RenderViewHost::FromID(embedder_render_process_id,
embedder_routing_id);
- // We need to check that rvh is not NULL because there may be a race between
- // AttachGuest and destroying the embedder (i.e. when the embedder is
+ // We need to check that rvh is not nullptr because there may be a race
+ // between AttachGuest and destroying the embedder (i.e. when the embedder is
// destroyed immediately after the guest is created).
if (!rvh)
return;
@@ -147,7 +147,7 @@ void GuestViewManager::CreateGuest(const std::string& view_type,
guest_instance_id,
view_type);
if (!guest) {
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
guest->Init(create_params, callback);
@@ -164,7 +164,7 @@ content::WebContents* GuestViewManager::CreateGuestWithWebContentsParams(
guest_instance_id,
view_type);
if (!guest)
- return NULL;
+ return nullptr;
content::WebContents::CreateParams guest_create_params(create_params);
guest_create_params.guest_delegate = guest;
content::WebContents* guest_web_contents =
@@ -179,7 +179,7 @@ content::WebContents* GuestViewManager::GetGuestByInstanceID(
int guest_instance_id = GetGuestInstanceIDForElementID(owner_web_contents,
element_instance_id);
if (guest_instance_id == guestview::kInstanceIDNone)
- return NULL;
+ return nullptr;
return GetGuestByInstanceID(guest_instance_id);
}
@@ -196,24 +196,21 @@ int GuestViewManager::GetGuestInstanceIDForElementID(
SiteInstance* GuestViewManager::GetGuestSiteInstance(
const GURL& guest_site) {
- for (auto it = guest_web_contents_by_instance_id_.begin();
- it != guest_web_contents_by_instance_id_.end(); ++it) {
- if (it->second->GetSiteInstance()->GetSiteURL() == guest_site)
- return it->second->GetSiteInstance();
+ for (const auto& guest : guest_web_contents_by_instance_id_) {
+ if (guest.second->GetSiteInstance()->GetSiteURL() == guest_site)
+ return guest.second->GetSiteInstance();
}
- return NULL;
+ return nullptr;
}
bool GuestViewManager::ForEachGuest(WebContents* owner_web_contents,
const GuestCallback& callback) {
- for (auto it = guest_web_contents_by_instance_id_.begin();
- it != guest_web_contents_by_instance_id_.end(); ++it) {
- WebContents* guest = it->second;
- auto guest_view = GuestViewBase::FromWebContents(guest);
- if (owner_web_contents != guest_view->owner_web_contents())
+ for (const auto& guest : guest_web_contents_by_instance_id_) {
+ auto guest_view = GuestViewBase::FromWebContents(guest.second);
+ if (guest_view->owner_web_contents() != owner_web_contents)
continue;
- if (callback.Run(guest))
+ if (callback.Run(guest_view->web_contents()))
return true;
}
return false;
@@ -266,7 +263,7 @@ content::WebContents* GuestViewManager::GetGuestByInstanceID(
int guest_instance_id) {
auto it = guest_web_contents_by_instance_id_.find(guest_instance_id);
if (it == guest_web_contents_by_instance_id_.end())
- return NULL;
+ return nullptr;
return it->second;
}
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 35272ca..a417615 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -74,7 +74,7 @@ MimeHandlerViewGuest::~MimeHandlerViewGuest() {
}
WindowController* MimeHandlerViewGuest::GetExtensionWindowController() const {
- return NULL;
+ return nullptr;
}
WebContents* MimeHandlerViewGuest::GetAssociatedWebContents() const {
@@ -112,7 +112,7 @@ void MimeHandlerViewGuest::CreateWebContents(
if (!mime_handler_extension) {
LOG(ERROR) << "Extension for mime_type not found, mime_type = "
<< stream_->stream_info()->mime_type;
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
index 0ce4c65..9428fbb 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -244,7 +244,7 @@ void WebViewGuest::CreateWebContents(
base::UserMetricsAction("BadMessageTerminate_BPGM"));
owner_render_process_host->Shutdown(content::RESULT_CODE_KILLED_BAD_MESSAGE,
false);
- callback.Run(NULL);
+ callback.Run(nullptr);
return;
}
std::string url_encoded_partition = net::EscapeQueryParamValue(
@@ -885,7 +885,7 @@ content::ColorChooser* WebViewGuest::OpenColorChooser(
SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) {
if (!attached() || !embedder_web_contents()->GetDelegate())
- return NULL;
+ return nullptr;
return embedder_web_contents()->GetDelegate()->OpenColorChooser(
web_contents, color, suggestions);
}
@@ -1136,12 +1136,12 @@ content::WebContents* WebViewGuest::OpenURLFromTab(
WebViewGuest* opener = GetOpener();
auto it = opener->pending_new_windows_.find(this);
if (it == opener->pending_new_windows_.end())
- return NULL;
+ return nullptr;
const NewWindowInfo& info = it->second;
NewWindowInfo new_window_info(params.url, info.name);
new_window_info.changed = new_window_info.url != info.url;
it->second = new_window_info;
- return NULL;
+ return nullptr;
}
if (params.disposition == CURRENT_TAB) {
// This can happen for cross-site redirects.
@@ -1150,7 +1150,7 @@ content::WebContents* WebViewGuest::OpenURLFromTab(
}
CreateNewGuestWebViewWindow(params);
- return NULL;
+ return nullptr;
}
void WebViewGuest::WebContentsCreated(WebContents* source_contents,
diff --git a/extensions/renderer/guest_view/extensions_guest_view_container.cc b/extensions/renderer/guest_view/extensions_guest_view_container.cc
index cb480b9..c546c3a 100644
--- a/extensions/renderer/guest_view/extensions_guest_view_container.cc
+++ b/extensions/renderer/guest_view/extensions_guest_view_container.cc
@@ -140,7 +140,7 @@ void ExtensionsGuestViewContainer::DetachRequest::HandleResponse(
blink::WebScopedMicrotaskSuppression suppression;
// Call the DetachGuest's callback.
- callback->Call(context->Global(), 0 /* argc */, NULL);
+ callback->Call(context->Global(), 0 /* argc */, nullptr);
}
ExtensionsGuestViewContainer::ExtensionsGuestViewContainer(
@@ -175,9 +175,8 @@ ExtensionsGuestViewContainer* ExtensionsGuestViewContainer::FromID(
int element_instance_id) {
ExtensionsGuestViewContainerMap* guest_view_containers =
g_guest_view_container_map.Pointer();
- ExtensionsGuestViewContainerMap::iterator it =
- guest_view_containers->find(element_instance_id);
- return it == guest_view_containers->end() ? NULL : it->second;
+ auto it = guest_view_containers->find(element_instance_id);
+ return it == guest_view_containers->end() ? nullptr : it->second;
}
void ExtensionsGuestViewContainer::IssueRequest(linked_ptr<Request> request) {