summaryrefslogtreecommitdiffstats
path: root/chrome/app/breakpad_win.cc
diff options
context:
space:
mode:
authorantonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 13:50:06 +0000
committerantonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 13:50:06 +0000
commit80ddb0445a0ac70b0d7dfc92c51e052b54a9ef18 (patch)
treef723465194a8230705252e27cddfa47a82209782 /chrome/app/breakpad_win.cc
parentd21e80e559544cd9ae0b4f2538c30e6087d88935 (diff)
downloadchromium_src-80ddb0445a0ac70b0d7dfc92c51e052b54a9ef18.zip
chromium_src-80ddb0445a0ac70b0d7dfc92c51e052b54a9ef18.tar.gz
chromium_src-80ddb0445a0ac70b0d7dfc92c51e052b54a9ef18.tar.bz2
Dump total number of extensions into crash dump meta data.
Review URL: http://codereview.chromium.org/3520015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/breakpad_win.cc')
-rw-r--r--chrome/app/breakpad_win.cc26
1 files changed, 20 insertions, 6 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 5f31438..5d57166 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -66,6 +66,7 @@ google_breakpad::ExceptionHandler* g_breakpad = NULL;
// data updated as the state of the browser changes.
static std::vector<google_breakpad::CustomInfoEntry>* g_custom_entries = NULL;
static size_t g_url_chunks_offset;
+static size_t g_num_of_extensions_offset;
static size_t g_extension_ids_offset;
static size_t g_client_id_offset;
static size_t g_gpu_info_offset;
@@ -120,6 +121,10 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& dll_path,
g_custom_entries->push_back(
google_breakpad::CustomInfoEntry(L"ptype", type.c_str()));
+ g_num_of_extensions_offset = g_custom_entries->size();
+ g_custom_entries->push_back(
+ google_breakpad::CustomInfoEntry(L"num-extensions", L"N/A"));
+
g_extension_ids_offset = g_custom_entries->size();
for (int i = 0; i < kMaxReportedActiveExtensions; ++i) {
g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
@@ -310,6 +315,20 @@ extern "C" void __declspec(dllexport) __cdecl SetClientId(
client_id);
}
+static void SetIntegerValue(size_t offset, int value) {
+ if (!g_custom_entries)
+ return;
+
+ wcscpy_s((*g_custom_entries)[offset].value,
+ google_breakpad::CustomInfoEntry::kValueMaxLength,
+ StringPrintf(L"%d", value).c_str());
+}
+
+extern "C" void __declspec(dllexport) __cdecl SetNumberOfExtensions(
+ int number_of_extensions) {
+ SetIntegerValue(g_num_of_extensions_offset, number_of_extensions);
+}
+
extern "C" void __declspec(dllexport) __cdecl SetExtensionID(
int index, const wchar_t* id) {
DCHECK(id);
@@ -349,12 +368,7 @@ extern "C" void __declspec(dllexport) __cdecl SetGpuInfo(
extern "C" void __declspec(dllexport) __cdecl SetNumberOfViews(
int number_of_views) {
- if (!g_custom_entries)
- return;
-
- wcscpy_s((*g_custom_entries)[g_num_of_views_offset].value,
- google_breakpad::CustomInfoEntry::kValueMaxLength,
- StringPrintf(L"%d", number_of_views).c_str());
+ SetIntegerValue(g_num_of_views_offset, number_of_views);
}
} // namespace