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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 void NotifyProcessCrashed(const ChildProcessData& data) { | 55 void NotifyProcessCrashed(const ChildProcessData& data) { |
56 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), | 56 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), |
57 BrowserChildProcessCrashed(data)); | 57 BrowserChildProcessCrashed(data)); |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 BrowserChildProcessHost* BrowserChildProcessHost::Create( | 62 BrowserChildProcessHost* BrowserChildProcessHost::Create( |
63 int process_type, | 63 content::ProcessType process_type, |
64 BrowserChildProcessHostDelegate* delegate) { | 64 BrowserChildProcessHostDelegate* delegate) { |
65 return new BrowserChildProcessHostImpl(process_type, delegate); | 65 return new BrowserChildProcessHostImpl(process_type, delegate); |
66 } | 66 } |
67 | 67 |
68 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
69 base::ProcessMetrics::PortProvider* BrowserChildProcessHost::GetPortProvider() { | 69 base::ProcessMetrics::PortProvider* BrowserChildProcessHost::GetPortProvider() { |
70 return MachBroker::GetInstance(); | 70 return MachBroker::GetInstance(); |
71 } | 71 } |
72 #endif | 72 #endif |
73 | 73 |
(...skipping 11 matching lines...) Expand all Loading... |
85 } | 85 } |
86 | 86 |
87 // static | 87 // static |
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 content::ProcessType 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 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); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 #if defined(OS_WIN) | 343 #if defined(OS_WIN) |
344 | 344 |
345 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 345 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
346 OnChildDisconnected(); | 346 OnChildDisconnected(); |
347 } | 347 } |
348 | 348 |
349 #endif | 349 #endif |
350 | 350 |
351 } // namespace content | 351 } // namespace content |
OLD | NEW |