summaryrefslogtreecommitdiffstats
path: root/chrome/browser/rlz
diff options
context:
space:
mode:
authorbcwhite@chromium.org <bcwhite@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 22:00:10 +0000
committerbcwhite@chromium.org <bcwhite@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 22:00:10 +0000
commit58227e3777b1e61c3ba105de9b520399f5536401 (patch)
tree5322925a87a10deee91bd3bb090d917a555f5b96 /chrome/browser/rlz
parentdb3e839d6a1c0dde03827a6d9dd9ff824b4e7a9a (diff)
downloadchromium_src-58227e3777b1e61c3ba105de9b520399f5536401.zip
chromium_src-58227e3777b1e61c3ba105de9b520399f5536401.tar.gz
chromium_src-58227e3777b1e61c3ba105de9b520399f5536401.tar.bz2
abort SendFinancialPing if process is shutting down
BUG=160810 Review URL: https://chromiumcodereview.appspot.com/11419137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/rlz')
-rw-r--r--chrome/browser/rlz/rlz.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 6032dd9..3a4e9db 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -47,6 +47,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;
+
using content::BrowserThread;
using content::NavigationEntry;
@@ -123,6 +128,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;
+
rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX,
RLZTracker::CHROME_HOME_PAGE,
rlz_lib::NO_ACCESS_POINT};