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

Unified Diff: content/public/browser/browser_message_filter.cc

Issue 292443004: Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/browser_message_filter.h ('k') | content/public/test/mock_render_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/browser_message_filter.cc
===================================================================
--- content/public/browser/browser_message_filter.cc (revision 271040)
+++ content/public/browser/browser_message_filter.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/process/kill.h"
#include "base/process/process_handle.h"
#include "base/task_runner.h"
+#include "content/browser/browser_child_process_host_impl.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
@@ -87,16 +88,9 @@
// Dispatches a message to the derived class.
bool DispatchMessage(const IPC::Message& message) {
- bool message_was_ok = true;
- bool rv = filter_->OnMessageReceived(message, &message_was_ok);
+ bool rv = filter_->OnMessageReceived(message);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO) || rv) <<
"Must handle messages that were dispatched to another thread!";
- if (!message_was_ok) {
- content::RecordAction(
- base::UserMetricsAction("BadMessageTerminate_BMF"));
- filter_->BadMessageReceived();
- }
-
return rv;
}
@@ -206,11 +200,13 @@
void BrowserMessageFilter::BadMessageReceived() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC))
+ return;
- if (!command_line->HasSwitch(switches::kDisableKillAfterBadIPC)) {
- base::KillProcess(PeerHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE,
- false);
- }
+ BrowserChildProcessHostImpl::HistogramBadMessageTerminated(
+ PROCESS_TYPE_RENDERER);
+ base::KillProcess(PeerHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE,
+ false);
}
BrowserMessageFilter::~BrowserMessageFilter() {
« no previous file with comments | « content/public/browser/browser_message_filter.h ('k') | content/public/test/mock_render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698