Chromium Code Reviews| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 delegate_->OnChannelError(); | 249 delegate_->OnChannelError(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void BrowserChildProcessHostImpl::OnBadMessageReceived( | 252 void BrowserChildProcessHostImpl::OnBadMessageReceived( |
| 253 const IPC::Message& message) { | 253 const IPC::Message& message) { |
| 254 HistogramBadMessageTerminated(data_.process_type); | 254 HistogramBadMessageTerminated(data_.process_type); |
| 255 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 255 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 256 switches::kDisableKillAfterBadIPC)) { | 256 switches::kDisableKillAfterBadIPC)) { |
| 257 return; | 257 return; |
| 258 } | 258 } |
| 259 LOG(ERROR) << "Terminating child process for bad IPC message of type " | |
| 260 << message.type(); | |
| 259 child_process_->GetProcess().Terminate(RESULT_CODE_KILLED_BAD_MESSAGE, false); | 261 child_process_->GetProcess().Terminate(RESULT_CODE_KILLED_BAD_MESSAGE, false); |
|
Charlie Reis
2015/03/18 21:37:51
Would be nice if this one fit the model as well, b
| |
| 260 } | 262 } |
| 261 | 263 |
| 262 bool BrowserChildProcessHostImpl::CanShutdown() { | 264 bool BrowserChildProcessHostImpl::CanShutdown() { |
| 263 return delegate_->CanShutdown(); | 265 return delegate_->CanShutdown(); |
| 264 } | 266 } |
| 265 | 267 |
| 266 void BrowserChildProcessHostImpl::OnChildDisconnected() { | 268 void BrowserChildProcessHostImpl::OnChildDisconnected() { |
| 267 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 269 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 268 #if defined(OS_WIN) | 270 #if defined(OS_WIN) |
| 269 // OnChildDisconnected may be called without OnChannelConnected, so stop the | 271 // OnChildDisconnected may be called without OnChannelConnected, so stop the |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 | 346 |
| 345 #if defined(OS_WIN) | 347 #if defined(OS_WIN) |
| 346 | 348 |
| 347 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 349 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 348 OnChildDisconnected(); | 350 OnChildDisconnected(); |
| 349 } | 351 } |
| 350 | 352 |
| 351 #endif | 353 #endif |
| 352 | 354 |
| 353 } // namespace content | 355 } // namespace content |
| OLD | NEW |