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 EXTENSIONS_BROWSER_BAD_MESSAGE_H_ | 5 #ifndef EXTENSIONS_BROWSER_BAD_MESSAGE_H_ |
6 #define EXTENSIONS_BROWSER_BAD_MESSAGE_H_ | 6 #define EXTENSIONS_BROWSER_BAD_MESSAGE_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 class RenderProcessHost; | 9 class RenderProcessHost; |
10 } | 10 } |
(...skipping 10 matching lines...) Expand all Loading... | |
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. | 22 // values in histograms. |
23 enum BadMessageReason { | 23 enum BadMessageReason { |
24 EOG_BAD_ORIGIN = 0, | 24 EOG_BAD_ORIGIN = 0, |
25 EVG_BAD_ORIGIN = 1, | 25 EVG_BAD_ORIGIN = 1, |
26 BH_BLOB_NOT_OWNED = 2, | 26 BH_BLOB_NOT_OWNED = 2, |
27 EH_BAD_EVENT_ID = 3, | 27 EH_BAD_EVENT_ID = 3, |
28 AVG_BAD_INST_ID = 4, | 28 AVG_BAD_INST_ID = 4, |
29 AVG_BAD_EXT_ID = 5, | 29 AVG_BAD_EXT_ID = 5, |
30 AVG_NULL_AVG = 6, | 30 AVG_NULL_AVG = 6, |
31 INVALID_ORIGIN = 7, | |
Charlie Reis
2016/08/10 20:44:02
As mentioned before, we can't define a code here a
| |
31 // Please add new elements here. The naming convention is abbreviated class | 32 // Please add new elements here. The naming convention is abbreviated class |
32 // name (e.g. ExtensionHost becomes EH) plus a unique description of the | 33 // name (e.g. ExtensionHost becomes EH) plus a unique description of the |
33 // reason. After making changes, you MUST update histograms.xml by running: | 34 // reason. After making changes, you MUST update histograms.xml by running: |
34 // "python tools/metrics/histograms/update_bad_message_reasons.py" | 35 // "python tools/metrics/histograms/update_bad_message_reasons.py" |
35 BAD_MESSAGE_MAX | 36 BAD_MESSAGE_MAX |
36 }; | 37 }; |
37 | 38 |
38 // Called when the browser receives a bad IPC message from an extension process. | 39 // Called when the browser receives a bad IPC message from an extension process. |
39 // Logs the event, records a histogram metric for the |reason|, and terminates | 40 // Logs the event, records a histogram metric for the |reason|, and terminates |
40 // the process for |host|. | 41 // the process for |host|. |
41 void ReceivedBadMessage(content::RenderProcessHost* host, | 42 void ReceivedBadMessage(content::RenderProcessHost* host, |
42 BadMessageReason reason); | 43 BadMessageReason reason); |
43 | 44 |
44 } // namespace bad_message | 45 } // namespace bad_message |
45 } // namespace extensions | 46 } // namespace extensions |
46 | 47 |
47 #endif // EXTENSIONS_BROWSER_BAD_MESSAGE_H_ | 48 #endif // EXTENSIONS_BROWSER_BAD_MESSAGE_H_ |
OLD | NEW |