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

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

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from falken@ Created 4 years, 2 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
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 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 BrowserMessageFilter;
9 class RenderProcessHost; 10 class RenderProcessHost;
10 } 11 }
11 12
12 namespace extensions { 13 namespace extensions {
13 namespace bad_message { 14 namespace bad_message {
14 15
15 // The browser process often chooses to terminate a renderer if it receives 16 // The browser process often chooses to terminate a renderer if it receives
16 // a bad IPC message. The reasons are tracked for metrics. 17 // a bad IPC message. The reasons are tracked for metrics.
17 // 18 //
18 // See also content/browser/bad_message.h. 19 // See also content/browser/bad_message.h.
19 // 20 //
20 // NOTE: Do not remove or reorder elements in this list. Add new entries at the 21 // 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 // end. Items may be renamed but do not change the values. We rely on the enum
22 // values in histograms. 23 // values in histograms.
23 enum BadMessageReason { 24 enum BadMessageReason {
24 EOG_BAD_ORIGIN = 0, 25 EOG_BAD_ORIGIN = 0,
25 EVG_BAD_ORIGIN = 1, 26 EVG_BAD_ORIGIN = 1,
26 BH_BLOB_NOT_OWNED = 2, 27 BH_BLOB_NOT_OWNED = 2,
27 EH_BAD_EVENT_ID = 3, 28 EH_BAD_EVENT_ID = 3,
28 AVG_BAD_INST_ID = 4, 29 AVG_BAD_INST_ID = 4,
29 AVG_BAD_EXT_ID = 5, 30 AVG_BAD_EXT_ID = 5,
30 AVG_NULL_AVG = 6, 31 AVG_NULL_AVG = 6,
32 // Invalid increment of an Extensions SW ref count.
33 ESWMF_INVALID_INCREMENT_ACTIVIY = 7,
34 // Invalid decrement of an Extensions SW ref count.
35 ESWMF_INVALID_DECREMENT_ACTIVIY = 8,
31 // Please add new elements here. The naming convention is abbreviated class 36 // Please add new elements here. The naming convention is abbreviated class
32 // name (e.g. ExtensionHost becomes EH) plus a unique description of the 37 // name (e.g. ExtensionHost becomes EH) plus a unique description of the
33 // reason. After making changes, you MUST update histograms.xml by running: 38 // reason. After making changes, you MUST update histograms.xml by running:
34 // "python tools/metrics/histograms/update_bad_message_reasons.py" 39 // "python tools/metrics/histograms/update_bad_message_reasons.py"
35 BAD_MESSAGE_MAX 40 BAD_MESSAGE_MAX
36 }; 41 };
37 42
38 // Called when the browser receives a bad IPC message from an extension process. 43 // 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 44 // Logs the event, records a histogram metric for the |reason|, and terminates
40 // the process for |host|. 45 // the process for |host|.
41 void ReceivedBadMessage(content::RenderProcessHost* host, 46 void ReceivedBadMessage(content::RenderProcessHost* host,
42 BadMessageReason reason); 47 BadMessageReason reason);
43 48
49 // Called when a browser message filter receives a bad IPC message from a
50 // renderer or other child process. Logs the event, records a histogram metric
51 // for the |reason|, and terminates the process for |filter|.
52 void ReceivedBadMessage(content::BrowserMessageFilter* filter,
53 BadMessageReason reason);
54
44 } // namespace bad_message 55 } // namespace bad_message
45 } // namespace extensions 56 } // namespace extensions
46 57
47 #endif // EXTENSIONS_BROWSER_BAD_MESSAGE_H_ 58 #endif // EXTENSIONS_BROWSER_BAD_MESSAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698