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

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

Issue 2510033002: [Device Service] Move PowerMonitor into the Device Service (Closed)
Patch Set: Created 4 years, 1 month 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 #include "content/public/common/content_features.h" 155 #include "content/public/common/content_features.h"
156 #include "content/public/common/content_switches.h" 156 #include "content/public/common/content_switches.h"
157 #include "content/public/common/mojo_channel_switches.h" 157 #include "content/public/common/mojo_channel_switches.h"
158 #include "content/public/common/process_type.h" 158 #include "content/public/common/process_type.h"
159 #include "content/public/common/resource_type.h" 159 #include "content/public/common/resource_type.h"
160 #include "content/public/common/result_codes.h" 160 #include "content/public/common/result_codes.h"
161 #include "content/public/common/sandboxed_process_launcher_delegate.h" 161 #include "content/public/common/sandboxed_process_launcher_delegate.h"
162 #include "content/public/common/service_names.h" 162 #include "content/public/common/service_names.h"
163 #include "content/public/common/url_constants.h" 163 #include "content/public/common/url_constants.h"
164 #include "device/battery/battery_monitor_impl.h" 164 #include "device/battery/battery_monitor_impl.h"
165 #include "device/power_monitor/power_monitor_message_broadcaster.h"
166 #include "device/time_zone_monitor/time_zone_monitor.h" 165 #include "device/time_zone_monitor/time_zone_monitor.h"
167 #include "gpu/GLES2/gl2extchromium.h" 166 #include "gpu/GLES2/gl2extchromium.h"
168 #include "gpu/command_buffer/client/gpu_switches.h" 167 #include "gpu/command_buffer/client/gpu_switches.h"
169 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 168 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
170 #include "gpu/command_buffer/service/gpu_switches.h" 169 #include "gpu/command_buffer/service/gpu_switches.h"
171 #include "ipc/ipc.mojom.h" 170 #include "ipc/ipc.mojom.h"
172 #include "ipc/ipc_channel.h" 171 #include "ipc/ipc_channel.h"
173 #include "ipc/ipc_channel_mojo.h" 172 #include "ipc/ipc_channel_mojo.h"
174 #include "ipc/ipc_logging.h" 173 #include "ipc/ipc_logging.h"
175 #include "media/base/media_switches.h" 174 #include "media/base/media_switches.h"
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 // BrowserMainLoop, which owns TimeZoneMonitor, is alive for the lifetime of 1243 // BrowserMainLoop, which owns TimeZoneMonitor, is alive for the lifetime of
1245 // Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), 1244 // Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(),
1246 // which shuts down Mojo). Hence, passing that TimeZoneMonitor instance as 1245 // which shuts down Mojo). Hence, passing that TimeZoneMonitor instance as
1247 // a raw pointer here is safe. 1246 // a raw pointer here is safe.
1248 AddUIThreadInterface( 1247 AddUIThreadInterface(
1249 registry.get(), 1248 registry.get(),
1250 base::Bind(&device::TimeZoneMonitor::Bind, 1249 base::Bind(&device::TimeZoneMonitor::Bind,
1251 base::Unretained( 1250 base::Unretained(
1252 BrowserMainLoop::GetInstance()->time_zone_monitor()))); 1251 BrowserMainLoop::GetInstance()->time_zone_monitor())));
1253 1252
1254 AddUIThreadInterface(
1255 registry.get(),
1256 base::Bind(&device::PowerMonitorMessageBroadcaster::Create));
1257
1258 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = 1253 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner =
1259 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); 1254 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE);
1260 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), 1255 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create),
1261 file_task_runner); 1256 file_task_runner);
1262 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) 1257 #if BUILDFLAG(USE_MINIKIN_HYPHENATION)
1263 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), 1258 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create),
1264 file_task_runner); 1259 file_task_runner);
1265 #endif 1260 #endif
1266 1261
1267 #if defined(OS_ANDROID) 1262 #if defined(OS_ANDROID)
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2992 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2998 2993
2999 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 2994 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
3000 // enough information here so that we can determine what the bad message was. 2995 // enough information here so that we can determine what the bad message was.
3001 base::debug::Alias(&error); 2996 base::debug::Alias(&error);
3002 bad_message::ReceivedBadMessage(render_process_id, 2997 bad_message::ReceivedBadMessage(render_process_id,
3003 bad_message::RPH_MOJO_PROCESS_ERROR); 2998 bad_message::RPH_MOJO_PROCESS_ERROR);
3004 } 2999 }
3005 3000
3006 } // namespace content 3001 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698