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

Side by Side Diff: content/child/child_thread_impl.cc

Issue 2447613004: Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process (Closed)
Patch Set: Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process 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
« no previous file with comments | « content/child/DEPS ('k') | content/child/power_monitor_broadcast_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "content/child/child_thread_impl.h" 5 #include "content/child/child_thread_impl.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // whole process including renderers. 510 // whole process including renderers.
511 channel_->AddFilter(new tracing::ChildTraceMessageFilter( 511 channel_->AddFilter(new tracing::ChildTraceMessageFilter(
512 ChildProcess::current()->io_task_runner())); 512 ChildProcess::current()->io_task_runner()));
513 channel_->AddFilter(new ChildMemoryMessageFilter()); 513 channel_->AddFilter(new ChildMemoryMessageFilter());
514 } 514 }
515 515
516 // In single process mode we may already have a power monitor 516 // In single process mode we may already have a power monitor
517 if (!base::PowerMonitor::Get()) { 517 if (!base::PowerMonitor::Get()) {
518 std::unique_ptr<PowerMonitorBroadcastSource> power_monitor_source( 518 std::unique_ptr<PowerMonitorBroadcastSource> power_monitor_source(
519 new PowerMonitorBroadcastSource()); 519 new PowerMonitorBroadcastSource());
520 channel_->AddFilter(power_monitor_source->GetMessageFilter()); 520 device::mojom::PowerMonitorPtr power_monitor_register;
521 GetRemoteInterfaces()->GetInterface(
522 mojo::GetProxy(&power_monitor_register));
523 power_monitor_source->AddClient(std::move(power_monitor_register));
521 524
522 power_monitor_.reset( 525 power_monitor_.reset(
523 new base::PowerMonitor(std::move(power_monitor_source))); 526 new base::PowerMonitor(std::move(power_monitor_source)));
524 } 527 }
525 528
526 #if defined(OS_POSIX) 529 #if defined(OS_POSIX)
527 // Check that --process-type is specified so we don't do this in unit tests 530 // Check that --process-type is specified so we don't do this in unit tests
528 // and single-process mode. 531 // and single-process mode.
529 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) 532 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType))
530 channel_->AddFilter(new SuicideOnChannelErrorFilter()); 533 channel_->AddFilter(new SuicideOnChannelErrorFilter());
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 Listener* route = router_.GetRoute(routing_id); 867 Listener* route = router_.GetRoute(routing_id);
865 if (route) 868 if (route)
866 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); 869 route->OnAssociatedInterfaceRequest(name, request.PassHandle());
867 } 870 }
868 871
869 bool ChildThreadImpl::IsInBrowserProcess() const { 872 bool ChildThreadImpl::IsInBrowserProcess() const {
870 return static_cast<bool>(browser_process_io_runner_); 873 return static_cast<bool>(browser_process_io_runner_);
871 } 874 }
872 875
873 } // namespace content 876 } // namespace content
OLDNEW
« no previous file with comments | « content/child/DEPS ('k') | content/child/power_monitor_broadcast_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698