OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/common/crash_keys.h" | 5 #include "chrome/common/crash_keys.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // The following keys may be chunked by the underlying crash logging system, | 100 // The following keys may be chunked by the underlying crash logging system, |
101 // but ultimately constitute a single key-value pair. | 101 // but ultimately constitute a single key-value pair. |
102 // | 102 // |
103 // If you're adding keys here, please also add them to the following list: | 103 // If you're adding keys here, please also add them to the following list: |
104 // chrome/app/chrome_crash_reporter_client_win.cc::RegisterCrashKeysHelper(), | 104 // chrome/app/chrome_crash_reporter_client_win.cc::RegisterCrashKeysHelper(), |
105 // and consider adding the new keys to the following list as well: | 105 // and consider adding the new keys to the following list as well: |
106 // android_webview/common/crash_reporter/crash_keys.cc:: | 106 // android_webview/common/crash_reporter/crash_keys.cc:: |
107 // RegisterWebViewCrashKeys(). | 107 // RegisterWebViewCrashKeys(). |
108 base::debug::CrashKey fixed_keys[] = { | 108 base::debug::CrashKey fixed_keys[] = { |
109 #if defined(OS_MACOSX) || defined(OS_WIN) | 109 #if defined(OS_MACOSX) || defined(OS_WIN) |
110 { kMetricsClientId, kSmallSize }, | 110 {kMetricsClientId, kSmallSize}, |
111 #else | 111 #else |
112 { kClientId, kSmallSize }, | 112 {kClientId, kSmallSize}, |
113 #endif | 113 #endif |
114 { kChannel, kSmallSize }, | 114 {kChannel, kSmallSize}, |
115 { kActiveURL, kLargeSize }, | 115 {kActiveURL, kLargeSize}, |
116 { kNumVariations, kSmallSize }, | 116 {kNumVariations, kSmallSize}, |
117 { kVariations, kHugeSize }, | 117 {kVariations, kHugeSize}, |
118 { kNumExtensionsCount, kSmallSize }, | 118 {kNumExtensionsCount, kSmallSize}, |
119 { kShutdownType, kSmallSize }, | 119 {kShutdownType, kSmallSize}, |
120 { kBrowserUnpinTrace, kMediumSize }, | 120 {kBrowserUnpinTrace, kMediumSize}, |
121 #if !defined(OS_ANDROID) | 121 #if !defined(OS_ANDROID) |
122 { kGPUVendorID, kSmallSize }, | 122 {kGPUVendorID, kSmallSize}, |
123 { kGPUDeviceID, kSmallSize }, | 123 {kGPUDeviceID, kSmallSize}, |
124 #endif | 124 #endif |
125 { kGPUDriverVersion, kSmallSize }, | 125 {kGPUDriverVersion, kSmallSize}, |
126 { kGPUPixelShaderVersion, kSmallSize }, | 126 {kGPUPixelShaderVersion, kSmallSize}, |
127 { kGPUVertexShaderVersion, kSmallSize }, | 127 {kGPUVertexShaderVersion, kSmallSize}, |
128 #if defined(OS_MACOSX) | 128 #if defined(OS_MACOSX) |
129 { kGPUGLVersion, kSmallSize }, | 129 {kGPUGLVersion, kSmallSize}, |
130 #elif defined(OS_POSIX) | 130 #elif defined(OS_POSIX) |
131 { kGPUVendor, kSmallSize }, | 131 {kGPUVendor, kSmallSize}, |
132 { kGPURenderer, kSmallSize }, | 132 {kGPURenderer, kSmallSize}, |
133 #endif | 133 #endif |
134 | 134 |
135 // content/: | 135 // content/: |
136 { "bad_message_reason", kSmallSize }, | 136 {"bad_message_reason", kSmallSize}, |
137 { "discardable-memory-allocated", kSmallSize }, | 137 {"discardable-memory-allocated", kSmallSize}, |
138 { "discardable-memory-free", kSmallSize }, | 138 {"discardable-memory-free", kSmallSize}, |
139 { kFontKeyName, kSmallSize}, | 139 {kFontKeyName, kSmallSize}, |
140 { "mojo-message-error", kMediumSize }, | 140 {"mojo-message-error", kMediumSize}, |
141 { "ppapi_path", kMediumSize }, | 141 {"ppapi_path", kMediumSize}, |
142 { "subresource_url", kLargeSize }, | 142 {"subresource_url", kLargeSize}, |
143 { "total-discardable-memory-allocated", kSmallSize }, | 143 {"total-discardable-memory-allocated", kSmallSize}, |
144 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
145 { kHungRendererOutstandingAckCount, kSmallSize }, | 145 {kHungRendererOutstandingAckCount, kSmallSize}, |
146 { kHungRendererOutstandingEventType, kSmallSize }, | 146 {kHungRendererOutstandingEventType, kSmallSize}, |
147 { kHungRendererLastEventType, kSmallSize }, | 147 {kHungRendererLastEventType, kSmallSize}, |
148 { kHungRendererReason, kSmallSize }, | 148 {kHungRendererReason, kSmallSize}, |
149 { kThirdPartyModulesLoaded, kSmallSize }, | 149 {kThirdPartyModulesLoaded, kSmallSize}, |
150 { kThirdPartyModulesNotLoaded, kSmallSize }, | 150 {kThirdPartyModulesNotLoaded, kSmallSize}, |
151 { kIsEnterpriseManaged, kSmallSize }, | 151 {kIsEnterpriseManaged, kSmallSize}, |
152 #endif | 152 #endif |
153 { kInputEventFilterSendFailure, kSmallSize }, | 153 {kInputEventFilterSendFailure, kSmallSize}, |
154 #if defined(OS_CHROMEOS) | 154 #if defined(OS_CHROMEOS) |
155 { kNumberOfUsers, kSmallSize }, | 155 {kNumberOfUsers, kSmallSize}, |
156 // Temporary for https://crbug.com/660960 | 156 // Temporary for https://crbug.com/660960 |
157 { kLastGoodCloseStack, kMediumSize }, | 157 {kLastGoodCloseStack, kMediumSize}, |
158 // Temporary for https://crbug.com/629521 | 158 // Temporary for https://crbug.com/629521 |
159 { "mmap_params", kSmallSize }, | 159 {"mmap_params", kSmallSize}, |
160 { "buffer_size", kSmallSize }, | 160 {"buffer_size", kSmallSize}, |
161 { "errno", kSmallSize }, | 161 {"errno", kSmallSize}, |
162 #endif | 162 #endif |
163 #if defined(OS_MACOSX) | 163 #if defined(OS_MACOSX) |
164 { mac::kFirstNSException, kMediumSize }, | 164 {mac::kFirstNSException, kMediumSize}, |
165 { mac::kFirstNSExceptionTrace, kMediumSize }, | 165 {mac::kFirstNSExceptionTrace, kMediumSize}, |
166 { mac::kLastNSException, kMediumSize }, | 166 {mac::kLastNSException, kMediumSize}, |
167 { mac::kLastNSExceptionTrace, kMediumSize }, | 167 {mac::kLastNSExceptionTrace, kMediumSize}, |
168 { mac::kNSException, kMediumSize }, | 168 {mac::kNSException, kMediumSize}, |
169 { mac::kNSExceptionTrace, kMediumSize }, | 169 {mac::kNSExceptionTrace, kMediumSize}, |
170 { mac::kSendAction, kMediumSize }, | 170 {mac::kSendAction, kMediumSize}, |
171 { mac::kNSEvent, kMediumSize }, | 171 {mac::kNSEvent, kMediumSize}, |
172 { mac::kToolbarNibInfo, kMediumSize }, | 172 {mac::kToolbarNibInfo, kMediumSize}, |
173 { mac::kZombie, kMediumSize }, | 173 {mac::kZombie, kMediumSize}, |
174 { mac::kZombieTrace, kMediumSize }, | 174 {mac::kZombieTrace, kMediumSize}, |
175 // content/: | 175 // content/: |
176 { "channel_error_bt", kMediumSize }, | 176 {"channel_error_bt", kMediumSize}, |
177 { "remove_route_bt", kMediumSize }, | 177 {"remove_route_bt", kMediumSize}, |
178 { "rwhvm_window", kMediumSize }, | 178 {"rwhvm_window", kMediumSize}, |
179 // media/: | 179 // media/: |
180 #endif | 180 #endif |
181 { kBug464926CrashKey, kSmallSize }, | 181 {kBug464926CrashKey, kSmallSize}, |
182 { kViewCount, kSmallSize }, | 182 {kViewCount, kSmallSize}, |
183 | 183 |
184 // media/: | 184 // media/: |
185 { kZeroEncodeDetails, kSmallSize }, | 185 {kZeroEncodeDetails, kSmallSize}, |
186 | 186 |
187 // gin/: | 187 // gin/: |
188 { "v8-ignition", kSmallSize }, | 188 {"v8-ignition", kSmallSize}, |
189 | 189 |
190 // sandbox/: | 190 // sandbox/: |
191 #if defined(OS_LINUX) | 191 #if defined(OS_LINUX) |
192 { "seccomp-sigsys", kMediumSize }, | 192 {"seccomp-sigsys", kMediumSize}, |
193 #endif | 193 #endif |
194 | 194 |
195 // Temporary for http://crbug.com/575245. | 195 // Temporary for http://crbug.com/575245. |
196 { "swapout_frame_id", kSmallSize }, | 196 {"swapout_frame_id", kSmallSize}, |
197 { "swapout_proxy_id", kSmallSize }, | 197 {"swapout_proxy_id", kSmallSize}, |
198 { "swapout_view_id", kSmallSize }, | 198 {"swapout_view_id", kSmallSize}, |
199 { "commit_frame_id", kSmallSize }, | 199 {"commit_frame_id", kSmallSize}, |
200 { "commit_proxy_id", kSmallSize }, | 200 {"commit_proxy_id", kSmallSize}, |
201 { "commit_view_id", kSmallSize }, | 201 {"commit_view_id", kSmallSize}, |
202 { "commit_main_render_frame_id", kSmallSize }, | 202 {"commit_main_render_frame_id", kSmallSize}, |
203 { "newproxy_proxy_id", kSmallSize }, | 203 {"newproxy_proxy_id", kSmallSize}, |
204 { "newproxy_view_id", kSmallSize }, | 204 {"newproxy_view_id", kSmallSize}, |
205 { "newproxy_opener_id", kSmallSize }, | 205 {"newproxy_opener_id", kSmallSize}, |
206 { "newproxy_parent_id", kSmallSize }, | 206 {"newproxy_parent_id", kSmallSize}, |
207 { "rvinit_view_id", kSmallSize }, | 207 {"rvinit_view_id", kSmallSize}, |
208 { "rvinit_proxy_id", kSmallSize }, | 208 {"rvinit_proxy_id", kSmallSize}, |
209 { "rvinit_main_frame_id", kSmallSize }, | 209 {"rvinit_main_frame_id", kSmallSize}, |
210 { "initrf_frame_id", kSmallSize }, | 210 {"initrf_frame_id", kSmallSize}, |
211 { "initrf_proxy_id", kSmallSize }, | 211 {"initrf_proxy_id", kSmallSize}, |
212 { "initrf_view_id", kSmallSize }, | 212 {"initrf_view_id", kSmallSize}, |
213 { "initrf_main_frame_id", kSmallSize }, | 213 {"initrf_main_frame_id", kSmallSize}, |
214 { "initrf_view_is_live", kSmallSize }, | 214 {"initrf_view_is_live", kSmallSize}, |
215 | 215 |
216 // Temporary for https://crbug.com/591478. | 216 // Temporary for https://crbug.com/591478. |
217 { "initrf_parent_proxy_exists", kSmallSize }, | 217 {"initrf_parent_proxy_exists", kSmallSize}, |
218 { "initrf_render_view_is_live", kSmallSize }, | 218 {"initrf_render_view_is_live", kSmallSize}, |
219 { "initrf_parent_is_in_same_site_instance", kSmallSize}, | 219 {"initrf_parent_is_in_same_site_instance", kSmallSize}, |
220 { "initrf_parent_process_is_live", kSmallSize}, | 220 {"initrf_parent_process_is_live", kSmallSize}, |
221 { "initrf_root_is_in_same_site_instance", kSmallSize}, | 221 {"initrf_root_is_in_same_site_instance", kSmallSize}, |
222 { "initrf_root_is_in_same_site_instance_as_parent", kSmallSize}, | 222 {"initrf_root_is_in_same_site_instance_as_parent", kSmallSize}, |
223 { "initrf_root_process_is_live", kSmallSize}, | 223 {"initrf_root_process_is_live", kSmallSize}, |
224 { "initrf_root_proxy_is_live", kSmallSize}, | 224 {"initrf_root_proxy_is_live", kSmallSize}, |
225 | 225 |
226 // Temporary for https://crbug.com/626802. | 226 // Temporary for https://crbug.com/626802. |
227 { "newframe_routing_id", kSmallSize }, | 227 {"newframe_routing_id", kSmallSize}, |
228 { "newframe_proxy_id", kSmallSize }, | 228 {"newframe_proxy_id", kSmallSize}, |
229 { "newframe_opener_id", kSmallSize }, | 229 {"newframe_opener_id", kSmallSize}, |
230 { "newframe_parent_id", kSmallSize }, | 230 {"newframe_parent_id", kSmallSize}, |
231 { "newframe_widget_id", kSmallSize }, | 231 {"newframe_widget_id", kSmallSize}, |
232 { "newframe_widget_hidden", kSmallSize }, | 232 {"newframe_widget_hidden", kSmallSize}, |
233 { "newframe_replicated_origin", kSmallSize }, | 233 {"newframe_replicated_origin", kSmallSize}, |
234 { "newframe_oopifs_possible", kSmallSize }, | 234 {"newframe_oopifs_possible", kSmallSize}, |
235 | 235 |
236 // Temporary for https://crbug.com/630103. | 236 // Temporary for https://crbug.com/630103. |
237 { "origin_mismatch_url", crash_keys::kLargeSize }, | 237 {"origin_mismatch_url", crash_keys::kLargeSize}, |
238 { "origin_mismatch_origin", crash_keys::kMediumSize }, | 238 {"origin_mismatch_origin", crash_keys::kMediumSize}, |
239 { "origin_mismatch_transition", crash_keys::kSmallSize }, | 239 {"origin_mismatch_transition", crash_keys::kSmallSize}, |
240 { "origin_mismatch_redirects", crash_keys::kSmallSize }, | 240 {"origin_mismatch_redirects", crash_keys::kSmallSize}, |
241 { "origin_mismatch_same_page", crash_keys::kSmallSize }, | 241 {"origin_mismatch_same_page", crash_keys::kSmallSize}, |
242 | 242 |
243 // Temporary for https://crbug.com/612711. | 243 // Temporary for https://crbug.com/612711. |
244 { "aci_wrong_sp_extension_id", kSmallSize }, | 244 {"aci_wrong_sp_extension_id", kSmallSize}, |
245 | 245 |
246 // Temporary for https://crbug.com/668633. | 246 // Temporary for https://crbug.com/668633. |
247 { "swdh_set_hosted_version_worker_pid", crash_keys::kSmallSize }, | 247 {"swdh_set_hosted_version_worker_pid", crash_keys::kSmallSize}, |
248 { "swdh_set_hosted_version_host_pid", crash_keys::kSmallSize }, | 248 {"swdh_set_hosted_version_host_pid", crash_keys::kSmallSize}, |
249 { "swdh_set_hosted_version_is_new_process", crash_keys::kSmallSize }, | 249 {"swdh_set_hosted_version_is_new_process", crash_keys::kSmallSize}, |
250 { "swdh_set_hosted_version_restart_count", crash_keys::kSmallSize }, | 250 {"swdh_set_hosted_version_restart_count", crash_keys::kSmallSize}, |
251 }; | 251 }; |
252 | 252 |
253 // This dynamic set of keys is used for sets of key value pairs when gathering | 253 // This dynamic set of keys is used for sets of key value pairs when gathering |
254 // a collection of data, like command line switches or extension IDs. | 254 // a collection of data, like command line switches or extension IDs. |
255 std::vector<base::debug::CrashKey> keys( | 255 std::vector<base::debug::CrashKey> keys( |
256 fixed_keys, fixed_keys + arraysize(fixed_keys)); | 256 fixed_keys, fixed_keys + arraysize(fixed_keys)); |
257 | 257 |
258 crash_keys::GetCrashKeysForCommandLineSwitches(&keys); | 258 crash_keys::GetCrashKeysForCommandLineSwitches(&keys); |
259 | 259 |
260 // Register the extension IDs. | 260 // Register the extension IDs. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } | 377 } |
378 | 378 |
379 ScopedPrinterInfo::~ScopedPrinterInfo() { | 379 ScopedPrinterInfo::~ScopedPrinterInfo() { |
380 for (size_t i = 0; i < kPrinterInfoCount; ++i) { | 380 for (size_t i = 0; i < kPrinterInfoCount; ++i) { |
381 std::string key = base::StringPrintf(kPrinterInfo, i + 1); | 381 std::string key = base::StringPrintf(kPrinterInfo, i + 1); |
382 base::debug::ClearCrashKey(key); | 382 base::debug::ClearCrashKey(key); |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 } // namespace crash_keys | 386 } // namespace crash_keys |
OLD | NEW |