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

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: 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 LOG(ERROR) << "Terminating child process for bad IPC message of type "
259 << message.type();
258 base::KillProcess(child_process_->GetProcess().Handle(), 260 base::KillProcess(child_process_->GetProcess().Handle(),
259 RESULT_CODE_KILLED_BAD_MESSAGE, false); 261 RESULT_CODE_KILLED_BAD_MESSAGE, false);
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(BrowserThread::CurrentlyOn(BrowserThread::IO)); 269 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 341
340 #if defined(OS_WIN) 342 #if defined(OS_WIN)
341 343
342 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { 344 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) {
343 OnChildDisconnected(); 345 OnChildDisconnected();
344 } 346 }
345 347
346 #endif 348 #endif
347 349
348 } // namespace content 350 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698