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; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 BDH_EMPTY_OR_INVALID_FILTERS = 100, | 124 BDH_EMPTY_OR_INVALID_FILTERS = 100, |
125 WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO = 101, | 125 WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO = 101, |
126 RFMF_RENDERER_FAKED_ITS_OWN_DEATH = 102, | 126 RFMF_RENDERER_FAKED_ITS_OWN_DEATH = 102, |
127 DWNLD_INVALID_SAVABLE_RESOURCE_LINKS_RESPONSE = 103, | 127 DWNLD_INVALID_SAVABLE_RESOURCE_LINKS_RESPONSE = 103, |
128 DWNLD_INVALID_SERIALIZE_AS_MHTML_RESPONSE = 104, | 128 DWNLD_INVALID_SERIALIZE_AS_MHTML_RESPONSE = 104, |
129 BDH_DEVICE_NOT_ALLOWED_FOR_ORIGIN = 105, | 129 BDH_DEVICE_NOT_ALLOWED_FOR_ORIGIN = 105, |
130 ACI_WRONG_STORAGE_PARTITION = 106, | 130 ACI_WRONG_STORAGE_PARTITION = 106, |
131 RDHI_WRONG_STORAGE_PARTITION = 107, | 131 RDHI_WRONG_STORAGE_PARTITION = 107, |
132 RDH_INVALID_REQUEST_ID = 108, | 132 RDH_INVALID_REQUEST_ID = 108, |
133 BDH_SERVICE_NOT_ALLOWED_FOR_ORIGIN = 109, | 133 BDH_SERVICE_NOT_ALLOWED_FOR_ORIGIN = 109, |
134 WSH_SEND_BLOB_DURING_BLOB_SEND = 110, | 134 WSI_SEND_BLOB_DURING_BLOB_SEND = 110, |
135 WSH_SEND_FRAME_DURING_BLOB_SEND = 111, | 135 WSI_SEND_FRAME_DURING_BLOB_SEND = 111, |
136 RFH_UNEXPECTED_LOAD_START = 112, | 136 RFH_UNEXPECTED_LOAD_START = 112, |
137 NMF_INVALID_ARGUMENT = 113, | 137 NMF_INVALID_ARGUMENT = 113, |
138 RFH_INVALID_ORIGIN_ON_COMMIT = 114, | 138 RFH_INVALID_ORIGIN_ON_COMMIT = 114, |
139 BDH_UUID_REGISTERED = 115, | 139 BDH_UUID_REGISTERED = 115, |
140 BDH_CONSTRUCTION_FAILED = 116, | 140 BDH_CONSTRUCTION_FAILED = 116, |
141 BDH_INVALID_REFCOUNT_OPERATION = 117, | 141 BDH_INVALID_REFCOUNT_OPERATION = 117, |
142 BDH_INVALID_URL_OPERATION = 118, | 142 BDH_INVALID_URL_OPERATION = 118, |
143 IDBDH_INVALID_ORIGIN = 119, | 143 IDBDH_INVALID_ORIGIN = 119, |
144 RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE = 120, | 144 RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE = 120, |
145 RFH_FAIL_PROVISIONAL_LOAD_NO_ERROR = 121, | 145 RFH_FAIL_PROVISIONAL_LOAD_NO_ERROR = 121, |
146 NI_IN_PAGE_NAVIGATION = 122, | 146 NI_IN_PAGE_NAVIGATION = 122, |
147 RPH_MOJO_PROCESS_ERROR = 123, | 147 RPH_MOJO_PROCESS_ERROR = 123, |
148 | 148 |
149 // Please add new elements here. The naming convention is abbreviated class | 149 // Please add new elements here. The naming convention is abbreviated class |
150 // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the | 150 // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the |
151 // reason. After making changes, you MUST update histograms.xml by running: | 151 // reason. After making changes, you MUST update histograms.xml by running: |
152 // "python tools/metrics/histograms/update_bad_message_reasons.py" | 152 // "python tools/metrics/histograms/update_bad_message_reasons.py" |
153 BAD_MESSAGE_MAX | 153 BAD_MESSAGE_MAX |
154 }; | 154 }; |
155 | 155 |
156 // Called when the browser receives a bad IPC message from a renderer process on | 156 // Called when the browser receives a bad IPC message from a renderer process on |
157 // the UI thread. Logs the event, records a histogram metric for the |reason|, | 157 // the UI thread. Logs the event, records a histogram metric for the |reason|, |
158 // and terminates the process for |host|. | 158 // and terminates the process for |host|. |
159 void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason); | 159 void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason); |
160 | 160 |
| 161 // Equivalent to the above, but callable from any thread. |
| 162 void ReceivedBadMessage(int render_process_id, BadMessageReason reason); |
| 163 |
161 // Called when a browser message filter receives a bad IPC message from a | 164 // Called when a browser message filter receives a bad IPC message from a |
162 // renderer or other child process. Logs the event, records a histogram metric | 165 // renderer or other child process. Logs the event, records a histogram metric |
163 // for the |reason|, and terminates the process for |filter|. | 166 // for the |reason|, and terminates the process for |filter|. |
164 void ReceivedBadMessage(BrowserMessageFilter* filter, BadMessageReason reason); | 167 void ReceivedBadMessage(BrowserMessageFilter* filter, BadMessageReason reason); |
165 | 168 |
166 } // namespace bad_message | 169 } // namespace bad_message |
167 } // namespace content | 170 } // namespace content |
168 | 171 |
169 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_ | 172 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_ |
OLD | NEW |