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

Unified Diff: chrome/browser/rlz/rlz.cc

Issue 11419137: abort SendFinancialPing if process is shutting down (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/rlz/rlz.cc
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 7005e32d47c199b57d171818dd68c6e9a37feff3..20901fc36925438dd8fb344d2bfb98eccfa7a24e 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -51,6 +51,11 @@ static bool ClearReferral() {
} // namespace GoogleUpdateSettings
#endif
+// There is no corresponding header for content/browser/browser_main_runner.cc
+// to export this global but it is used in other places as well (also defined
+// as "extern").
+extern bool g_exited_main_message_loop;
jam 2012/12/03 15:46:05 this is wrong. internal variables of content shoul
+
using content::BrowserThread;
using content::NavigationEntry;
@@ -129,6 +134,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 (g_exited_main_message_loop)
+ return false;
Glenn Wilson 2012/11/27 01:17:49 is SendFinancialPing the right depth for this? Sh
+
rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX,
RLZTracker::CHROME_HOME_PAGE,
rlz_lib::NO_ACCESS_POINT};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698