| 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/browser/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 delegate_->OnChannelConnected(peer_pid); | 254 delegate_->OnChannelConnected(peer_pid); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void BrowserChildProcessHostImpl::OnChannelError() { | 257 void BrowserChildProcessHostImpl::OnChannelError() { |
| 258 delegate_->OnChannelError(); | 258 delegate_->OnChannelError(); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void BrowserChildProcessHostImpl::OnBadMessageReceived( | 261 void BrowserChildProcessHostImpl::OnBadMessageReceived( |
| 262 const IPC::Message& message) { | 262 const IPC::Message& message) { |
| 263 HistogramBadMessageTerminated(data_.process_type); | 263 HistogramBadMessageTerminated(data_.process_type); |
| 264 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 265 switches::kDisableKillAfterBadIPC)) { |
| 266 return; |
| 267 } |
| 264 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, false); | 268 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, false); |
| 265 } | 269 } |
| 266 | 270 |
| 267 bool BrowserChildProcessHostImpl::CanShutdown() { | 271 bool BrowserChildProcessHostImpl::CanShutdown() { |
| 268 return delegate_->CanShutdown(); | 272 return delegate_->CanShutdown(); |
| 269 } | 273 } |
| 270 | 274 |
| 271 void BrowserChildProcessHostImpl::OnChildDisconnected() { | 275 void BrowserChildProcessHostImpl::OnChildDisconnected() { |
| 272 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 276 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 273 if (child_process_.get() || data_.handle) { | 277 if (child_process_.get() || data_.handle) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 363 |
| 360 void BrowserChildProcessHostImpl::OnProcessExitedEarly( | 364 void BrowserChildProcessHostImpl::OnProcessExitedEarly( |
| 361 base::WaitableEvent* event) { | 365 base::WaitableEvent* event) { |
| 362 DeleteProcessWaitableEvent(event); | 366 DeleteProcessWaitableEvent(event); |
| 363 OnChildDisconnected(); | 367 OnChildDisconnected(); |
| 364 } | 368 } |
| 365 | 369 |
| 366 #endif | 370 #endif |
| 367 | 371 |
| 368 } // namespace content | 372 } // namespace content |
| OLD | NEW |