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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void BrowserChildProcessHostImpl::RemoveObserver( | 88 void BrowserChildProcessHostImpl::RemoveObserver( |
89 BrowserChildProcessObserver* observer) { | 89 BrowserChildProcessObserver* observer) { |
90 // TODO(phajdan.jr): Check thread after fixing http://crbug.com/167126. | 90 // TODO(phajdan.jr): Check thread after fixing http://crbug.com/167126. |
91 g_observers.Get().RemoveObserver(observer); | 91 g_observers.Get().RemoveObserver(observer); |
92 } | 92 } |
93 | 93 |
94 BrowserChildProcessHostImpl::BrowserChildProcessHostImpl( | 94 BrowserChildProcessHostImpl::BrowserChildProcessHostImpl( |
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 power_monitor_message_broadcaster_(this) { |
99 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); | 100 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); |
100 | 101 |
101 child_process_host_.reset(ChildProcessHost::Create(this)); | 102 child_process_host_.reset(ChildProcessHost::Create(this)); |
102 child_process_host_->AddFilter(new TraceMessageFilter); | 103 child_process_host_->AddFilter(new TraceMessageFilter); |
103 child_process_host_->AddFilter(new ProfilerMessageFilter(process_type)); | 104 child_process_host_->AddFilter(new ProfilerMessageFilter(process_type)); |
104 child_process_host_->AddFilter(new HistogramMessageFilter()); | 105 child_process_host_->AddFilter(new HistogramMessageFilter()); |
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 } |
(...skipping 234 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 |