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

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

Issue 2222723002: Avoid calling into the ContentBrowserClient interface from ResourceDispatcherHostImpl to determine … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failures Created 4 years, 4 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 RenderProcessHost; 9 class RenderProcessHost;
10 } 10 }
(...skipping 10 matching lines...) Expand all
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,
jam 2016/08/09 01:36:24 I'm curious what is the reason to start instrument
ananta 2016/08/09 05:47:48 Reason being, to pass in a bad message code to con
jam 2016/08/10 00:19:26 I'm not sure I follow. The bad_message::Received
ananta 2016/08/10 00:30:02 We cannot assume RDH_ILLEGAL_ORIGIN all the time.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698