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

Unified Diff: chrome/common/crash_keys.cc

Issue 1849413003: Define crash keys in the directory hierarchy where they are used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with head Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_exe.gypi ('k') | components/crash/core/common/crash_keys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/crash_keys.cc
diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc
index e331053d6ca3766efb04d2a60e46d48bcf94a509..a8cbed24e7f36c332b4034cfa2eaa604d5094c80 100644
--- a/chrome/common/crash_keys.cc
+++ b/chrome/common/crash_keys.cc
@@ -14,9 +14,12 @@
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "chrome/common/chrome_switches.h"
+#include "components/crash/core/common/crash_keys.h"
#include "components/flags_ui/flags_ui_switches.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/crash_keys.h"
#include "ipc/ipc_switches.h"
+#include "media/base/crash_keys.h"
#if defined(OS_CHROMEOS)
#include "chrome/common/chrome_switches.h"
@@ -28,8 +31,6 @@ namespace crash_keys {
const char kActiveURL[] = "url-chunk";
-const char kFontKeyName[] = "font_key_name";
-
const char kExtensionID[] = "extension-%" PRIuS;
const char kNumExtensionsCount[] = "num-extensions";
@@ -49,10 +50,6 @@ const char kGPUVendor[] = "gpu-gl-vendor";
const char kGPURenderer[] = "gpu-gl-renderer";
#endif
-#if defined(OS_WIN)
-const char kHungAudioThreadDetails[] = "hung-audio-thread-details";
-#endif
-
const char kPrinterInfo[] = "prn-info-%" PRIuS;
#if defined(OS_CHROMEOS)
@@ -76,31 +73,16 @@ const char kSendAction[] = "sendaction";
} // namespace mac
#endif
-#if BUILDFLAG(ENABLE_KASKO)
-const char kKaskoGuid[] = "kasko-guid";
-const char kKaskoEquivalentGuid[] = "kasko-equivalent-guid";
-#endif
-
const char kViewCount[] = "view-count";
-const char kZeroEncodeDetails[] = "zero-encode-details";
+namespace {
-size_t RegisterChromeCrashKeys() {
- // The following keys may be chunked by the underlying crash logging system,
- // but ultimately constitute a single key-value pair.
- //
- // If you're adding keys here, please also add them to the list in
- // //blimp/engine/app/blimp_engine_crash_keys.cc
- base::debug::CrashKey fixed_keys[] = {
-#if defined(OS_MACOSX) || defined(OS_WIN)
- { kMetricsClientId, kSmallSize },
-#else
- { kClientId, kSmallSize },
-#endif
- { kChannel, kSmallSize },
- { kActiveURL, kLargeSize },
- { kNumVariations, kSmallSize },
- { kVariations, kLargeSize },
+// Appends crash keys used under //chrome to |keys|.
+void AppendChromeCrashKeys(std::vector<base::debug::CrashKey>* keys) {
+ DCHECK(keys);
+
+ const std::vector<base::debug::CrashKey> chrome_keys = {
+ { kActiveURL, kSmallSize },
{ kNumExtensionsCount, kSmallSize },
{ kShutdownType, kSmallSize },
#if !defined(OS_ANDROID)
@@ -116,15 +98,6 @@ size_t RegisterChromeCrashKeys() {
{ kGPUVendor, kSmallSize },
{ kGPURenderer, kSmallSize },
#endif
-
- // content/:
- { "bad_message_reason", kSmallSize },
- { "discardable-memory-allocated", kSmallSize },
- { "discardable-memory-free", kSmallSize },
- { kFontKeyName, kSmallSize},
- { "ppapi_path", kMediumSize },
- { "subresource_url", kLargeSize },
- { "total-discardable-memory-allocated", kSmallSize },
#if defined(OS_CHROMEOS)
{ kNumberOfUsers, kSmallSize },
#endif
@@ -136,61 +109,13 @@ size_t RegisterChromeCrashKeys() {
{ mac::kNSException, kMediumSize },
{ mac::kNSExceptionTrace, kMediumSize },
{ mac::kSendAction, kMediumSize },
- { mac::kZombie, kMediumSize },
- { mac::kZombieTrace, kMediumSize },
- // content/:
- { "channel_error_bt", kMediumSize },
- { "remove_route_bt", kMediumSize },
- { "rwhvm_window", kMediumSize },
- // media/:
-#endif
-#if BUILDFLAG(ENABLE_KASKO)
- { kKaskoGuid, kSmallSize },
- { kKaskoEquivalentGuid, kSmallSize },
#endif
- { kBug464926CrashKey, kSmallSize },
{ kViewCount, kSmallSize },
- // media/:
-#if defined(OS_WIN)
- { kHungAudioThreadDetails, kSmallSize },
-#endif
- { kZeroEncodeDetails, kSmallSize },
-
// gin/:
+ // TODO(marcinjb): Figure out where this goes.
{ "v8-ignition", kSmallSize },
- // Temporary for http://crbug.com/575245.
- { "swapout_frame_id", kSmallSize },
- { "swapout_proxy_id", kSmallSize },
- { "swapout_view_id", kSmallSize },
- { "commit_frame_id", kSmallSize },
- { "commit_proxy_id", kSmallSize },
- { "commit_view_id", kSmallSize },
- { "commit_main_render_frame_id", kSmallSize },
- { "newproxy_proxy_id", kSmallSize },
- { "newproxy_view_id", kSmallSize },
- { "newproxy_opener_id", kSmallSize },
- { "newproxy_parent_id", kSmallSize },
- { "rvinit_view_id", kSmallSize },
- { "rvinit_proxy_id", kSmallSize },
- { "rvinit_main_frame_id", kSmallSize },
- { "initrf_frame_id", kSmallSize },
- { "initrf_proxy_id", kSmallSize },
- { "initrf_view_id", kSmallSize },
- { "initrf_main_frame_id", kSmallSize },
- { "initrf_view_is_live", kSmallSize },
-
- // Temporary for https://crbug.com/591478.
- { "initrf_parent_proxy_exists", kSmallSize },
- { "initrf_render_view_is_live", kSmallSize },
- { "initrf_parent_is_in_same_site_instance", kSmallSize},
- { "initrf_parent_process_is_live", kSmallSize},
- { "initrf_root_is_in_same_site_instance", kSmallSize},
- { "initrf_root_is_in_same_site_instance_as_parent", kSmallSize},
- { "initrf_root_process_is_live", kSmallSize},
- { "initrf_root_proxy_is_live", kSmallSize},
-
// Temporary for https://crbug.com/612711.
{ "aci_wrong_sp_extension_id", kSmallSize },
@@ -208,11 +133,22 @@ size_t RegisterChromeCrashKeys() {
{ "swdh_not_handled_worker_status", crash_keys::kMediumSize },
};
- // This dynamic set of keys is used for sets of key value pairs when gathering
- // a collection of data, like command line switches or extension IDs.
- std::vector<base::debug::CrashKey> keys(
- fixed_keys, fixed_keys + arraysize(fixed_keys));
+ keys->insert(keys->end(), chrome_keys.begin(), chrome_keys.end());
+}
+
+} // namespace
+size_t RegisterChromeCrashKeys() {
+ // Get the base set of crash keys used throughout the different components.
+ // If you are adding a crash key, add it to the appropriate "Append" function
+ // so that it is owned in the right directory hierarchy.
+ std::vector<base::debug::CrashKey> keys;
+ AppendChromeCrashKeys(&keys); // //chrome keys
+ AppendCrashCrashKeys(&keys); // //components/crash keys
+ AppendContentCrashKeys(&keys); // //content keys
+ AppendMediaCrashKeys(&keys); // //media keys
+
+ // Register command line switches.
crash_keys::GetCrashKeysForCommandLineSwitches(&keys);
// Register the extension IDs.
« no previous file with comments | « chrome/chrome_exe.gypi ('k') | components/crash/core/common/crash_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698