| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 opening_channel_ = false; | 286 opening_channel_ = false; |
| 287 delegate_->OnChannelError(); | 287 delegate_->OnChannelError(); |
| 288 | 288 |
| 289 for (size_t i = 0; i < filters_.size(); ++i) | 289 for (size_t i = 0; i < filters_.size(); ++i) |
| 290 filters_[i]->OnChannelError(); | 290 filters_[i]->OnChannelError(); |
| 291 | 291 |
| 292 // This will delete host_, which will also destroy this! | 292 // This will delete host_, which will also destroy this! |
| 293 delegate_->OnChildDisconnected(); | 293 delegate_->OnChildDisconnected(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void ChildProcessHostImpl::OnBadMessageReceived(const IPC::Message& message) { |
| 297 delegate_->OnBadMessageReceived(message); |
| 298 } |
| 299 |
| 296 void ChildProcessHostImpl::OnAllocateSharedMemory( | 300 void ChildProcessHostImpl::OnAllocateSharedMemory( |
| 297 uint32 buffer_size, | 301 uint32 buffer_size, |
| 298 base::SharedMemoryHandle* handle) { | 302 base::SharedMemoryHandle* handle) { |
| 299 AllocateSharedMemory(buffer_size, peer_handle_, handle); | 303 AllocateSharedMemory(buffer_size, peer_handle_, handle); |
| 300 } | 304 } |
| 301 | 305 |
| 302 void ChildProcessHostImpl::OnShutdownRequest() { | 306 void ChildProcessHostImpl::OnShutdownRequest() { |
| 303 if (delegate_->CanShutdown()) | 307 if (delegate_->CanShutdown()) |
| 304 Send(new ChildProcessMsg_Shutdown()); | 308 Send(new ChildProcessMsg_Shutdown()); |
| 305 } | 309 } |
| 306 | 310 |
| 307 void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer( | 311 void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer( |
| 308 uint32 width, | 312 uint32 width, |
| 309 uint32 height, | 313 uint32 height, |
| 310 uint32 internalformat, | 314 uint32 internalformat, |
| 311 uint32 usage, | 315 uint32 usage, |
| 312 gfx::GpuMemoryBufferHandle* handle) { | 316 gfx::GpuMemoryBufferHandle* handle) { |
| 313 handle->type = gfx::SHARED_MEMORY_BUFFER; | 317 handle->type = gfx::SHARED_MEMORY_BUFFER; |
| 314 AllocateSharedMemory( | 318 AllocateSharedMemory( |
| 315 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), | 319 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), |
| 316 peer_handle_, | 320 peer_handle_, |
| 317 &handle->handle); | 321 &handle->handle); |
| 318 } | 322 } |
| 319 | 323 |
| 320 } // namespace content | 324 } // namespace content |
| OLD | NEW |