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

Unified Diff: chrome/app/chrome_crash_reporter_client_win.cc

Issue 2372633002: Use the correct product/version for postmortem reports (Closed)
Patch Set: Created 4 years, 3 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
Index: chrome/app/chrome_crash_reporter_client_win.cc
diff --git a/chrome/app/chrome_crash_reporter_client_win.cc b/chrome/app/chrome_crash_reporter_client_win.cc
index 139a0ed4f3ee7970d9c2127b95a799a9ba6411be..99c3394842f411c45deb05df7a61708b3f9fe07a 100644
--- a/chrome/app/chrome_crash_reporter_client_win.cc
+++ b/chrome/app/chrome_crash_reporter_client_win.cc
@@ -261,9 +261,27 @@ void ChromeCrashReporterClient::GetProductNameAndVersion(
assert(version);
assert(special_build);
assert(channel_name);
+ DCHECK(!exe_path.empty()); // The empty string is not a valid path.
- install_static::GetExecutableVersionDetails(
- exe_path, product_name, version, special_build, channel_name);
+ // Defend against unexpected use of function with varying |exe_path|.
+ if (!exe_path_.empty()) {
+ DCHECK_EQ(exe_path_, exe_path);
+ if (exe_path_ != exe_path)
grt (UTC plus 2) 2016/09/26 18:59:06 don't DCHECK and then handle the DCHECKed case as
manzagop (departed) 2016/09/27 19:37:52 Thanks for the pointer! Due to the changes, comme
+ exe_path_.clear(); // Clear the cache.
+ }
+
+ // Populate the cache.
+ if (exe_path_.empty()) {
+ exe_path_ = exe_path;
+ install_static::GetExecutableVersionDetails(
+ exe_path_, &product_name_, &version_, &special_build_, &channel_name_);
+ }
+
+ // Serve from the cache.
+ *product_name = product_name_;
+ *version = version_;
+ *special_build = special_build_;
+ *channel_name = channel_name_;
}
bool ChromeCrashReporterClient::ShouldShowRestartDialog(base::string16* title,

Powered by Google App Engine
This is Rietveld 408576698