| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 #include "content/public/common/mojo_channel_switches.h" | 159 #include "content/public/common/mojo_channel_switches.h" |
| 160 #include "content/public/common/process_type.h" | 160 #include "content/public/common/process_type.h" |
| 161 #include "content/public/common/resource_type.h" | 161 #include "content/public/common/resource_type.h" |
| 162 #include "content/public/common/result_codes.h" | 162 #include "content/public/common/result_codes.h" |
| 163 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 163 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
| 164 #include "content/public/common/service_names.mojom.h" | 164 #include "content/public/common/service_names.mojom.h" |
| 165 #include "content/public/common/url_constants.h" | 165 #include "content/public/common/url_constants.h" |
| 166 #include "device/battery/battery_monitor_impl.h" | 166 #include "device/battery/battery_monitor_impl.h" |
| 167 #include "device/gamepad/gamepad_monitor.h" | 167 #include "device/gamepad/gamepad_monitor.h" |
| 168 #include "device/power_monitor/power_monitor_message_broadcaster.h" | 168 #include "device/power_monitor/power_monitor_message_broadcaster.h" |
| 169 #include "device/time_zone_monitor/time_zone_monitor.h" | |
| 170 #include "gpu/GLES2/gl2extchromium.h" | 169 #include "gpu/GLES2/gl2extchromium.h" |
| 171 #include "gpu/command_buffer/client/gpu_switches.h" | 170 #include "gpu/command_buffer/client/gpu_switches.h" |
| 172 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 171 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 173 #include "gpu/command_buffer/service/gpu_switches.h" | 172 #include "gpu/command_buffer/service/gpu_switches.h" |
| 174 #include "gpu/ipc/host/gpu_memory_buffer_support.h" | 173 #include "gpu/ipc/host/gpu_memory_buffer_support.h" |
| 175 #include "ipc/ipc.mojom.h" | 174 #include "ipc/ipc.mojom.h" |
| 176 #include "ipc/ipc_channel.h" | 175 #include "ipc/ipc_channel.h" |
| 177 #include "ipc/ipc_channel_mojo.h" | 176 #include "ipc/ipc_channel_mojo.h" |
| 178 #include "ipc/ipc_logging.h" | 177 #include "ipc/ipc_logging.h" |
| 179 #include "media/base/media_switches.h" | 178 #include "media/base/media_switches.h" |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 AddUIThreadInterface( | 1239 AddUIThreadInterface( |
| 1241 registry.get(), | 1240 registry.get(), |
| 1242 base::Bind(&BroadcastChannelProvider::Connect, | 1241 base::Bind(&BroadcastChannelProvider::Connect, |
| 1243 base::Unretained( | 1242 base::Unretained( |
| 1244 storage_partition_impl_->GetBroadcastChannelProvider()))); | 1243 storage_partition_impl_->GetBroadcastChannelProvider()))); |
| 1245 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { | 1244 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
| 1246 AddUIThreadInterface( | 1245 AddUIThreadInterface( |
| 1247 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); | 1246 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); |
| 1248 } | 1247 } |
| 1249 | 1248 |
| 1250 // BrowserMainLoop, which owns TimeZoneMonitor, is alive for the lifetime of | |
| 1251 // Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), | |
| 1252 // which shuts down Mojo). Hence, passing that TimeZoneMonitor instance as | |
| 1253 // a raw pointer here is safe. | |
| 1254 AddUIThreadInterface( | |
| 1255 registry.get(), | |
| 1256 base::Bind(&device::TimeZoneMonitor::Bind, | |
| 1257 base::Unretained( | |
| 1258 BrowserMainLoop::GetInstance()->time_zone_monitor()))); | |
| 1259 | |
| 1260 AddUIThreadInterface( | 1249 AddUIThreadInterface( |
| 1261 registry.get(), | 1250 registry.get(), |
| 1262 base::Bind(&device::PowerMonitorMessageBroadcaster::Create)); | 1251 base::Bind(&device::PowerMonitorMessageBroadcaster::Create)); |
| 1263 | 1252 |
| 1264 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1253 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
| 1265 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1254 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
| 1266 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), | 1255 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
| 1267 file_task_runner); | 1256 file_task_runner); |
| 1268 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) | 1257 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) |
| 1269 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), | 1258 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
| (...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3024 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3013 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3025 | 3014 |
| 3026 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3015 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3027 // Capture the error message in a crash key value. | 3016 // Capture the error message in a crash key value. |
| 3028 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3017 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3029 bad_message::ReceivedBadMessage(render_process_id, | 3018 bad_message::ReceivedBadMessage(render_process_id, |
| 3030 bad_message::RPH_MOJO_PROCESS_ERROR); | 3019 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3031 } | 3020 } |
| 3032 | 3021 |
| 3033 } // namespace content | 3022 } // namespace content |
| OLD | NEW |