| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 filter->OnFilterAdded(channel_.get()); | 125 filter->OnFilterAdded(channel_.get()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void ChildProcessHostImpl::ForceShutdown() { | 128 void ChildProcessHostImpl::ForceShutdown() { |
| 129 Send(new ChildProcessMsg_Shutdown()); | 129 Send(new ChildProcessMsg_Shutdown()); |
| 130 } | 130 } |
| 131 | 131 |
| 132 std::string ChildProcessHostImpl::CreateChannel() { | 132 std::string ChildProcessHostImpl::CreateChannel() { |
| 133 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); | 133 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); |
| 134 channel_ = IPC::Channel::CreateServer(channel_id_, this); | 134 channel_ = IPC::Channel::CreateServer(channel_id_, this); |
| 135 if (!channel_->Connect()) | |
| 136 return std::string(); | |
| 137 #if USE_ATTACHMENT_BROKER | 135 #if USE_ATTACHMENT_BROKER |
| 138 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( | 136 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( |
| 139 channel_.get()); | 137 channel_.get()); |
| 140 #endif | 138 #endif |
| 139 if (!channel_->Connect()) { |
| 140 #if USE_ATTACHMENT_BROKER |
| 141 IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel( |
| 142 channel_.get()); |
| 143 #endif |
| 144 return std::string(); |
| 145 } |
| 141 | 146 |
| 142 for (size_t i = 0; i < filters_.size(); ++i) | 147 for (size_t i = 0; i < filters_.size(); ++i) |
| 143 filters_[i]->OnFilterAdded(channel_.get()); | 148 filters_[i]->OnFilterAdded(channel_.get()); |
| 144 | 149 |
| 145 // Make sure these messages get sent first. | 150 // Make sure these messages get sent first. |
| 146 #if defined(IPC_MESSAGE_LOG_ENABLED) | 151 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 147 bool enabled = IPC::Logging::GetInstance()->Enabled(); | 152 bool enabled = IPC::Logging::GetInstance()->Enabled(); |
| 148 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); | 153 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); |
| 149 #endif | 154 #endif |
| 150 | 155 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 328 } |
| 324 | 329 |
| 325 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 330 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 326 gfx::GpuMemoryBufferId id, | 331 gfx::GpuMemoryBufferId id, |
| 327 const gpu::SyncToken& sync_token) { | 332 const gpu::SyncToken& sync_token) { |
| 328 // Note: Nothing to do here as ownership of shared memory backed | 333 // Note: Nothing to do here as ownership of shared memory backed |
| 329 // GpuMemoryBuffers is passed with IPC. | 334 // GpuMemoryBuffers is passed with IPC. |
| 330 } | 335 } |
| 331 | 336 |
| 332 } // namespace content | 337 } // namespace content |
| OLD | NEW |