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

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

Issue 2460723003: Enable connection to Mojo services from Blink (Closed)
Patch Set: Response to reviews Created 4 years 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
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 #include "content/public/common/mojo_channel_switches.h" 158 #include "content/public/common/mojo_channel_switches.h"
159 #include "content/public/common/process_type.h" 159 #include "content/public/common/process_type.h"
160 #include "content/public/common/resource_type.h" 160 #include "content/public/common/resource_type.h"
161 #include "content/public/common/result_codes.h" 161 #include "content/public/common/result_codes.h"
162 #include "content/public/common/sandboxed_process_launcher_delegate.h" 162 #include "content/public/common/sandboxed_process_launcher_delegate.h"
163 #include "content/public/common/service_names.mojom.h" 163 #include "content/public/common/service_names.mojom.h"
164 #include "content/public/common/url_constants.h" 164 #include "content/public/common/url_constants.h"
165 #include "device/battery/battery_monitor_impl.h" 165 #include "device/battery/battery_monitor_impl.h"
166 #include "device/gamepad/gamepad_monitor.h" 166 #include "device/gamepad/gamepad_monitor.h"
167 #include "device/power_monitor/power_monitor_message_broadcaster.h" 167 #include "device/power_monitor/power_monitor_message_broadcaster.h"
168 #include "device/time_zone_monitor/time_zone_monitor.h"
169 #include "gpu/GLES2/gl2extchromium.h" 168 #include "gpu/GLES2/gl2extchromium.h"
170 #include "gpu/command_buffer/client/gpu_switches.h" 169 #include "gpu/command_buffer/client/gpu_switches.h"
171 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 170 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
172 #include "gpu/command_buffer/service/gpu_switches.h" 171 #include "gpu/command_buffer/service/gpu_switches.h"
173 #include "ipc/ipc.mojom.h" 172 #include "ipc/ipc.mojom.h"
174 #include "ipc/ipc_channel.h" 173 #include "ipc/ipc_channel.h"
175 #include "ipc/ipc_channel_mojo.h" 174 #include "ipc/ipc_channel_mojo.h"
176 #include "ipc/ipc_logging.h" 175 #include "ipc/ipc_logging.h"
177 #include "media/base/media_switches.h" 176 #include "media/base/media_switches.h"
178 #include "media/media_features.h" 177 #include "media/media_features.h"
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 AddUIThreadInterface( 1235 AddUIThreadInterface(
1237 registry.get(), 1236 registry.get(),
1238 base::Bind(&BroadcastChannelProvider::Connect, 1237 base::Bind(&BroadcastChannelProvider::Connect,
1239 base::Unretained( 1238 base::Unretained(
1240 storage_partition_impl_->GetBroadcastChannelProvider()))); 1239 storage_partition_impl_->GetBroadcastChannelProvider())));
1241 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { 1240 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
1242 AddUIThreadInterface( 1241 AddUIThreadInterface(
1243 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); 1242 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID()));
1244 } 1243 }
1245 1244
1246 // BrowserMainLoop, which owns TimeZoneMonitor, is alive for the lifetime of
1247 // Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(),
1248 // which shuts down Mojo). Hence, passing that TimeZoneMonitor instance as
1249 // a raw pointer here is safe.
1250 AddUIThreadInterface(
1251 registry.get(),
1252 base::Bind(&device::TimeZoneMonitor::Bind,
1253 base::Unretained(
1254 BrowserMainLoop::GetInstance()->time_zone_monitor())));
1255
1256 AddUIThreadInterface( 1245 AddUIThreadInterface(
1257 registry.get(), 1246 registry.get(),
1258 base::Bind(&device::PowerMonitorMessageBroadcaster::Create)); 1247 base::Bind(&device::PowerMonitorMessageBroadcaster::Create));
1259 1248
1260 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = 1249 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner =
1261 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); 1250 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE);
1262 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), 1251 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create),
1263 file_task_runner); 1252 file_task_runner);
1264 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) 1253 #if BUILDFLAG(USE_MINIKIN_HYPHENATION)
1265 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), 1254 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create),
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3003 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2992 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3004 2993
3005 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 2994 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3006 // Capture the error message in a crash key value. 2995 // Capture the error message in a crash key value.
3007 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 2996 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3008 bad_message::ReceivedBadMessage(render_process_id, 2997 bad_message::ReceivedBadMessage(render_process_id,
3009 bad_message::RPH_MOJO_PROCESS_ERROR); 2998 bad_message::RPH_MOJO_PROCESS_ERROR);
3010 } 2999 }
3011 3000
3012 } // namespace content 3001 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698