Commit 116bc6ec authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Fix nits in content::RenderWidgetHostImpl.

- Make RenderProcessBlockedStateChanged() private.
- Modernize new and NULL usage.

Change-Id: I91fd842c3fbfc7eff1a89142d09cfe3e55430993
Reviewed-on: https://chromium-review.googlesource.com/c/1496242Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636881}
parent c313c911
...@@ -482,15 +482,15 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, ...@@ -482,15 +482,15 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
const auto* command_line = base::CommandLine::ForCurrentProcess(); const auto* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kDisableHangMonitor)) { if (!command_line->HasSwitch(switches::kDisableHangMonitor)) {
input_event_ack_timeout_.reset(new TimeoutMonitor( input_event_ack_timeout_ = std::make_unique<TimeoutMonitor>(
base::BindRepeating(&RenderWidgetHostImpl::OnInputEventAckTimeout, base::BindRepeating(&RenderWidgetHostImpl::OnInputEventAckTimeout,
weak_factory_.GetWeakPtr()))); weak_factory_.GetWeakPtr()));
} }
if (!command_line->HasSwitch(switches::kDisableNewContentRenderingTimeout)) { if (!command_line->HasSwitch(switches::kDisableNewContentRenderingTimeout)) {
new_content_rendering_timeout_.reset(new TimeoutMonitor( new_content_rendering_timeout_ = std::make_unique<TimeoutMonitor>(
base::Bind(&RenderWidgetHostImpl::ClearDisplayedGraphics, base::Bind(&RenderWidgetHostImpl::ClearDisplayedGraphics,
weak_factory_.GetWeakPtr()))); weak_factory_.GetWeakPtr()));
} }
enable_surface_synchronization_ = features::IsSurfaceSynchronizationEnabled(); enable_surface_synchronization_ = features::IsSurfaceSynchronizationEnabled();
...@@ -531,7 +531,7 @@ RenderWidgetHostImpl* RenderWidgetHostImpl::FromID( ...@@ -531,7 +531,7 @@ RenderWidgetHostImpl* RenderWidgetHostImpl::FromID(
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
RoutingIDWidgetMap* widgets = g_routing_id_widget_map.Pointer(); RoutingIDWidgetMap* widgets = g_routing_id_widget_map.Pointer();
auto it = widgets->find(RenderWidgetHostID(process_id, routing_id)); auto it = widgets->find(RenderWidgetHostID(process_id, routing_id));
return it == widgets->end() ? NULL : it->second; return it != widgets->end() ? it->second : nullptr;
} }
// static // static
...@@ -558,8 +558,7 @@ RenderWidgetHost::GetRenderWidgetHosts() { ...@@ -558,8 +558,7 @@ RenderWidgetHost::GetRenderWidgetHosts() {
// static // static
std::unique_ptr<RenderWidgetHostIterator> std::unique_ptr<RenderWidgetHostIterator>
RenderWidgetHostImpl::GetAllRenderWidgetHosts() { RenderWidgetHostImpl::GetAllRenderWidgetHosts() {
std::unique_ptr<RenderWidgetHostIteratorImpl> hosts( auto hosts = std::make_unique<RenderWidgetHostIteratorImpl>();
new RenderWidgetHostIteratorImpl());
for (auto& it : g_routing_id_widget_map.Get()) for (auto& it : g_routing_id_widget_map.Get())
hosts->Add(it.second); hosts->Add(it.second);
...@@ -1024,7 +1023,7 @@ bool RenderWidgetHostImpl::SynchronizeVisualProperties( ...@@ -1024,7 +1023,7 @@ bool RenderWidgetHostImpl::SynchronizeVisualProperties(
return false; return false;
} }
std::unique_ptr<VisualProperties> visual_properties(new VisualProperties); auto visual_properties = std::make_unique<VisualProperties>();
bool needs_ack = false; bool needs_ack = false;
if (!GetVisualProperties(visual_properties.get(), &needs_ack)) if (!GetVisualProperties(visual_properties.get(), &needs_ack))
return false; return false;
...@@ -3284,8 +3283,7 @@ std::unique_ptr<RenderWidgetHostIterator> ...@@ -3284,8 +3283,7 @@ std::unique_ptr<RenderWidgetHostIterator>
RenderWidgetHostImpl::GetEmbeddedRenderWidgetHosts() { RenderWidgetHostImpl::GetEmbeddedRenderWidgetHosts() {
// This iterates over all RenderWidgetHosts and returns those whose Views // This iterates over all RenderWidgetHosts and returns those whose Views
// are children of this host's View. // are children of this host's View.
std::unique_ptr<RenderWidgetHostIteratorImpl> hosts( auto hosts = std::make_unique<RenderWidgetHostIteratorImpl>();
new RenderWidgetHostIteratorImpl());
auto* parent_view = static_cast<RenderWidgetHostViewBase*>(GetView()); auto* parent_view = static_cast<RenderWidgetHostViewBase*>(GetView());
for (auto& it : g_routing_id_widget_map.Get()) { for (auto& it : g_routing_id_widget_map.Get()) {
RenderWidgetHost* widget = it.second; RenderWidgetHost* widget = it.second;
......
...@@ -371,10 +371,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl ...@@ -371,10 +371,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// in flight change). // in flight change).
bool RequestRepaintForTesting(); bool RequestRepaintForTesting();
// Called by the RenderProcessHost to handle the case when the process
// changed its state of being blocked.
void RenderProcessBlockedStateChanged(bool blocked);
// Called after every cross-document navigation. If Surface Synchronizaton is // Called after every cross-document navigation. If Surface Synchronizaton is
// on, we send a new LocalSurfaceId to RenderWidget to be used after // on, we send a new LocalSurfaceId to RenderWidget to be used after
// navigation. If Surface Synchronization is off, we block CompositorFrames // navigation. If Surface Synchronization is off, we block CompositorFrames
...@@ -895,6 +891,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl ...@@ -895,6 +891,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void OnSnapshotReceived(int snapshot_id, gfx::Image image); void OnSnapshotReceived(int snapshot_id, gfx::Image image);
// Called by the RenderProcessHost to handle the case when the process
// changed its state of being blocked.
void RenderProcessBlockedStateChanged(bool blocked);
// 1. Grants permissions to URL (if any) // 1. Grants permissions to URL (if any)
// 2. Grants permissions to filenames // 2. Grants permissions to filenames
// 3. Grants permissions to file system files. // 3. Grants permissions to file system files.
......
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