Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: content/browser/browser_child_process_host_impl.cc

Issue 1009583004: Add UMA histograms and logging for bad IPC message handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mac Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698