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/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 AddFilter(new TraceMessageFilter(data_.id)); | 158 AddFilter(new TraceMessageFilter(data_.id)); |
159 AddFilter(new ProfilerMessageFilter(process_type)); | 159 AddFilter(new ProfilerMessageFilter(process_type)); |
160 AddFilter(new HistogramMessageFilter); | 160 AddFilter(new HistogramMessageFilter); |
161 AddFilter(new MemoryMessageFilter(this, process_type)); | 161 AddFilter(new MemoryMessageFilter(this, process_type)); |
162 | 162 |
163 g_child_process_list.Get().push_back(this); | 163 g_child_process_list.Get().push_back(this); |
164 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); | 164 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); |
165 | 165 |
166 if (!service_name.empty()) { | 166 if (!service_name.empty()) { |
167 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 167 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 168 service_manager::Identity child_identity( |
| 169 service_name, service_manager::mojom::kInheritUserID, |
| 170 base::StringPrintf("%d", data_.id)); |
168 child_connection_.reset( | 171 child_connection_.reset( |
169 new ChildConnection(service_name, base::StringPrintf("%d", data_.id), | 172 new ChildConnection(child_identity, pending_connection_.get(), |
170 pending_connection_.get(), | |
171 ServiceManagerContext::GetConnectorForIOThread(), | 173 ServiceManagerContext::GetConnectorForIOThread(), |
172 base::ThreadTaskRunnerHandle::Get())); | 174 base::ThreadTaskRunnerHandle::Get())); |
173 } | 175 } |
174 | 176 |
175 // Create a persistent memory segment for subprocess histograms. | 177 // Create a persistent memory segment for subprocess histograms. |
176 CreateMetricsAllocator(); | 178 CreateMetricsAllocator(); |
177 } | 179 } |
178 | 180 |
179 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { | 181 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { |
180 g_child_process_list.Get().remove(this); | 182 g_child_process_list.Get().remove(this); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 592 |
591 #if defined(OS_WIN) | 593 #if defined(OS_WIN) |
592 | 594 |
593 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 595 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
594 OnChildDisconnected(); | 596 OnChildDisconnected(); |
595 } | 597 } |
596 | 598 |
597 #endif | 599 #endif |
598 | 600 |
599 } // namespace content | 601 } // namespace content |
OLD | NEW |