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

Unified Diff: chrome_frame/chrome_frame_reporting.cc

Issue 283019: Pick up version number from resources for crash dumps.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | chrome_frame/chrome_tab_version.rc.version » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/chrome_frame_reporting.cc
===================================================================
--- chrome_frame/chrome_frame_reporting.cc (revision 29266)
+++ chrome_frame/chrome_frame_reporting.cc (working copy)
@@ -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 @@
}
return InitializeVectoredCrashReporting(false, user_sid.c_str(),
- temp_directory.value(), GetCustomInfo());
+ temp_directory.value(), GetCustomInfo(dll_path));
}
bool ShutdownCrashReporting() {
« no previous file with comments | « no previous file | chrome_frame/chrome_tab_version.rc.version » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698