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

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

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.h
diff --git a/chrome/browser/bad_message.h b/components/password_manager/content/browser/bad_message.h
similarity index 55%
copy from chrome/browser/bad_message.h
copy to components/password_manager/content/browser/bad_message.h
index 3bdd0d2b3293dfaad4c79ca224b3b43e592c2024..641ca0ed43d3e04367187cf27c90faa6098fdbc8 100644
--- a/chrome/browser/bad_message.h
+++ b/components/password_manager/content/browser/bad_message.h
@@ -2,16 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_BAD_MESSAGE_H_
-#define CHROME_BROWSER_BAD_MESSAGE_H_
+#ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_BAD_MESSAGE_H_
+#define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_BAD_MESSAGE_H_
namespace content {
-class BrowserMessageFilter;
class RenderProcessHost;
}
-namespace bad_message {
-
+namespace password_manager {
// The browser process often chooses to terminate a renderer if it receives
// a bad IPC message. The reasons are tracked for metrics.
//
@@ -19,29 +17,31 @@ namespace bad_message {
//
// NOTE: Do not remove or reorder elements in this list. Add new entries at the
// end. Items may be renamed but do not change the values. We rely on the enum
-// values in histograms.
-enum BadMessageReason {
- WRLHH_LOGGING_STOPPED_BAD_STATE = 0,
+// values in histograms. Also update histograms.xml with any new values by
+// running:
+// python tools/metrics/histograms/update_bad_message_reasons.py
+enum class BadMessageReason {
+ CPMD_BAD_ORIGIN_FORMS_PARSED = 1,
+ CPMD_BAD_ORIGIN_FORMS_RENDERED = 2,
+ CPMD_BAD_ORIGIN_FORM_SUBMITTED = 3,
+ CPMD_BAD_ORIGIN_FOCUSED_PASSWORD_FORM_FOUND = 4,
+ CPMD_BAD_ORIGIN_IN_PAGE_NAVIGATION = 5,
+ CPMD_BAD_ORIGIN_PASSWORD_NO_LONGER_GENERATED = 6,
// Please add new elements here. The naming convention is abbreviated class
- // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
- // reason. After making changes, you MUST update histograms.xml by running:
- // "python tools/metrics/histograms/update_bad_message_reasons.py"
+ // name (e.g. ContentPasswordManagerDriver becomes CPMD) plus a unique
+ // description of the reason.
BAD_MESSAGE_MAX
};
+namespace bad_message {
// Called when the browser receives a bad IPC message from a renderer process on
// the UI thread. Logs the event, records a histogram metric for the |reason|,
// and terminates the process for |host|.
void ReceivedBadMessage(content::RenderProcessHost* host,
BadMessageReason reason);
-// Called when a browser message filter receives a bad IPC message from a
-// renderer or other child process. Logs the event, records a histogram metric
-// for the |reason|, and terminates the process for |filter|.
-void ReceivedBadMessage(content::BrowserMessageFilter* filter,
- BadMessageReason reason);
-
} // namespace bad_message
+} // namespace password_manager
-#endif // CHROME_BROWSER_BAD_MESSAGE_H_
+#endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_BAD_MESSAGE_H_
« no previous file with comments | « components/password_manager/content/browser/BUILD.gn ('k') | components/password_manager/content/browser/bad_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698