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

Unified Diff: components/password_manager/content/browser/bad_message.cc

Issue 1212163007: Kill renderers for bad password forms in --site-per-process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: components/password_manager/content/browser/bad_message.cc
diff --git a/components/password_manager/content/browser/bad_message.cc b/components/password_manager/content/browser/bad_message.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b1525566e072a24ef5a02df87dd2820c84d92a53
--- /dev/null
+++ b/components/password_manager/content/browser/bad_message.cc
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/password_manager/content/browser/bad_message.h"
+
+#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
+#include "content/public/browser/render_process_host.h"
+
+namespace password_manager {
+namespace bad_message {
+
+void ReceivedBadMessage(content::RenderProcessHost* host,
+ BadMessageReason reason) {
+ LOG(ERROR)
+ << "Terminating renderer for bad PasswordManager IPC message, reason "
+ << static_cast<int>(reason);
+ UMA_HISTOGRAM_ENUMERATION(
+ "Stability.BadMessageTerminated.PasswordManager",
+ static_cast<int>(reason),
+ static_cast<int>(BadMessageReason::BAD_MESSAGE_MAX));
+ host->ShutdownForBadMessage();
+}
+
+} // namespace bad_message
+} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698