Index: chrome/browser/rlz/rlz.cc |
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc |
index 12a820b0621dcef63b9b83b040f494b893f66d80..1fbee413c441b3c864aead08294e9e298529de1a 100644 |
--- a/chrome/browser/rlz/rlz.cc |
+++ b/chrome/browser/rlz/rlz.cc |
@@ -58,6 +58,8 @@ using content::NavigationEntry; |
namespace { |
+bool chrome_is_exiting = false; |
+ |
// Maximum and minimum delay for financial ping we would allow to be set through |
// master preferences. Somewhat arbitrary, may need to be adjusted in future. |
const base::TimeDelta kMaxInitDelay = base::TimeDelta::FromSeconds(200); |
@@ -138,6 +140,11 @@ void RecordProductEvents(bool first_run, |
bool SendFinancialPing(const std::string& brand, |
const string16& lang, |
const string16& referral) { |
+ // It's possible for the user to close Chrome just before the time that this |
+ // ping is due to go out. Detect that condition and abort. |
+ if (chrome_is_exiting) |
+ return false; |
+ |
rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, |
RLZTracker::CHROME_HOME_PAGE, |
rlz_lib::NO_ACCESS_POINT}; |
@@ -587,3 +594,8 @@ void RLZTracker::CleanupRlz() { |
void RLZTracker::EnableZeroDelayForTesting() { |
GetInstance()->min_init_delay_ = base::TimeDelta(); |
} |
+ |
+// static |
+void RLZTracker::PostMainMessageLoopRun() { |
+ chrome_is_exiting = true; |
Roger Tawa OOO till Jul 10th
2013/04/29 16:56:45
Instead of a new global variable, I think we shoul
bcwhite
2013/04/29 19:21:34
The financial_ping code uses this value without ch
|
+} |