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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 delegate_->OnChannelError(); | 248 delegate_->OnChannelError(); |
249 } | 249 } |
250 | 250 |
251 void BrowserChildProcessHostImpl::OnBadMessageReceived( | 251 void BrowserChildProcessHostImpl::OnBadMessageReceived( |
252 const IPC::Message& message) { | 252 const IPC::Message& message) { |
253 HistogramBadMessageTerminated(data_.process_type); | 253 HistogramBadMessageTerminated(data_.process_type); |
254 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 254 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
255 switches::kDisableKillAfterBadIPC)) { | 255 switches::kDisableKillAfterBadIPC)) { |
256 return; | 256 return; |
257 } | 257 } |
258 base::KillProcess(child_process_->GetProcess().Handle(), | 258 child_process_->GetProcess().Terminate(RESULT_CODE_KILLED_BAD_MESSAGE, false); |
259 RESULT_CODE_KILLED_BAD_MESSAGE, false); | |
260 } | 259 } |
261 | 260 |
262 bool BrowserChildProcessHostImpl::CanShutdown() { | 261 bool BrowserChildProcessHostImpl::CanShutdown() { |
263 return delegate_->CanShutdown(); | 262 return delegate_->CanShutdown(); |
264 } | 263 } |
265 | 264 |
266 void BrowserChildProcessHostImpl::OnChildDisconnected() { | 265 void BrowserChildProcessHostImpl::OnChildDisconnected() { |
267 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
268 #if defined(OS_WIN) | 267 #if defined(OS_WIN) |
269 // OnChildDisconnected may be called without OnChannelConnected, so stop the | 268 // OnChildDisconnected may be called without OnChannelConnected, so stop the |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 338 |
340 #if defined(OS_WIN) | 339 #if defined(OS_WIN) |
341 | 340 |
342 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 341 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
343 OnChildDisconnected(); | 342 OnChildDisconnected(); |
344 } | 343 } |
345 | 344 |
346 #endif | 345 #endif |
347 | 346 |
348 } // namespace content | 347 } // namespace content |
OLD | NEW |