Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 12600018: ResourceScheduler should use renderer notifications instead of MRUCache to track renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to RenderViewHostObserver Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 channel_->AddFilter(new GamepadBrowserMessageFilter()); 608 channel_->AddFilter(new GamepadBrowserMessageFilter());
609 channel_->AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); 609 channel_->AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER));
610 channel_->AddFilter(new HistogramMessageFilter()); 610 channel_->AddFilter(new HistogramMessageFilter());
611 channel_->AddFilter(new HyphenatorMessageFilter(this)); 611 channel_->AddFilter(new HyphenatorMessageFilter(this));
612 } 612 }
613 613
614 int RenderProcessHostImpl::GetNextRoutingID() { 614 int RenderProcessHostImpl::GetNextRoutingID() {
615 return widget_helper_->GetNextRoutingID(); 615 return widget_helper_->GetNextRoutingID();
616 } 616 }
617 617
618 void RenderProcessHostImpl::CancelResourceRequests(int render_widget_id) {
619 widget_helper_->CancelResourceRequests(render_widget_id);
620 }
621
622 void RenderProcessHostImpl::SimulateSwapOutACK( 618 void RenderProcessHostImpl::SimulateSwapOutACK(
623 const ViewMsg_SwapOut_Params& params) { 619 const ViewMsg_SwapOut_Params& params) {
624 widget_helper_->SimulateSwapOutACK(params); 620 widget_helper_->SimulateSwapOutACK(params);
625 } 621 }
626 622
627 bool RenderProcessHostImpl::WaitForBackingStoreMsg( 623 bool RenderProcessHostImpl::WaitForBackingStoreMsg(
628 int render_widget_id, 624 int render_widget_id,
629 const base::TimeDelta& max_delay, 625 const base::TimeDelta& max_delay,
630 IPC::Message* msg) { 626 IPC::Message* msg) {
631 // The post task to this thread with the process id could be in queue, and we 627 // The post task to this thread with the process id could be in queue, and we
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1139
1144 void RenderProcessHostImpl::Attach(RenderWidgetHost* host, 1140 void RenderProcessHostImpl::Attach(RenderWidgetHost* host,
1145 int routing_id) { 1141 int routing_id) {
1146 render_widget_hosts_.AddWithID(host, routing_id); 1142 render_widget_hosts_.AddWithID(host, routing_id);
1147 } 1143 }
1148 1144
1149 void RenderProcessHostImpl::Release(int routing_id) { 1145 void RenderProcessHostImpl::Release(int routing_id) {
1150 DCHECK(render_widget_hosts_.Lookup(routing_id) != NULL); 1146 DCHECK(render_widget_hosts_.Lookup(routing_id) != NULL);
1151 render_widget_hosts_.Remove(routing_id); 1147 render_widget_hosts_.Remove(routing_id);
1152 1148
1153 // Make sure that all associated resource requests are stopped.
1154 CancelResourceRequests(routing_id);
1155
1156 #if defined(OS_WIN) 1149 #if defined(OS_WIN)
1157 // Dump the handle table if handle auditing is enabled. 1150 // Dump the handle table if handle auditing is enabled.
1158 const CommandLine& browser_command_line = 1151 const CommandLine& browser_command_line =
1159 *CommandLine::ForCurrentProcess(); 1152 *CommandLine::ForCurrentProcess();
1160 if (browser_command_line.HasSwitch(switches::kAuditHandles) || 1153 if (browser_command_line.HasSwitch(switches::kAuditHandles) ||
1161 browser_command_line.HasSwitch(switches::kAuditAllHandles)) { 1154 browser_command_line.HasSwitch(switches::kAuditAllHandles)) {
1162 DumpHandles(); 1155 DumpHandles();
1163 1156
1164 // We wait to close the channels until the child process has finished 1157 // We wait to close the channels until the child process has finished
1165 // dumping handles and sends us ChildProcessHostMsg_DumpHandlesDone. 1158 // dumping handles and sends us ChildProcessHostMsg_DumpHandlesDone.
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 TRACE_EVENT0("renderer_host", 1630 TRACE_EVENT0("renderer_host",
1638 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); 1631 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
1639 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; 1632 AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
1640 ack_params.sync_point = 0; 1633 ack_params.sync_point = 0;
1641 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, 1634 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,
1642 gpu_process_host_id, 1635 gpu_process_host_id,
1643 ack_params); 1636 ack_params);
1644 } 1637 }
1645 1638
1646 } // namespace content 1639 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698