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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 if (channel_) | 157 if (channel_) |
158 filter->OnFilterAdded(channel_.get()); | 158 filter->OnFilterAdded(channel_.get()); |
159 } | 159 } |
160 | 160 |
161 void ChildProcessHostImpl::ForceShutdown() { | 161 void ChildProcessHostImpl::ForceShutdown() { |
162 Send(new ChildProcessMsg_Shutdown()); | 162 Send(new ChildProcessMsg_Shutdown()); |
163 } | 163 } |
164 | 164 |
165 std::string ChildProcessHostImpl::CreateChannel() { | 165 std::string ChildProcessHostImpl::CreateChannel() { |
166 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); | 166 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); |
167 channel_ = IPC::Channel::CreateServer(channel_id_, this); | 167 channel_.reset(new IPC::Channel( |
| 168 channel_id_, IPC::Channel::MODE_SERVER, this)); |
168 if (!channel_->Connect()) | 169 if (!channel_->Connect()) |
169 return std::string(); | 170 return std::string(); |
170 | 171 |
171 for (size_t i = 0; i < filters_.size(); ++i) | 172 for (size_t i = 0; i < filters_.size(); ++i) |
172 filters_[i]->OnFilterAdded(channel_.get()); | 173 filters_[i]->OnFilterAdded(channel_.get()); |
173 | 174 |
174 // Make sure these messages get sent first. | 175 // Make sure these messages get sent first. |
175 #if defined(IPC_MESSAGE_LOG_ENABLED) | 176 #if defined(IPC_MESSAGE_LOG_ENABLED) |
176 bool enabled = IPC::Logging::GetInstance()->Enabled(); | 177 bool enabled = IPC::Logging::GetInstance()->Enabled(); |
177 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); | 178 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 uint32 usage, | 315 uint32 usage, |
315 gfx::GpuMemoryBufferHandle* handle) { | 316 gfx::GpuMemoryBufferHandle* handle) { |
316 handle->type = gfx::SHARED_MEMORY_BUFFER; | 317 handle->type = gfx::SHARED_MEMORY_BUFFER; |
317 AllocateSharedMemory( | 318 AllocateSharedMemory( |
318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), | 319 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), |
319 peer_handle_, | 320 peer_handle_, |
320 &handle->handle); | 321 &handle->handle); |
321 } | 322 } |
322 | 323 |
323 } // namespace content | 324 } // namespace content |
OLD | NEW |