summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_reporting.cc
diff options
context:
space:
mode:
authorstoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 22:32:53 +0000
committerstoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 22:32:53 +0000
commitfbe6726824edb9f142a48836abe70bf5c1c577f2 (patch)
treed187b432f06bb85cbce456c5ce568cf81beed3c3 /chrome_frame/chrome_frame_reporting.cc
parentec12ffe60e6d1e26833fb5c518fd6c85ab0c12bb (diff)
downloadchromium_src-fbe6726824edb9f142a48836abe70bf5c1c577f2.zip
chromium_src-fbe6726824edb9f142a48836abe70bf5c1c577f2.tar.gz
chromium_src-fbe6726824edb9f142a48836abe70bf5c1c577f2.tar.bz2
Pick up version number from resources for crash dumps.
TEST=dumps uploaded to crashserver has correct version info. BUG=24900 Review URL: http://codereview.chromium.org/283019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29344 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_reporting.cc')
-rw-r--r--chrome_frame/chrome_frame_reporting.cc28
1 files changed, 21 insertions, 7 deletions
diff --git a/chrome_frame/chrome_frame_reporting.cc b/chrome_frame/chrome_frame_reporting.cc
index c2cc282..170a710 100644
--- a/chrome_frame/chrome_frame_reporting.cc
+++ b/chrome_frame/chrome_frame_reporting.cc
@@ -6,6 +6,7 @@
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/file_version_info.h"
#include "base/win_util.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/install_util.h"
@@ -14,12 +15,25 @@
// Well known SID for the system principal.
const wchar_t kSystemPrincipalSid[] = L"S-1-5-18";
-// Returns the custom info structure based on the dll in parameter and the
-// process type.
-google_breakpad::CustomClientInfo* GetCustomInfo() {
- // TODO(joshia): Grab these based on build.
- static google_breakpad::CustomInfoEntry ver_entry(L"ver", L"0.1.0.0");
- static google_breakpad::CustomInfoEntry prod_entry(L"prod", L"ChromeFrame");
+// Returns the custom info structure based on the dll in parameter
+google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* dll_path) {
+ std::wstring product;
+ std::wstring version;
+ scoped_ptr<FileVersionInfo>
+ version_info(FileVersionInfo::CreateFileVersionInfo(dll_path));
+ if (version_info.get()) {
+ version = version_info->product_version();
+ product = version_info->product_short_name();
+ }
+
+ if (version.empty())
+ version = L"0.1.0.0";
+
+ if (product.empty())
+ product = L"ChromeFrame";
+
+ static google_breakpad::CustomInfoEntry ver_entry(L"ver", version.c_str());
+ static google_breakpad::CustomInfoEntry prod_entry(L"prod", product.c_str());
static google_breakpad::CustomInfoEntry plat_entry(L"plat", L"Win32");
static google_breakpad::CustomInfoEntry type_entry(L"ptype", L"chrome_frame");
static google_breakpad::CustomInfoEntry entries[] = {
@@ -60,7 +74,7 @@ bool InitializeCrashReporting() {
}
return InitializeVectoredCrashReporting(false, user_sid.c_str(),
- temp_directory.value(), GetCustomInfo());
+ temp_directory.value(), GetCustomInfo(dll_path));
}
bool ShutdownCrashReporting() {