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 CONTENT_BROWSER_BAD_MESSAGE_H_ | 5 #ifndef CONTENT_BROWSER_BAD_MESSAGE_H_ |
6 #define CONTENT_BROWSER_BAD_MESSAGE_H_ | 6 #define CONTENT_BROWSER_BAD_MESSAGE_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 class BrowserMessageFilter; | 9 class BrowserMessageFilter; |
10 class RenderProcessHost; | 10 class RenderProcessHost; |
11 | 11 |
12 namespace bad_message { | 12 namespace bad_message { |
13 | 13 |
14 // The browser process often chooses to terminate a renderer if it receives | 14 // The browser process often chooses to terminate a renderer if it receives |
15 // a bad IPC message. The reasons are tracked for metrics. | 15 // a bad IPC message. The reasons are tracked for metrics. |
16 // | 16 // |
17 // Content embedders should implement their own bad message statistics but | 17 // Content embedders should implement their own bad message statistics but |
18 // should use similar histogram names to make analysis easier. | 18 // should use similar histogram names to make analysis easier. |
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. | 22 // values in histograms. Also update histograms.xml with any new values by |
| 23 // running: |
| 24 // python tools/metrics/histograms/update_bad_message_reasons.py |
23 enum BadMessageReason { | 25 enum BadMessageReason { |
24 NC_IN_PAGE_NAVIGATION = 0, | 26 NC_IN_PAGE_NAVIGATION = 0, |
25 RFH_CAN_COMMIT_URL_BLOCKED = 1, | 27 RFH_CAN_COMMIT_URL_BLOCKED = 1, |
26 RFH_CAN_ACCESS_FILES_OF_PAGE_STATE = 2, | 28 RFH_CAN_ACCESS_FILES_OF_PAGE_STATE = 2, |
27 RFH_SANDBOX_FLAGS = 3, | 29 RFH_SANDBOX_FLAGS = 3, |
28 RFH_NO_PROXY_TO_PARENT = 4, | 30 RFH_NO_PROXY_TO_PARENT = 4, |
29 RPH_DESERIALIZATION_FAILED = 5, | 31 RPH_DESERIALIZATION_FAILED = 5, |
30 RVH_CAN_ACCESS_FILES_OF_PAGE_STATE = 6, | 32 RVH_CAN_ACCESS_FILES_OF_PAGE_STATE = 6, |
31 RVH_FILE_CHOOSER_PATH = 7, | 33 RVH_FILE_CHOOSER_PATH = 7, |
32 RWH_SYNTHETIC_GESTURE = 8, | 34 RWH_SYNTHETIC_GESTURE = 8, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 // Called when a browser message filter receives a bad IPC message from a | 115 // Called when a browser message filter receives a bad IPC message from a |
114 // renderer or other child process. Logs the event, records a histogram metric | 116 // renderer or other child process. Logs the event, records a histogram metric |
115 // for the |reason|, and terminates the process for |filter|. | 117 // for the |reason|, and terminates the process for |filter|. |
116 void ReceivedBadMessage(BrowserMessageFilter* filter, BadMessageReason reason); | 118 void ReceivedBadMessage(BrowserMessageFilter* filter, BadMessageReason reason); |
117 | 119 |
118 } // namespace bad_message | 120 } // namespace bad_message |
119 } // namespace content | 121 } // namespace content |
120 | 122 |
121 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_ | 123 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_ |
OLD | NEW |