OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_BAD_MESSAGE_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_BAD_MESSAGE_H_ |
6 #define CHROME_BROWSER_BAD_MESSAGE_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_BAD_MESSAGE_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 class BrowserMessageFilter; | |
10 class RenderProcessHost; | 9 class RenderProcessHost; |
11 } | 10 } |
12 | 11 |
12 namespace password_manager { | |
13 namespace bad_message { | 13 namespace bad_message { |
14 | 14 |
15 // The browser process often chooses to terminate a renderer if it receives | 15 // The browser process often chooses to terminate a renderer if it receives |
16 // a bad IPC message. The reasons are tracked for metrics. | 16 // a bad IPC message. The reasons are tracked for metrics. |
17 // | 17 // |
18 // See also content/browser/bad_message.h. | 18 // See also content/browser/bad_message.h. |
19 // | 19 // |
20 // NOTE: Do not remove or reorder elements in this list. Add new entries at the | 20 // NOTE: Do not remove or reorder elements in this list. Add new entries at the |
21 // end. Items may be renamed but do not change the values. We rely on the enum | 21 // end. Items may be renamed but do not change the values. We rely on the enum |
22 // values in histograms. Also update histograms.xml with any new values by | 22 // values in histograms. Also update histograms.xml with any new values by |
23 // running: | 23 // running: |
24 // python tools/metrics/histograms/update_bad_message_reasons.py | 24 // python tools/metrics/histograms/update_bad_message_reasons.py |
25 enum BadMessageReason { | 25 enum class BadMessageReason { |
ncarter (slow)
2015/07/09 21:47:30
Since it's an enum class now (which provides a nam
lfg
2015/07/16 17:01:11
Done.
| |
26 WRLHH_LOGGING_STOPPED_BAD_STATE = 0, | 26 CPMD_BAD_ORIGIN_FORMS_PARSED = 1, |
27 CPMD_BAD_ORIGIN_FORMS_RENDERED = 2, | |
28 CPMD_BAD_ORIGIN_FORM_SUBMITTED = 3, | |
29 CPMD_BAD_ORIGIN_FOCUSED_PASSWORD_FORM_FOUND = 4, | |
30 CPMD_BAD_ORIGIN_IN_PAGE_NAVIGATION = 5, | |
31 CPMD_BAD_ORIGIN_PASSWORD_NO_LONGER_GENERATED = 6, | |
27 | 32 |
28 // Please add new elements here. The naming convention is abbreviated class | 33 // Please add new elements here. The naming convention is abbreviated class |
29 // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the | 34 // name (e.g. ContentPasswordManagerDriver becomes CPMD) plus a unique |
30 // reason. | 35 // description of the reason. |
31 BAD_MESSAGE_MAX | 36 BAD_MESSAGE_MAX |
32 }; | 37 }; |
33 | 38 |
34 // Called when the browser receives a bad IPC message from a renderer process on | 39 // Called when the browser receives a bad IPC message from a renderer process on |
35 // the UI thread. Logs the event, records a histogram metric for the |reason|, | 40 // the UI thread. Logs the event, records a histogram metric for the |reason|, |
36 // and terminates the process for |host|. | 41 // and terminates the process for |host|. |
37 void ReceivedBadMessage(content::RenderProcessHost* host, | 42 void ReceivedBadMessage(content::RenderProcessHost* host, |
38 BadMessageReason reason); | 43 BadMessageReason reason); |
39 | 44 |
40 // Called when a browser message filter receives a bad IPC message from a | 45 } // namespace bad_message |
41 // renderer or other child process. Logs the event, records a histogram metric | 46 } // namespace password_manager |
42 // for the |reason|, and terminates the process for |filter|. | |
43 void ReceivedBadMessage(content::BrowserMessageFilter* filter, | |
44 BadMessageReason reason); | |
45 | 47 |
46 } // namespace bad_message | 48 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_BAD_MESSAGE_H_ |
47 | |
48 #endif // CHROME_BROWSER_BAD_MESSAGE_H_ | |
OLD | NEW |