diff options
author | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 21:33:28 +0000 |
---|---|---|
committer | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 21:33:28 +0000 |
commit | 9e95fd3e871e0bb43c08329e113965ea6d140837 (patch) | |
tree | acdc4eab0476fc20a0b633b63a539601928dd1ce /chrome/common | |
parent | 7d0d57e4f016f17a951102ab8fc04273b9f15a7c (diff) | |
download | chromium_src-9e95fd3e871e0bb43c08329e113965ea6d140837.zip chromium_src-9e95fd3e871e0bb43c08329e113965ea6d140837.tar.gz chromium_src-9e95fd3e871e0bb43c08329e113965ea6d140837.tar.bz2 |
Tweak minidump flags to include a little more detail.
In release channel this adds PEB/TEB and the unloaded module list to crash dumps.
In dev/beta channel builds this additionally adds stack-referenced memory to crash dumps.
For full memory dumps, this adds capture of the PEB/TEB, unloaded module list and all handle information.
These minidump flags have been verified safe against the DbgHelp.dll version shipping with XP SP2 and later.
Move some code from platform_util to install_util to allow reusing it in the chrome exe project.
Add a test for the additional install_util code.
BUG=32441
TEST=Unittests in this change.
Review URL: http://codereview.chromium.org/659001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/platform_util_win.cc | 64 |
1 files changed, 4 insertions, 60 deletions
diff --git a/chrome/common/platform_util_win.cc b/chrome/common/platform_util_win.cc index 5553c81..9313a51 100644 --- a/chrome/common/platform_util_win.cc +++ b/chrome/common/platform_util_win.cc @@ -17,6 +17,7 @@ #include "base/registry.h" #include "base/scoped_comptr_win.h" #include "base/string_util.h" +#include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/google_update_constants.h" #include "googleurl/src/gurl.h" @@ -151,68 +152,11 @@ void SimpleErrorBox(gfx::NativeWindow parent, win_util::MessageBox(parent, message, title, MB_OK | MB_SETFOREGROUND); } - -namespace { - -std::wstring CurrentChromeChannel() { - // Start by seeing if we can find the Clients key on the HKLM branch. - // For each search, require confirmation by looking for "name" - // inside it. We've noticed problems cleaning up the registry on - // uninstall or upgrade (http://crbug.com/33532, - // http://crbug.com/33534), and have other reports of inconsistency - // (http://crbug.com/32479). - HKEY registry_hive = HKEY_LOCAL_MACHINE; - std::wstring key = google_update::kRegPathClients + std::wstring(L"\\") + - google_update::kChromeUpgradeCode; - RegKey google_update_hklm(registry_hive, key.c_str(), KEY_READ); - - if (!google_update_hklm.Valid() || - !google_update_hklm.ValueExists(google_update::kRegNameField)) { - // HKLM failed us, try the same for the HKCU branch. - registry_hive = HKEY_CURRENT_USER; - RegKey google_update_hkcu(registry_hive, key.c_str(), KEY_READ); - if (!google_update_hkcu.Valid() || - !google_update_hkcu.ValueExists(google_update::kRegNameField)) { - // Unknown. - registry_hive = 0; - } - } - - std::wstring update_branch(L"unknown"); // the default. - if (registry_hive != 0) { - // Now that we know which hive to use, read the 'ap' key from it. - std::wstring key = google_update::kRegPathClientState + - std::wstring(L"\\") + google_update::kChromeUpgradeCode; - RegKey client_state(registry_hive, key.c_str(), KEY_READ); - client_state.ReadValue(google_update::kRegApField, &update_branch); - // If the parent folder exists (we have a valid install) but the - // 'ap' key is empty, we necessarily are the stable channel. - // So we print nothing. - if (update_branch.empty() && client_state.Valid()) { - update_branch = L""; - } - } - - // Map to something pithy for human consumption. There are no rules as to - // what the ap string can contain, but generally it will contain a number - // followed by a dash followed by the branch name (and then some random - // suffix). We fall back on empty string in case we fail to parse. - // Only ever return "", "unknown", "dev" or "beta". - if (update_branch.find(L"-beta") != std::wstring::npos) - update_branch = L"beta"; - else if (update_branch.find(L"-dev") != std::wstring::npos) - update_branch = L"dev"; - else if (!update_branch.empty()) - update_branch = L"unknown"; - - return update_branch; -} - -} // namespace - string16 GetVersionStringModifier() { #if defined(GOOGLE_CHROME_BUILD) - return CurrentChromeChannel(); + string16 channel; + GoogleUpdateSettings::GetChromeChannel(&channel); + return channel; #else return string16(); #endif |