OLD | NEW |
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 channel_->AddFilter(new GamepadBrowserMessageFilter()); | 636 channel_->AddFilter(new GamepadBrowserMessageFilter()); |
637 channel_->AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 637 channel_->AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
638 channel_->AddFilter(new HistogramMessageFilter()); | 638 channel_->AddFilter(new HistogramMessageFilter()); |
639 channel_->AddFilter(new HyphenatorMessageFilter(this)); | 639 channel_->AddFilter(new HyphenatorMessageFilter(this)); |
640 } | 640 } |
641 | 641 |
642 int RenderProcessHostImpl::GetNextRoutingID() { | 642 int RenderProcessHostImpl::GetNextRoutingID() { |
643 return widget_helper_->GetNextRoutingID(); | 643 return widget_helper_->GetNextRoutingID(); |
644 } | 644 } |
645 | 645 |
646 void RenderProcessHostImpl::CancelResourceRequests(int render_widget_id) { | |
647 widget_helper_->CancelResourceRequests(render_widget_id); | |
648 } | |
649 | |
650 void RenderProcessHostImpl::SimulateSwapOutACK( | 646 void RenderProcessHostImpl::SimulateSwapOutACK( |
651 const ViewMsg_SwapOut_Params& params) { | 647 const ViewMsg_SwapOut_Params& params) { |
652 widget_helper_->SimulateSwapOutACK(params); | 648 widget_helper_->SimulateSwapOutACK(params); |
653 } | 649 } |
654 | 650 |
655 bool RenderProcessHostImpl::WaitForBackingStoreMsg( | 651 bool RenderProcessHostImpl::WaitForBackingStoreMsg( |
656 int render_widget_id, | 652 int render_widget_id, |
657 const base::TimeDelta& max_delay, | 653 const base::TimeDelta& max_delay, |
658 IPC::Message* msg) { | 654 IPC::Message* msg) { |
659 // The post task to this thread with the process id could be in queue, and we | 655 // The post task to this thread with the process id could be in queue, and we |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 | 1166 |
1171 void RenderProcessHostImpl::Attach(RenderWidgetHost* host, | 1167 void RenderProcessHostImpl::Attach(RenderWidgetHost* host, |
1172 int routing_id) { | 1168 int routing_id) { |
1173 render_widget_hosts_.AddWithID(host, routing_id); | 1169 render_widget_hosts_.AddWithID(host, routing_id); |
1174 } | 1170 } |
1175 | 1171 |
1176 void RenderProcessHostImpl::Release(int routing_id) { | 1172 void RenderProcessHostImpl::Release(int routing_id) { |
1177 DCHECK(render_widget_hosts_.Lookup(routing_id) != NULL); | 1173 DCHECK(render_widget_hosts_.Lookup(routing_id) != NULL); |
1178 render_widget_hosts_.Remove(routing_id); | 1174 render_widget_hosts_.Remove(routing_id); |
1179 | 1175 |
1180 // Make sure that all associated resource requests are stopped. | |
1181 CancelResourceRequests(routing_id); | |
1182 | |
1183 #if defined(OS_WIN) | 1176 #if defined(OS_WIN) |
1184 // Dump the handle table if handle auditing is enabled. | 1177 // Dump the handle table if handle auditing is enabled. |
1185 const CommandLine& browser_command_line = | 1178 const CommandLine& browser_command_line = |
1186 *CommandLine::ForCurrentProcess(); | 1179 *CommandLine::ForCurrentProcess(); |
1187 if (browser_command_line.HasSwitch(switches::kAuditHandles) || | 1180 if (browser_command_line.HasSwitch(switches::kAuditHandles) || |
1188 browser_command_line.HasSwitch(switches::kAuditAllHandles)) { | 1181 browser_command_line.HasSwitch(switches::kAuditAllHandles)) { |
1189 DumpHandles(); | 1182 DumpHandles(); |
1190 | 1183 |
1191 // We wait to close the channels until the child process has finished | 1184 // We wait to close the channels until the child process has finished |
1192 // dumping handles and sends us ChildProcessHostMsg_DumpHandlesDone. | 1185 // dumping handles and sends us ChildProcessHostMsg_DumpHandlesDone. |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 TRACE_EVENT0("renderer_host", | 1657 TRACE_EVENT0("renderer_host", |
1665 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1658 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
1666 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1659 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
1667 ack_params.sync_point = 0; | 1660 ack_params.sync_point = 0; |
1668 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1661 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1669 gpu_process_host_id, | 1662 gpu_process_host_id, |
1670 ack_params); | 1663 ack_params); |
1671 } | 1664 } |
1672 | 1665 |
1673 } // namespace content | 1666 } // namespace content |
OLD | NEW |