| 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/atomicops.h" | 9 #include "base/atomicops.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 255 } |
| 256 | 256 |
| 257 #ifdef IPC_MESSAGE_LOG_ENABLED | 257 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 258 if (logger->Enabled()) | 258 if (logger->Enabled()) |
| 259 logger->OnPostDispatchMessage(msg, channel_id_); | 259 logger->OnPostDispatchMessage(msg, channel_id_); |
| 260 #endif | 260 #endif |
| 261 return handled; | 261 return handled; |
| 262 } | 262 } |
| 263 | 263 |
| 264 void ChildProcessHostImpl::OnChannelConnected(int32 peer_pid) { | 264 void ChildProcessHostImpl::OnChannelConnected(int32 peer_pid) { |
| 265 if (!base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle_)) { | 265 if (!peer_handle_) { |
| 266 peer_handle_ = delegate_->GetHandle(); |
| 267 } |
| 268 if (!peer_handle_ && !base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle
_)) { |
| 266 NOTREACHED(); | 269 NOTREACHED(); |
| 267 } | 270 } |
| 268 opening_channel_ = false; | 271 opening_channel_ = false; |
| 269 delegate_->OnChannelConnected(peer_pid); | 272 delegate_->OnChannelConnected(peer_pid); |
| 270 for (size_t i = 0; i < filters_.size(); ++i) | 273 for (size_t i = 0; i < filters_.size(); ++i) |
| 271 filters_[i]->OnChannelConnected(peer_pid); | 274 filters_[i]->OnChannelConnected(peer_pid); |
| 272 } | 275 } |
| 273 | 276 |
| 274 void ChildProcessHostImpl::OnChannelError() { | 277 void ChildProcessHostImpl::OnChannelError() { |
| 275 opening_channel_ = false; | 278 opening_channel_ = false; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 287 base::SharedMemoryHandle* handle) { | 290 base::SharedMemoryHandle* handle) { |
| 288 AllocateSharedMemory(buffer_size, peer_handle_, handle); | 291 AllocateSharedMemory(buffer_size, peer_handle_, handle); |
| 289 } | 292 } |
| 290 | 293 |
| 291 void ChildProcessHostImpl::OnShutdownRequest() { | 294 void ChildProcessHostImpl::OnShutdownRequest() { |
| 292 if (delegate_->CanShutdown()) | 295 if (delegate_->CanShutdown()) |
| 293 Send(new ChildProcessMsg_Shutdown()); | 296 Send(new ChildProcessMsg_Shutdown()); |
| 294 } | 297 } |
| 295 | 298 |
| 296 } // namespace content | 299 } // namespace content |
| OLD | NEW |