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

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

Issue 2433203003: Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process (Closed)
Patch Set: code rebase 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 // whole process including renderers. 506 // whole process including renderers.
507 channel_->AddFilter(new tracing::ChildTraceMessageFilter( 507 channel_->AddFilter(new tracing::ChildTraceMessageFilter(
508 ChildProcess::current()->io_task_runner())); 508 ChildProcess::current()->io_task_runner()));
509 channel_->AddFilter(new ChildMemoryMessageFilter()); 509 channel_->AddFilter(new ChildMemoryMessageFilter());
510 } 510 }
511 511
512 // In single process mode we may already have a power monitor 512 // In single process mode we may already have a power monitor
513 if (!base::PowerMonitor::Get()) { 513 if (!base::PowerMonitor::Get()) {
514 std::unique_ptr<PowerMonitorBroadcastSource> power_monitor_source( 514 std::unique_ptr<PowerMonitorBroadcastSource> power_monitor_source(
515 new PowerMonitorBroadcastSource()); 515 new PowerMonitorBroadcastSource());
516 channel_->AddFilter(power_monitor_source->GetMessageFilter());
517
518 power_monitor_.reset( 516 power_monitor_.reset(
519 new base::PowerMonitor(std::move(power_monitor_source))); 517 new base::PowerMonitor(std::move(power_monitor_source)));
520 } 518 }
521 519
522 #if defined(OS_POSIX) 520 #if defined(OS_POSIX)
523 // Check that --process-type is specified so we don't do this in unit tests 521 // Check that --process-type is specified so we don't do this in unit tests
524 // and single-process mode. 522 // and single-process mode.
525 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) 523 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType))
526 channel_->AddFilter(new SuicideOnChannelErrorFilter()); 524 channel_->AddFilter(new SuicideOnChannelErrorFilter());
527 #endif 525 #endif
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 Listener* route = router_.GetRoute(routing_id); 852 Listener* route = router_.GetRoute(routing_id);
855 if (route) 853 if (route)
856 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); 854 route->OnAssociatedInterfaceRequest(name, request.PassHandle());
857 } 855 }
858 856
859 bool ChildThreadImpl::IsInBrowserProcess() const { 857 bool ChildThreadImpl::IsInBrowserProcess() const {
860 return static_cast<bool>(browser_process_io_runner_); 858 return static_cast<bool>(browser_process_io_runner_);
861 } 859 }
862 860
863 } // namespace content 861 } // 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