diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 05:07:55 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 05:07:55 +0000 |
commit | 2c58efc6135102d815c34d518d14c0bfc5c27f5b (patch) | |
tree | bf47fee779ada375a0007e4cc7b527e86a0293a3 /chrome/app | |
parent | 48844c643cca3d7d21043e46c228585e68618e31 (diff) | |
download | chromium_src-2c58efc6135102d815c34d518d14c0bfc5c27f5b.zip chromium_src-2c58efc6135102d815c34d518d14c0bfc5c27f5b.tar.gz chromium_src-2c58efc6135102d815c34d518d14c0bfc5c27f5b.tar.bz2 |
Revert 33255 - Report active extensions in crash reports. This only implements Windows right now. Mac and linux will be separate CLs.
"Active" is overloaded to mean different things depending on
the process type:
browser: all enabled extensions
renderer: unique set of extensions from all user scripts
extension: extensions running in the process
BUG=27169
Review URL: http://codereview.chromium.org/437078
--
There are thousands of new crashes with reivison 33256 and 33255, so i'm
reverting. the crashes are in chrome_2610000!child_process_logging::SetActiveURL
TBR=aa@chromium.org
Review URL: http://codereview.chromium.org/448006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/breakpad_win.cc | 113 | ||||
-rw-r--r-- | chrome/app/breakpad_win.h | 6 |
2 files changed, 50 insertions, 69 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 90cf549..297a034 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -33,10 +33,10 @@ const wchar_t kSystemPrincipalSid[] =L"S-1-5-18"; google_breakpad::ExceptionHandler* g_breakpad = NULL; -// Pointers to memory that will be sent in crash reports. These are kept updated -// over the life of the process. std::vector<wchar_t*>* g_url_chunks = NULL; -std::vector<wchar_t*>* g_extension_ids = NULL; + +// A string containing the user's unique metric services id. We send this +// in the crash report. wchar_t* g_client_id = NULL; // Dumps the current process memory. @@ -74,69 +74,69 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& dll_path, version = L"0.0.0.0-devel"; } - const int kNumCustomInfoEntries = 17; - static std::vector<google_breakpad::CustomInfoEntry> entries; - - // We save pointers into this as we're building it up and we don't want them - // to become invalid due to resizes. - entries.reserve(kNumCustomInfoEntries); - // Common entries. - entries.push_back(google_breakpad::CustomInfoEntry(L"ver", version.c_str())); - entries.push_back(google_breakpad::CustomInfoEntry(L"plat", L"Win32")); - entries.push_back(google_breakpad::CustomInfoEntry(L"ptype", type.c_str())); - - g_extension_ids = new std::vector<wchar_t*>(kMaxReportedActiveExtensions); - for (int i = 0; i < kMaxReportedActiveExtensions; ++i) { - entries.push_back(google_breakpad::CustomInfoEntry( - StringPrintf(L"extension-%i", i + 1).c_str(), L"")); - (*g_extension_ids)[i] = entries.back().value; - } + google_breakpad::CustomInfoEntry ver_entry(L"ver", version.c_str()); + google_breakpad::CustomInfoEntry prod_entry(L"prod", product.c_str()); + google_breakpad::CustomInfoEntry plat_entry(L"plat", L"Win32"); + google_breakpad::CustomInfoEntry type_entry(L"ptype", type.c_str()); // Read the id from registry. If reporting has never been enabled // the result will be empty string. Its OK since when user enables reporting // we will insert the new value at this location. std::wstring guid; GoogleUpdateSettings::GetMetricsId(&guid); - entries.push_back(google_breakpad::CustomInfoEntry(L"guid", guid.c_str())); - g_client_id = entries.back().value; + google_breakpad::CustomInfoEntry guid_entry(L"guid", guid.c_str()); if (type == L"renderer" || type == L"plugin") { // Create entries for the URL. Currently we only allow each chunk to be 64 // characters, which isn't enough for a URL. As a hack we create 8 entries // and split the URL across the entries. - g_url_chunks = new std::vector<wchar_t*>(kMaxUrlChunks); - for (int i = 0; i < kMaxUrlChunks; ++i) { - entries.push_back(google_breakpad::CustomInfoEntry( - StringPrintf(L"url-chunk-%i", i + 1).c_str(), L"")); - (*g_url_chunks)[i] = entries.back().value; - } - } else { - // Browser-specific entries. - google_breakpad::CustomInfoEntry switch1(L"switch-1", L""); - google_breakpad::CustomInfoEntry switch2(L"switch-2", L""); - - // Get the first two command line switches if they exist. The CommandLine - // class does not allow to enumerate the switches so we do it by hand. - int num_args = 0; - wchar_t** args = ::CommandLineToArgvW(::GetCommandLineW(), &num_args); - if (args) { - if (num_args > 1) - switch1.set_value(TrimToBreakpadMax(args[1]).c_str()); - if (num_args > 2) - switch2.set_value(TrimToBreakpadMax(args[2]).c_str()); - } - - entries.push_back(switch1); - entries.push_back(switch2); + google_breakpad::CustomInfoEntry url1(L"url-chunk-1", L""); + google_breakpad::CustomInfoEntry url2(L"url-chunk-2", L""); + google_breakpad::CustomInfoEntry url3(L"url-chunk-3", L""); + google_breakpad::CustomInfoEntry url4(L"url-chunk-4", L""); + google_breakpad::CustomInfoEntry url5(L"url-chunk-5", L""); + google_breakpad::CustomInfoEntry url6(L"url-chunk-6", L""); + google_breakpad::CustomInfoEntry url7(L"url-chunk-7", L""); + google_breakpad::CustomInfoEntry url8(L"url-chunk-8", L""); + + static google_breakpad::CustomInfoEntry entries[] = + { ver_entry, prod_entry, plat_entry, type_entry, guid_entry, + url1, url2, url3, url4, url5, url6, url7, url8 }; + + std::vector<wchar_t*>* tmp_url_chunks = new std::vector<wchar_t*>(8); + for (size_t i = 0; i < 8; ++i) + (*tmp_url_chunks)[i] = entries[5 + i].value; + g_url_chunks = tmp_url_chunks; + + g_client_id = entries[4].value; + + static google_breakpad::CustomClientInfo custom_info_renderer + = {entries, arraysize(entries)}; + return &custom_info_renderer; } - // If this fails, kNumCustomInfoEntries needs to be increased. - DCHECK(entries.size() <= entries.capacity()); + // Browser-specific entries. + google_breakpad::CustomInfoEntry switch1(L"switch-1", L""); + google_breakpad::CustomInfoEntry switch2(L"switch-2", L""); + + // Get the first two command line switches if they exist. The CommandLine + // class does not allow to enumerate the switches so we do it by hand. + int num_args = 0; + wchar_t** args = ::CommandLineToArgvW(::GetCommandLineW(), &num_args); + if (args) { + if (num_args > 1) + switch1.set_value(TrimToBreakpadMax(args[1]).c_str()); + if (num_args > 2) + switch2.set_value(TrimToBreakpadMax(args[2]).c_str()); + } + static google_breakpad::CustomInfoEntry entries[] = + {ver_entry, prod_entry, plat_entry, type_entry, guid_entry, + switch1, switch2}; + g_client_id = entries[4].value; static google_breakpad::CustomClientInfo custom_info_browser = - {&entries.front(), entries.size()}; - + {entries, arraysize(entries)}; return &custom_info_browser; } @@ -249,19 +249,6 @@ extern "C" void __declspec(dllexport) __cdecl SetClientId( client_id); } -extern "C" void __declspec(dllexport) __cdecl SetExtensionID( - int index, const wchar_t* id) { - DCHECK(id); - DCHECK(index < kMaxReportedActiveExtensions); - - if (!g_extension_ids) - return; - - wcscpy_s((*g_extension_ids)[index], - google_breakpad::CustomInfoEntry::kValueMaxLength, - id); -} - } // namespace // This function is executed by the child process that DumpDoneCallback() diff --git a/chrome/app/breakpad_win.h b/chrome/app/breakpad_win.h index 3a13149..c7cd9ec 100644 --- a/chrome/app/breakpad_win.h +++ b/chrome/app/breakpad_win.h @@ -8,12 +8,6 @@ #include <windows.h> #include <string> -// The maximum number of 64-char URL chunks we will report. -static const int kMaxUrlChunks = 8; - -// The maximum number of active extensions we will report. -static const int kMaxReportedActiveExtensions = 10; - // Calls InitCrashReporterThread in it's own thread for the browser process // or directly for the plugin and renderer process. void InitCrashReporterWithDllPath(const std::wstring& dll_path); |