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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 power_monitor_message_broadcaster_(this) { | 99 power_monitor_message_broadcaster_(this) { |
100 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); | 100 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); |
101 | 101 |
102 child_process_host_.reset(ChildProcessHost::Create(this)); | 102 child_process_host_.reset(ChildProcessHost::Create(this)); |
103 AddFilter(new TraceMessageFilter); | 103 AddFilter(new TraceMessageFilter); |
104 AddFilter(new ProfilerMessageFilter(process_type)); | 104 AddFilter(new ProfilerMessageFilter(process_type)); |
105 AddFilter(new HistogramMessageFilter); | 105 AddFilter(new HistogramMessageFilter); |
106 | 106 |
107 g_child_process_list.Get().push_back(this); | 107 g_child_process_list.Get().push_back(this); |
108 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); | 108 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); |
| 109 |
| 110 power_monitor_message_broadcaster_.Init(); |
109 } | 111 } |
110 | 112 |
111 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { | 113 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { |
112 g_child_process_list.Get().remove(this); | 114 g_child_process_list.Get().remove(this); |
113 | 115 |
114 #if defined(OS_WIN) | 116 #if defined(OS_WIN) |
115 DeleteProcessWaitableEvent(early_exit_watcher_.GetWatchedEvent()); | 117 DeleteProcessWaitableEvent(early_exit_watcher_.GetWatchedEvent()); |
116 #endif | 118 #endif |
117 } | 119 } |
118 | 120 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 361 |
360 void BrowserChildProcessHostImpl::OnProcessExitedEarly( | 362 void BrowserChildProcessHostImpl::OnProcessExitedEarly( |
361 base::WaitableEvent* event) { | 363 base::WaitableEvent* event) { |
362 DeleteProcessWaitableEvent(event); | 364 DeleteProcessWaitableEvent(event); |
363 OnChildDisconnected(); | 365 OnChildDisconnected(); |
364 } | 366 } |
365 | 367 |
366 #endif | 368 #endif |
367 | 369 |
368 } // namespace content | 370 } // namespace content |
OLD | NEW |