Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef EXTENSIONS_BROWSER_BAD_MESSAGE_H_ | |
| 6 #define EXTENSIONS_BROWSER_BAD_MESSAGE_H_ | |
| 7 | |
| 8 namespace content { | |
| 9 class RenderProcessHost; | |
| 10 } | |
| 11 | |
| 12 namespace extensions { | |
| 13 namespace bad_message { | |
| 14 | |
| 15 // The browser process often chooses to terminate a renderer if it receives | |
| 16 // a bad IPC message. The reasons are tracked for metrics. | |
| 17 // | |
| 18 // See also content/browser/bad_message.h. | |
| 19 // | |
| 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 | |
| 22 // values in histograms. | |
| 23 enum BadMessageReason { | |
| 24 EOG_BAD_ORIGIN = 0, | |
| 25 EVG_BAD_ORIGIN, | |
| 26 BH_BLOB_NOT_OWNED, | |
| 27 EH_BAD_EVENT_ID, | |
| 28 // Please add new elements here. The naming convention is abbreviated class | |
| 29 // name (e.g. ExtensionHost becomes EH) plus a unique description of the | |
| 30 // reason. | |
| 31 | |
|
Charlie Reis
2015/03/19 04:01:49
Same nit.
James Cook
2015/03/19 16:19:11
Done.
| |
| 32 BAD_MESSAGE_MAX | |
| 33 }; | |
| 34 | |
| 35 // Called when the browser receives a bad IPC message from an extension process. | |
| 36 // Logs the event, records a histogram metric for the |reason|, and terminates | |
| 37 // the process for |host|. | |
| 38 void ReceivedBadMessage(content::RenderProcessHost* host, | |
| 39 BadMessageReason reason); | |
| 40 | |
| 41 } // bad_message | |
| 42 } // namespace extensions | |
| 43 | |
| 44 #endif // EXTENSIONS_BROWSER_BAD_MESSAGE_H_ | |
| OLD | NEW |