OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 #include "content/browser/renderer_host/render_widget_host_impl.h" | 113 #include "content/browser/renderer_host/render_widget_host_impl.h" |
114 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 114 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
115 #include "content/browser/resolve_proxy_msg_helper.h" | 115 #include "content/browser/resolve_proxy_msg_helper.h" |
116 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 116 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
117 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 117 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
118 #include "content/browser/shared_worker/shared_worker_message_filter.h" | 118 #include "content/browser/shared_worker/shared_worker_message_filter.h" |
119 #include "content/browser/shared_worker/worker_storage_partition.h" | 119 #include "content/browser/shared_worker/worker_storage_partition.h" |
120 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 120 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
121 #include "content/browser/storage_partition_impl.h" | 121 #include "content/browser/storage_partition_impl.h" |
122 #include "content/browser/streams/stream_context.h" | 122 #include "content/browser/streams/stream_context.h" |
123 #include "content/browser/time_zone_monitor.h" | |
123 #include "content/browser/tracing/trace_message_filter.h" | 124 #include "content/browser/tracing/trace_message_filter.h" |
124 #include "content/browser/websockets/websocket_manager.h" | 125 #include "content/browser/websockets/websocket_manager.h" |
125 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 126 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
126 #include "content/common/child_process_host_impl.h" | 127 #include "content/common/child_process_host_impl.h" |
127 #include "content/common/child_process_messages.h" | 128 #include "content/common/child_process_messages.h" |
128 #include "content/common/content_switches_internal.h" | 129 #include "content/common/content_switches_internal.h" |
129 #include "content/common/frame_messages.h" | 130 #include "content/common/frame_messages.h" |
130 #include "content/common/gpu_host_messages.h" | 131 #include "content/common/gpu_host_messages.h" |
131 #include "content/common/in_process_child_thread_params.h" | 132 #include "content/common/in_process_child_thread_params.h" |
132 #include "content/common/mojo/constants.h" | 133 #include "content/common/mojo/constants.h" |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1228 AddUIThreadInterface( | 1229 AddUIThreadInterface( |
1229 registry.get(), | 1230 registry.get(), |
1230 base::Bind(&BroadcastChannelProvider::Connect, | 1231 base::Bind(&BroadcastChannelProvider::Connect, |
1231 base::Unretained( | 1232 base::Unretained( |
1232 storage_partition_impl_->GetBroadcastChannelProvider()))); | 1233 storage_partition_impl_->GetBroadcastChannelProvider()))); |
1233 if (memory_coordinator::IsEnabled()) { | 1234 if (memory_coordinator::IsEnabled()) { |
1234 AddUIThreadInterface( | 1235 AddUIThreadInterface( |
1235 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); | 1236 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); |
1236 } | 1237 } |
1237 | 1238 |
1239 AddUIThreadInterface( | |
1240 registry.get(), | |
1241 base::Bind(&TimeZoneMonitor::Bind, | |
1242 base::Unretained( | |
1243 BrowserMainLoop::GetInstance()->time_zone_monitor()))); | |
dcheng
2016/09/06 22:20:38
With some hand-waving, I can see how the use of ba
blundell
2016/09/07 14:40:05
OK, I had to dig into this to respond to your ques
| |
1244 | |
1238 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1245 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
1239 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1246 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
1240 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), | 1247 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
1241 file_task_runner); | 1248 file_task_runner); |
1242 #if defined(USE_MINIKIN_HYPHENATION) | 1249 #if defined(USE_MINIKIN_HYPHENATION) |
1243 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), | 1250 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
1244 file_task_runner); | 1251 file_task_runner); |
1245 #endif | 1252 #endif |
1246 | 1253 |
1247 // These callbacks will be run immediately on the IO thread. | 1254 // These callbacks will be run immediately on the IO thread. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1282 | 1289 |
1283 int RenderProcessHostImpl::GetNextRoutingID() { | 1290 int RenderProcessHostImpl::GetNextRoutingID() { |
1284 return widget_helper_->GetNextRoutingID(); | 1291 return widget_helper_->GetNextRoutingID(); |
1285 } | 1292 } |
1286 | 1293 |
1287 void RenderProcessHostImpl::ResumeDeferredNavigation( | 1294 void RenderProcessHostImpl::ResumeDeferredNavigation( |
1288 const GlobalRequestID& request_id) { | 1295 const GlobalRequestID& request_id) { |
1289 widget_helper_->ResumeDeferredNavigation(request_id); | 1296 widget_helper_->ResumeDeferredNavigation(request_id); |
1290 } | 1297 } |
1291 | 1298 |
1292 void RenderProcessHostImpl::NotifyTimezoneChange(const std::string& zone_id) { | |
1293 Send(new ViewMsg_TimezoneChange(zone_id)); | |
1294 } | |
1295 | |
1296 shell::InterfaceProvider* RenderProcessHostImpl::GetRemoteInterfaces() { | 1299 shell::InterfaceProvider* RenderProcessHostImpl::GetRemoteInterfaces() { |
1297 return mojo_child_connection_->GetRemoteInterfaces(); | 1300 return mojo_child_connection_->GetRemoteInterfaces(); |
1298 } | 1301 } |
1299 | 1302 |
1300 std::unique_ptr<base::SharedPersistentMemoryAllocator> | 1303 std::unique_ptr<base::SharedPersistentMemoryAllocator> |
1301 RenderProcessHostImpl::TakeMetricsAllocator() { | 1304 RenderProcessHostImpl::TakeMetricsAllocator() { |
1302 return std::move(metrics_allocator_); | 1305 return std::move(metrics_allocator_); |
1303 } | 1306 } |
1304 | 1307 |
1305 const base::TimeTicks& RenderProcessHostImpl::GetInitTimeForNavigationMetrics() | 1308 const base::TimeTicks& RenderProcessHostImpl::GetInitTimeForNavigationMetrics() |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2934 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2937 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2935 | 2938 |
2936 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2939 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2937 // enough information here so that we can determine what the bad message was. | 2940 // enough information here so that we can determine what the bad message was. |
2938 base::debug::Alias(&error); | 2941 base::debug::Alias(&error); |
2939 bad_message::ReceivedBadMessage(process.get(), | 2942 bad_message::ReceivedBadMessage(process.get(), |
2940 bad_message::RPH_MOJO_PROCESS_ERROR); | 2943 bad_message::RPH_MOJO_PROCESS_ERROR); |
2941 } | 2944 } |
2942 | 2945 |
2943 } // namespace content | 2946 } // namespace content |
OLD | NEW |