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/browser/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 int process_type, | 95 int process_type, |
96 BrowserChildProcessHostDelegate* delegate) | 96 BrowserChildProcessHostDelegate* delegate) |
97 : data_(process_type), | 97 : data_(process_type), |
98 delegate_(delegate) { | 98 delegate_(delegate) { |
99 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); | 99 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); |
100 | 100 |
101 child_process_host_.reset(ChildProcessHost::Create(this)); | 101 child_process_host_.reset(ChildProcessHost::Create(this)); |
102 child_process_host_->AddFilter(new TraceMessageFilter); | 102 child_process_host_->AddFilter(new TraceMessageFilter); |
103 child_process_host_->AddFilter(new ProfilerMessageFilter(process_type)); | 103 child_process_host_->AddFilter(new ProfilerMessageFilter(process_type)); |
104 child_process_host_->AddFilter(new HistogramMessageFilter()); | 104 child_process_host_->AddFilter(new HistogramMessageFilter()); |
| 105 child_process_host_->AddFilter(new PowerMonitorMessageFilter()); |
105 | 106 |
106 g_child_process_list.Get().push_back(this); | 107 g_child_process_list.Get().push_back(this); |
107 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); | 108 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); |
108 } | 109 } |
109 | 110 |
110 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { | 111 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { |
111 g_child_process_list.Get().remove(this); | 112 g_child_process_list.Get().remove(this); |
112 | 113 |
113 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
114 DeleteProcessWaitableEvent(early_exit_watcher_.GetWatchedEvent()); | 115 DeleteProcessWaitableEvent(early_exit_watcher_.GetWatchedEvent()); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 344 |
344 void BrowserChildProcessHostImpl::OnProcessExitedEarly( | 345 void BrowserChildProcessHostImpl::OnProcessExitedEarly( |
345 base::WaitableEvent* event) { | 346 base::WaitableEvent* event) { |
346 DeleteProcessWaitableEvent(event); | 347 DeleteProcessWaitableEvent(event); |
347 OnChildDisconnected(); | 348 OnChildDisconnected(); |
348 } | 349 } |
349 | 350 |
350 #endif | 351 #endif |
351 | 352 |
352 } // namespace content | 353 } // namespace content |
OLD | NEW |