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/debug/dump_without_crashing.h" | 10 #include "base/debug/dump_without_crashing.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 delegate_(delegate), | 127 delegate_(delegate), |
128 power_monitor_message_broadcaster_(this), | 128 power_monitor_message_broadcaster_(this), |
129 is_channel_connected_(false) { | 129 is_channel_connected_(false) { |
130 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); | 130 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); |
131 | 131 |
132 #if USE_ATTACHMENT_BROKER | 132 #if USE_ATTACHMENT_BROKER |
133 // Construct the privileged attachment broker early in the life cycle of a | 133 // Construct the privileged attachment broker early in the life cycle of a |
134 // child process. This ensures that when a test is being run in one of the | 134 // child process. This ensures that when a test is being run in one of the |
135 // single process modes, the global attachment broker is the privileged | 135 // single process modes, the global attachment broker is the privileged |
136 // attachment broker, rather than an unprivileged attachment broker. | 136 // attachment broker, rather than an unprivileged attachment broker. |
137 #if defined(OS_MACOSX) && !defined(OS_IOS) | 137 #if defined(OS_MACOSX) |
138 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded( | 138 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded( |
139 MachBroker::GetInstance()); | 139 MachBroker::GetInstance()); |
140 #else | 140 #else |
141 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); | 141 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); |
142 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 142 #endif // defined(OS_MACOSX) |
143 #endif // USE_ATTACHMENT_BROKER | 143 #endif // USE_ATTACHMENT_BROKER |
144 | 144 |
145 child_process_host_.reset(ChildProcessHost::Create(this)); | 145 child_process_host_.reset(ChildProcessHost::Create(this)); |
146 AddFilter(new TraceMessageFilter(data_.id)); | 146 AddFilter(new TraceMessageFilter(data_.id)); |
147 AddFilter(new ProfilerMessageFilter(process_type)); | 147 AddFilter(new ProfilerMessageFilter(process_type)); |
148 AddFilter(new HistogramMessageFilter); | 148 AddFilter(new HistogramMessageFilter); |
149 AddFilter(new MemoryMessageFilter(this, process_type)); | 149 AddFilter(new MemoryMessageFilter(this, process_type)); |
150 | 150 |
151 g_child_process_list.Get().push_back(this); | 151 g_child_process_list.Get().push_back(this); |
152 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); | 152 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 #if defined(OS_WIN) | 441 #if defined(OS_WIN) |
442 | 442 |
443 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 443 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
444 OnChildDisconnected(); | 444 OnChildDisconnected(); |
445 } | 445 } |
446 | 446 |
447 #endif | 447 #endif |
448 | 448 |
449 } // namespace content | 449 } // namespace content |
OLD | NEW |