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

Side by Side Diff: android_webview/common/crash_reporter/crash_keys.cc

Issue 2717223003: Add WebView-specific whitelist for crash keys. (Closed)
Patch Set: Remove unnecessary imports/includes. Created 3 years, 9 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "android_webview/common/crash_reporter/crash_keys.h" 5 #include "android_webview/common/crash_reporter/crash_keys.h"
6 6
7 #include "base/debug/crash_logging.h" 7 #include "base/debug/crash_logging.h"
8 #include "components/crash/core/common/crash_keys.h" 8 #include "components/crash/core/common/crash_keys.h"
9 9
10 using namespace crash_keys; 10 using namespace crash_keys;
11 11
12 namespace android_webview { 12 namespace android_webview {
13 namespace crash_keys { 13 namespace crash_keys {
14 14
15 const char kActiveURL[] = "url-chunk";
16
17 const char kFontKeyName[] = "font_key_name";
18
19 const char kShutdownType[] = "shutdown-type";
20 const char kBrowserUnpinTrace[] = "browser-unpin-trace";
21
15 const char kGPUDriverVersion[] = "gpu-driver"; 22 const char kGPUDriverVersion[] = "gpu-driver";
16 const char kGPUPixelShaderVersion[] = "gpu-psver"; 23 const char kGPUPixelShaderVersion[] = "gpu-psver";
17 const char kGPUVertexShaderVersion[] = "gpu-vsver"; 24 const char kGPUVertexShaderVersion[] = "gpu-vsver";
18 const char kGPUVendor[] = "gpu-gl-vendor"; 25 const char kGPUVendor[] = "gpu-gl-vendor";
19 const char kGPURenderer[] = "gpu-gl-renderer"; 26 const char kGPURenderer[] = "gpu-gl-renderer";
20 27
28 const char kInputEventFilterSendFailure[] = "input-event-filter-send-failure";
29
30 const char kViewCount[] = "view-count";
31
32 const char kZeroEncodeDetails[] = "zero-encode-details";
33
21 size_t RegisterWebViewCrashKeys() { 34 size_t RegisterWebViewCrashKeys() {
22 base::debug::CrashKey fixed_keys[] = { 35 base::debug::CrashKey fixed_keys[] = {
23 { kGPUDriverVersion, kSmallSize }, 36 {"AW_WHITELISTED_DEBUG_KEY", kSmallSize},
24 { kGPUPixelShaderVersion, kSmallSize }, 37 {"AW_NONWHITELISTED_DEBUG_KEY", kSmallSize},
25 { kGPUVertexShaderVersion, kSmallSize }, 38 {kClientId, kSmallSize},
26 { kGPUVendor, kSmallSize }, 39 {kChannel, kSmallSize},
27 { kGPURenderer, kSmallSize }, 40 {kActiveURL, kLargeSize},
41 {kNumVariations, kSmallSize},
42 {kVariations, kHugeSize},
43 {kShutdownType, kSmallSize},
44 {kBrowserUnpinTrace, kMediumSize},
45 {kGPUDriverVersion, kSmallSize},
46 {kGPUPixelShaderVersion, kSmallSize},
47 {kGPUVertexShaderVersion, kSmallSize},
48 {kGPUVendor, kSmallSize},
49 {kGPURenderer, kSmallSize},
28 50
29 // content/: 51 // content/:
30 { "bad_message_reason", kSmallSize }, 52 {"bad_message_reason", kSmallSize},
31 { "discardable-memory-allocated", kSmallSize }, 53 {"discardable-memory-allocated", kSmallSize},
32 { "discardable-memory-free", kSmallSize }, 54 {"discardable-memory-free", kSmallSize},
33 { "mojo-message-error", kMediumSize }, 55 {kFontKeyName, kSmallSize},
34 { "total-discardable-memory-allocated", kSmallSize }, 56 {"mojo-message-error", kMediumSize},
57 {"ppapi_path", kMediumSize},
58 {"subresource_url", kLargeSize},
59 {"total-discardable-memory-allocated", kSmallSize},
60 {kInputEventFilterSendFailure, kSmallSize},
61 {kBug464926CrashKey, kSmallSize},
62 {kViewCount, kSmallSize},
63
64 // media/:
65 {kZeroEncodeDetails, kSmallSize},
66
67 // gin/:
68 {"v8-ignition", kSmallSize},
69
70 // sandbox/:
71 {"seccomp-sigsys", kMediumSize},
72
73 // Temporary for http://crbug.com/575245.
74 {"swapout_frame_id", kSmallSize},
75 {"swapout_proxy_id", kSmallSize},
76 {"swapout_view_id", kSmallSize},
77 {"commit_frame_id", kSmallSize},
78 {"commit_proxy_id", kSmallSize},
79 {"commit_view_id", kSmallSize},
80 {"commit_main_render_frame_id", kSmallSize},
81 {"newproxy_proxy_id", kSmallSize},
82 {"newproxy_view_id", kSmallSize},
83 {"newproxy_opener_id", kSmallSize},
84 {"newproxy_parent_id", kSmallSize},
85 {"rvinit_view_id", kSmallSize},
86 {"rvinit_proxy_id", kSmallSize},
87 {"rvinit_main_frame_id", kSmallSize},
88 {"initrf_frame_id", kSmallSize},
89 {"initrf_proxy_id", kSmallSize},
90 {"initrf_view_id", kSmallSize},
91 {"initrf_main_frame_id", kSmallSize},
92 {"initrf_view_is_live", kSmallSize},
93
94 // Temporary for https://crbug.com/591478.
95 {"initrf_parent_proxy_exists", kSmallSize},
96 {"initrf_render_view_is_live", kSmallSize},
97 {"initrf_parent_is_in_same_site_instance", kSmallSize},
98 {"initrf_parent_process_is_live", kSmallSize},
99 {"initrf_root_is_in_same_site_instance", kSmallSize},
100 {"initrf_root_is_in_same_site_instance_as_parent", kSmallSize},
101 {"initrf_root_process_is_live", kSmallSize},
102 {"initrf_root_proxy_is_live", kSmallSize},
103
104 // Temporary for https://crbug.com/626802.
105 {"newframe_routing_id", kSmallSize},
106 {"newframe_proxy_id", kSmallSize},
107 {"newframe_opener_id", kSmallSize},
108 {"newframe_parent_id", kSmallSize},
109 {"newframe_widget_id", kSmallSize},
110 {"newframe_widget_hidden", kSmallSize},
111 {"newframe_replicated_origin", kSmallSize},
112 {"newframe_oopifs_possible", kSmallSize},
113
114 // Temporary for https://crbug.com/630103.
115 {"origin_mismatch_url", kLargeSize},
116 {"origin_mismatch_origin", kMediumSize},
117 {"origin_mismatch_transition", kSmallSize},
118 {"origin_mismatch_redirects", kSmallSize},
119 {"origin_mismatch_same_page", kSmallSize},
120
121 // Temporary for https://crbug.com/612711.
122 {"aci_wrong_sp_extension_id", kSmallSize},
123
124 // Temporary for https://crbug.com/668633.
125 {"swdh_set_hosted_version_worker_pid", kSmallSize},
126 {"swdh_set_hosted_version_host_pid", kSmallSize},
127 {"swdh_set_hosted_version_is_new_process", kSmallSize},
128 {"swdh_set_hosted_version_restart_count", kSmallSize},
35 }; 129 };
36 130
131 // This dynamic set of keys is used for sets of key value pairs when gathering
132 // a collection of data, like command line switches or extension IDs.
37 std::vector<base::debug::CrashKey> keys(fixed_keys, 133 std::vector<base::debug::CrashKey> keys(fixed_keys,
38 fixed_keys + arraysize(fixed_keys)); 134 fixed_keys + arraysize(fixed_keys));
39 135
136 GetCrashKeysForCommandLineSwitches(&keys);
137
40 return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength); 138 return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength);
41 } 139 }
140
141 const char* WHITE_LISTED_WEBVIEW_CRASH_KEYS[] = {
142 "AW_WHITELISTED_DEBUG_KEY", kGPUDriverVersion, kGPUPixelShaderVersion,
143 kGPUVertexShaderVersion, kGPUVendor, kGPURenderer,
144
145 // content/:
146 "bad_message_reason", "discardable-memory-allocated",
147 "discardable-memory-free", "mojo-message-error-1", "mojo-message-error-2",
148 "mojo-message-error-3", "mojo-message-error-4",
149 "total-discardable-memory-allocated", NULL};
150
151 const char** GetWhiteListedWebViewCrashKeys() {
152 return WHITE_LISTED_WEBVIEW_CRASH_KEYS;
153 }
42 } 154 }
43 155
44 } // namespace crash_keys 156 } // namespace crash_keys
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698