| OLD | NEW |
| 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 Loading... |
| 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()); | |
| 521 | |
| 522 power_monitor_.reset( | 520 power_monitor_.reset( |
| 523 new base::PowerMonitor(std::move(power_monitor_source))); | 521 new base::PowerMonitor(std::move(power_monitor_source))); |
| 524 } | 522 } |
| 525 | 523 |
| 526 #if defined(OS_POSIX) | 524 #if defined(OS_POSIX) |
| 527 // Check that --process-type is specified so we don't do this in unit tests | 525 // Check that --process-type is specified so we don't do this in unit tests |
| 528 // and single-process mode. | 526 // and single-process mode. |
| 529 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) | 527 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) |
| 530 channel_->AddFilter(new SuicideOnChannelErrorFilter()); | 528 channel_->AddFilter(new SuicideOnChannelErrorFilter()); |
| 531 #endif | 529 #endif |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 Listener* route = router_.GetRoute(routing_id); | 862 Listener* route = router_.GetRoute(routing_id); |
| 865 if (route) | 863 if (route) |
| 866 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 864 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 867 } | 865 } |
| 868 | 866 |
| 869 bool ChildThreadImpl::IsInBrowserProcess() const { | 867 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 870 return static_cast<bool>(browser_process_io_runner_); | 868 return static_cast<bool>(browser_process_io_runner_); |
| 871 } | 869 } |
| 872 | 870 |
| 873 } // namespace content | 871 } // namespace content |
| OLD | NEW |