Use multiline attribute to check for IA2_STATE_MULTILINE.
[chromium-blink-merge.git] / content / browser / bad_message.h
blobb7780579c25b7fa23013f868ddc80daaa8d3748a
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.
5 #ifndef CONTENT_BROWSER_BAD_MESSAGE_H_
6 #define CONTENT_BROWSER_BAD_MESSAGE_H_
8 namespace content {
9 class RenderProcessHost;
11 namespace bad_message {
13 // The browser process often chooses to terminate a renderer if it receives
14 // a bad IPC message. The reasons are tracked for metrics.
16 // Content embedders should implement their own bad message statistics but
17 // should use similar histogram names to make analysis easier.
19 // NOTE: Do not remove or reorder elements in this list. Add new entries at the
20 // end. Items may be renamed but do not change the values. We rely on the enum
21 // values in histograms.
22 enum BadMessageReason {
23 NC_IN_PAGE_NAVIGATION = 0,
24 RFH_CAN_COMMIT_URL_BLOCKED,
25 RFH_CAN_ACCESS_FILES_OF_PAGE_STATE,
26 RFH_SANDBOX_FLAGS,
27 RFH_NO_PROXY_TO_PARENT,
28 RPH_DESERIALIZATION_FAILED,
29 RVH_CAN_ACCESS_FILES_OF_PAGE_STATE,
30 RVH_FILE_CHOOSER_PATH,
31 RWH_SYNTHETIC_GESTURE,
32 RWH_FOCUS,
33 RWH_BLUR,
34 RWH_SHARED_BITMAP,
35 RWH_BAD_ACK_MESSAGE,
36 RWHVA_SHARED_MEMORY,
37 SERVICE_WORKER_BAD_URL,
38 WC_INVALID_FRAME_SOURCE,
39 RWHVM_UNEXPECTED_FRAME_TYPE,
40 RFPH_DETACH,
41 // Please add new elements here. The naming convention is abbreviated class
42 // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
43 // reason.
44 BAD_MESSAGE_MAX
47 // Called when the browser receives a bad IPC message from a renderer process.
48 // Logs the event, records a histogram metric for the |reason|, and terminates
49 // the process for |host|.
50 void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason);
52 } // namespace bad_message
53 } // namespace content
55 #endif // CONTENT_BROWSER_BAD_MESSAGE_H_