| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 #ifdef IPC_MESSAGE_LOG_ENABLED | 265 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 266 if (logger->Enabled()) | 266 if (logger->Enabled()) |
| 267 logger->OnPostDispatchMessage(msg, channel_id_); | 267 logger->OnPostDispatchMessage(msg, channel_id_); |
| 268 #endif | 268 #endif |
| 269 return handled; | 269 return handled; |
| 270 } | 270 } |
| 271 | 271 |
| 272 void ChildProcessHostImpl::OnChannelConnected(int32 peer_pid) { | 272 void ChildProcessHostImpl::OnChannelConnected(int32 peer_pid) { |
| 273 if (!peer_handle_ && | 273 if (!peer_handle_ && |
| 274 !base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle_) && | 274 !base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle_)) { |
| 275 !(peer_handle_ = delegate_->GetHandle())) { | 275 peer_handle_ = delegate_->GetHandle(); |
| 276 NOTREACHED(); | 276 DCHECK(peer_handle_); |
| 277 } | 277 } |
| 278 opening_channel_ = false; | 278 opening_channel_ = false; |
| 279 delegate_->OnChannelConnected(peer_pid); | 279 delegate_->OnChannelConnected(peer_pid); |
| 280 for (size_t i = 0; i < filters_.size(); ++i) | 280 for (size_t i = 0; i < filters_.size(); ++i) |
| 281 filters_[i]->OnChannelConnected(peer_pid); | 281 filters_[i]->OnChannelConnected(peer_pid); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void ChildProcessHostImpl::OnChannelError() { | 284 void ChildProcessHostImpl::OnChannelError() { |
| 285 opening_channel_ = false; | 285 opening_channel_ = false; |
| 286 delegate_->OnChannelError(); | 286 delegate_->OnChannelError(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 314 uint32 usage, | 314 uint32 usage, |
| 315 gfx::GpuMemoryBufferHandle* handle) { | 315 gfx::GpuMemoryBufferHandle* handle) { |
| 316 handle->type = gfx::SHARED_MEMORY_BUFFER; | 316 handle->type = gfx::SHARED_MEMORY_BUFFER; |
| 317 AllocateSharedMemory( | 317 AllocateSharedMemory( |
| 318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), | 318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), |
| 319 peer_handle_, | 319 peer_handle_, |
| 320 &handle->handle); | 320 &handle->handle); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace content | 323 } // namespace content |
| OLD | NEW |