| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 mojo::ScopedMessagePipeHandle host_handle = | 139 mojo::ScopedMessagePipeHandle host_handle = |
| 140 mojo::edk::CreateParentMessagePipe(channel_id_, child_token); | 140 mojo::edk::CreateParentMessagePipe(channel_id_, child_token); |
| 141 channel_ = IPC::ChannelMojo::Create(std::move(host_handle), | 141 channel_ = IPC::ChannelMojo::Create(std::move(host_handle), |
| 142 IPC::Channel::MODE_SERVER, this); | 142 IPC::Channel::MODE_SERVER, this); |
| 143 if (!channel_ || !InitChannel()) | 143 if (!channel_ || !InitChannel()) |
| 144 return std::string(); | 144 return std::string(); |
| 145 | 145 |
| 146 return channel_id_; | 146 return channel_id_; |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool ChildProcessHostImpl::CreateChannelMojoWithBootstrap( |
| 150 mojo::ScopedMessagePipeHandle handle) { |
| 151 channel_ = IPC::ChannelMojo::Create(std::move(handle), |
| 152 IPC::Channel::MODE_SERVER, this); |
| 153 return channel_ && InitChannel(); |
| 154 } |
| 155 |
| 149 std::string ChildProcessHostImpl::CreateChannel() { | 156 std::string ChildProcessHostImpl::CreateChannel() { |
| 150 DCHECK(channel_id_.empty()); | 157 DCHECK(channel_id_.empty()); |
| 151 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); | 158 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); |
| 152 channel_ = IPC::Channel::CreateServer(channel_id_, this); | 159 channel_ = IPC::Channel::CreateServer(channel_id_, this); |
| 153 if (!channel_ || !InitChannel()) | 160 if (!channel_ || !InitChannel()) |
| 154 return std::string(); | 161 return std::string(); |
| 155 | 162 |
| 156 return channel_id_; | 163 return channel_id_; |
| 157 } | 164 } |
| 158 | 165 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 360 } |
| 354 | 361 |
| 355 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 362 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 356 gfx::GpuMemoryBufferId id, | 363 gfx::GpuMemoryBufferId id, |
| 357 const gpu::SyncToken& sync_token) { | 364 const gpu::SyncToken& sync_token) { |
| 358 // Note: Nothing to do here as ownership of shared memory backed | 365 // Note: Nothing to do here as ownership of shared memory backed |
| 359 // GpuMemoryBuffers is passed with IPC. | 366 // GpuMemoryBuffers is passed with IPC. |
| 360 } | 367 } |
| 361 | 368 |
| 362 } // namespace content | 369 } // namespace content |
| OLD | NEW |