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/common/child_process_host_impl.h" | 5 #include "content/common/child_process_host_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 ChildProcessHostImpl::ChildProcessHostImpl(ChildProcessHostDelegate* delegate) | 83 ChildProcessHostImpl::ChildProcessHostImpl(ChildProcessHostDelegate* delegate) |
84 : delegate_(delegate), | 84 : delegate_(delegate), |
85 opening_channel_(false) { | 85 opening_channel_(false) { |
86 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
87 AddFilter(new FontCacheDispatcher()); | 87 AddFilter(new FontCacheDispatcher()); |
88 #endif | 88 #endif |
89 | 89 |
90 #if USE_ATTACHMENT_BROKER | 90 #if USE_ATTACHMENT_BROKER |
91 #if defined(OS_MACOSX) && !defined(OS_IOS) | 91 #if defined(OS_MACOSX) |
92 // On Mac, the privileged AttachmentBroker needs a reference to the Mach port | 92 // On Mac, the privileged AttachmentBroker needs a reference to the Mach port |
93 // Provider, which is only available in the chrome/ module. The attachment | 93 // Provider, which is only available in the chrome/ module. The attachment |
94 // broker must already be created. | 94 // broker must already be created. |
95 DCHECK(IPC::AttachmentBroker::GetGlobal()); | 95 DCHECK(IPC::AttachmentBroker::GetGlobal()); |
96 #else | 96 #else |
97 // Construct the privileged attachment broker early in the life cycle of a | 97 // Construct the privileged attachment broker early in the life cycle of a |
98 // child process. | 98 // child process. |
99 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); | 99 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); |
100 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 100 #endif // defined(OS_MACOSX) |
101 #endif // USE_ATTACHMENT_BROKER | 101 #endif // USE_ATTACHMENT_BROKER |
102 } | 102 } |
103 | 103 |
104 ChildProcessHostImpl::~ChildProcessHostImpl() { | 104 ChildProcessHostImpl::~ChildProcessHostImpl() { |
105 // If a channel was never created than it wasn't registered and the filters | 105 // If a channel was never created than it wasn't registered and the filters |
106 // weren't notified. For the sake of symmetry don't call the matching teardown | 106 // weren't notified. For the sake of symmetry don't call the matching teardown |
107 // functions. This is analogous to how RenderProcessHostImpl handles things. | 107 // functions. This is analogous to how RenderProcessHostImpl handles things. |
108 if (!channel_) | 108 if (!channel_) |
109 return; | 109 return; |
110 | 110 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 323 } |
324 | 324 |
325 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 325 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
326 gfx::GpuMemoryBufferId id, | 326 gfx::GpuMemoryBufferId id, |
327 const gpu::SyncToken& sync_token) { | 327 const gpu::SyncToken& sync_token) { |
328 // Note: Nothing to do here as ownership of shared memory backed | 328 // Note: Nothing to do here as ownership of shared memory backed |
329 // GpuMemoryBuffers is passed with IPC. | 329 // GpuMemoryBuffers is passed with IPC. |
330 } | 330 } |
331 | 331 |
332 } // namespace content | 332 } // namespace content |
OLD | NEW |