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

Unified Diff: chrome/app/chrome_breakpad_client.cc

Issue 19556005: Remove dependency from breakpad files on chrome switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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 | « chrome/app/chrome_breakpad_client.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_breakpad_client.cc
diff --git a/chrome/app/chrome_breakpad_client.cc b/chrome/app/chrome_breakpad_client.cc
index 81c25ef97c9f1bf37140aaed2e38793b7a1df0bb..fa759a08b0ff85de51aa33cde7ad178b2623d93c 100644
--- a/chrome/app/chrome_breakpad_client.cc
+++ b/chrome/app/chrome_breakpad_client.cc
@@ -4,11 +4,19 @@
#include "chrome/app/chrome_breakpad_client.h"
+#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file_path.h"
+#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
+
+#if defined(OS_WIN)
+#include "base/file_version_info.h"
+#endif
#if defined(OS_POSIX)
#include "chrome/common/dump_without_crashing.h"
@@ -34,6 +42,39 @@ bool ChromeBreakpadClient::GetAlternativeCrashDumpLocation(
return false;
}
+
+void ChromeBreakpadClient::GetProductNameAndVersion(
+ const base::FilePath& exe_path,
+ base::string16* product_name,
+ base::string16* version,
+ base::string16* special_build) {
+ DCHECK(product_name);
+ DCHECK(version);
+ DCHECK(special_build);
+
+ scoped_ptr<FileVersionInfo> version_info(
+ FileVersionInfo::CreateFileVersionInfo(exe_path));
+
+ if (version_info.get()) {
+ // Get the information from the file.
+ *version = version_info->product_version();
+ if (!version_info->is_official_build())
+ version->append(base::ASCIIToUTF16("-devel"));
+
+ const CommandLine& command = *CommandLine::ForCurrentProcess();
+ if (command.HasSwitch(switches::kChromeFrame)) {
+ *product_name = base::ASCIIToUTF16("ChromeFrame");
+ } else {
+ *product_name = version_info->product_short_name();
+ }
+
+ *special_build = version_info->special_build();
+ } else {
+ // No version info found. Make up the values.
+ *product_name = base::ASCIIToUTF16("Chrome");
+ *version = base::ASCIIToUTF16("0.0.0.0-devel");
+ }
+}
#endif
bool ChromeBreakpadClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
« no previous file with comments | « chrome/app/chrome_breakpad_client.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698