Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: content/browser/bad_message.h

Issue 1145013004: Introduce bad_message.h for chrome and NaCl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/appcache/appcache_dispatcher_host.cc ('k') | content/browser/bad_message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 RenderProcessHost; 10 class RenderProcessHost;
10 11
11 namespace bad_message { 12 namespace bad_message {
12 13
13 // 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
14 // a bad IPC message. The reasons are tracked for metrics. 15 // a bad IPC message. The reasons are tracked for metrics.
15 // 16 //
16 // Content embedders should implement their own bad message statistics but 17 // Content embedders should implement their own bad message statistics but
17 // should use similar histogram names to make analysis easier. 18 // should use similar histogram names to make analysis easier.
18 // 19 //
(...skipping 14 matching lines...) Expand all
33 RWH_BLUR = 10, 34 RWH_BLUR = 10,
34 RWH_SHARED_BITMAP = 11, 35 RWH_SHARED_BITMAP = 11,
35 RWH_BAD_ACK_MESSAGE = 12, 36 RWH_BAD_ACK_MESSAGE = 12,
36 RWHVA_SHARED_MEMORY = 13, 37 RWHVA_SHARED_MEMORY = 13,
37 SERVICE_WORKER_BAD_URL = 14, 38 SERVICE_WORKER_BAD_URL = 14,
38 WC_INVALID_FRAME_SOURCE = 15, 39 WC_INVALID_FRAME_SOURCE = 15,
39 RWHVM_UNEXPECTED_FRAME_TYPE = 16, 40 RWHVM_UNEXPECTED_FRAME_TYPE = 16,
40 RFPH_DETACH = 17, 41 RFPH_DETACH = 17,
41 DFH_BAD_EMBEDDER_MESSAGE = 18, 42 DFH_BAD_EMBEDDER_MESSAGE = 18,
42 NC_AUTO_SUBFRAME = 19, 43 NC_AUTO_SUBFRAME = 19,
44 CSDH_NOT_RECOGNIZED = 20,
45 DSMF_OPEN_STORAGE = 21,
46 DSMF_LOAD_STORAGE = 22,
47 DBMF_INVALID_ORIGIN_ON_OPEN = 23,
48 DBMF_DB_NOT_OPEN_ON_MODIFY = 24,
49 DBMF_DB_NOT_OPEN_ON_CLOSE = 25,
50 DBMF_INVALID_ORIGIN_ON_SQLITE_ERROR = 26,
51 RDH_INVALID_PRIORITY = 27,
52 RDH_REQUEST_NOT_TRANSFERRING = 28,
53 RDH_BAD_DOWNLOAD = 29,
54 NMF_NO_PERMISSION_SHOW = 30,
55 NMF_NO_PERMISSION_CLOSE = 31,
56 NMF_NO_PERMISSION_VERIFY = 32,
57 MH_INVALID_MIDI_PORT = 33,
58 MH_SYS_EX_PERMISSION = 34,
59 ACDH_REGISTER = 35,
60 ACDH_UNREGISTER = 36,
61 ACDH_SET_SPAWNING = 37,
62 ACDH_SELECT_CACHE = 38,
63 ACDH_SELECT_CACHE_FOR_WORKER = 39,
64 ACDH_SELECT_CACHE_FOR_SHARED_WORKER = 40,
65 ACDH_MARK_AS_FOREIGN_ENTRY = 41,
66 ACDH_PENDING_REPLY_IN_GET_STATUS = 42,
67 ACDH_GET_STATUS = 43,
68 ACDH_PENDING_REPLY_IN_START_UPDATE = 44,
69 ACDH_START_UPDATE = 45,
70 ACDH_PENDING_REPLY_IN_SWAP_CACHE = 46,
71 ACDH_SWAP_CACHE = 47,
72 SWDH_NOT_HANDLED = 48,
73 SWDH_REGISTER_BAD_URL = 49,
74 SWDH_REGISTER_NO_HOST = 50,
75 SWDH_REGISTER_CANNOT = 51,
76 SWDH_UNREGISTER_BAD_URL = 52,
77 SWDH_UNREGISTER_NO_HOST = 53,
78 SWDH_UNREGISTER_CANNOT = 54,
79 SWDH_GET_REGISTRATION_BAD_URL = 55,
80 SWDH_GET_REGISTRATION_NO_HOST = 56,
81 SWDH_GET_REGISTRATION_CANNOT = 57,
82 SWDH_GET_REGISTRATION_FOR_READY_NO_HOST = 58,
83 SWDH_GET_REGISTRATION_FOR_READY_ALREADY_IN_PROGRESS = 59,
84 SWDH_POST_MESSAGE = 60,
85 SWDH_PROVIDER_CREATED_NO_HOST = 61,
86 SWDH_PROVIDER_DESTROYED_NO_HOST = 62,
87 SWDH_SET_HOSTED_VERSION_NO_HOST = 63,
88 SWDH_SET_HOSTED_VERSION = 64,
89 SWDH_WORKER_SCRIPT_LOAD_NO_HOST = 65,
90 SWDH_INCREMENT_WORKER_BAD_HANDLE = 66,
91 SWDH_DECREMENT_WORKER_BAD_HANDLE = 67,
92 SWDH_INCREMENT_REGISTRATION_BAD_HANDLE = 68,
93 SWDH_DECREMENT_REGISTRATION_BAD_HANDLE = 69,
94 SWDH_TERMINATE_BAD_HANDLE = 70,
95 FAMF_APPEND_ITEM_TO_BLOB = 71,
96 FAMF_APPEND_SHARED_MEMORY_TO_BLOB = 72,
97 FAMF_MALFORMED_STREAM_URL = 73,
98 FAMF_APPEND_ITEM_TO_STREAM = 74,
99 FAMF_APPEND_SHARED_MEMORY_TO_STREAM = 75,
100 IDBDH_CAN_READ_FILE = 76,
101 IDBDH_GET_OR_TERMINATE = 77,
43 // Please add new elements here. The naming convention is abbreviated class 102 // Please add new elements here. The naming convention is abbreviated class
44 // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the 103 // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
45 // reason. 104 // reason.
46 BAD_MESSAGE_MAX 105 BAD_MESSAGE_MAX
47 }; 106 };
48 107
49 // Called when the browser receives a bad IPC message from a renderer process. 108 // Called when the browser receives a bad IPC message from a renderer process on
50 // Logs the event, records a histogram metric for the |reason|, and terminates 109 // the UI thread. Logs the event, records a histogram metric for the |reason|,
51 // the process for |host|. 110 // and terminates the process for |host|.
52 void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason); 111 void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason);
53 112
113 // 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
115 // for the |reason|, and terminates the process for |filter|.
116 void ReceivedBadMessage(BrowserMessageFilter* filter, BadMessageReason reason);
117
54 } // namespace bad_message 118 } // namespace bad_message
55 } // namespace content 119 } // namespace content
56 120
57 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_ 121 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_dispatcher_host.cc ('k') | content/browser/bad_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698