summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbcwhite@chromium.org <bcwhite@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 01:30:31 +0000
committerbcwhite@chromium.org <bcwhite@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 01:30:31 +0000
commit967d402e91488f4e18f90022aae7dc2d82e933bf (patch)
tree2c2f3d1647d56d664b8ea2d46bff682c03ffdc96
parentaf9407cfd831760141ac78411e0f7dcc47e1e999 (diff)
downloadchromium_src-967d402e91488f4e18f90022aae7dc2d82e933bf.zip
chromium_src-967d402e91488f4e18f90022aae7dc2d82e933bf.tar.gz
chromium_src-967d402e91488f4e18f90022aae7dc2d82e933bf.tar.bz2
Detect when chrome is shutting down and don't SendFinacialPing
BUG=160810 Review URL: https://chromiumcodereview.appspot.com/13868016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197214 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/rlz/rlz.cc1
-rw-r--r--chrome/browser/rlz/rlz.h3
-rw-r--r--rlz/lib/financial_ping.cc5
3 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 12a820b..a249379 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -581,6 +581,7 @@ bool RLZTracker::ScheduleClearRlzState() {
void RLZTracker::CleanupRlz() {
GetInstance()->rlz_cache_.clear();
GetInstance()->registrar_.RemoveAll();
+ rlz_lib::SetURLRequestContext(NULL);
}
// static
diff --git a/chrome/browser/rlz/rlz.h b/chrome/browser/rlz/rlz.h
index 23075e1..53484e1 100644
--- a/chrome/browser/rlz/rlz.h
+++ b/chrome/browser/rlz/rlz.h
@@ -201,9 +201,6 @@ class RLZTracker : public content::NotificationObserver {
// sequentially in the blocking pool.
base::SequencedWorkerPool::SequenceToken worker_pool_token_;
- // URLRequestContextGetter used by RLZ library.
- net::URLRequestContextGetter* url_request_context_;
-
// Keeps track if the RLZ tracker has already performed its delayed
// initialization.
bool already_ran_;
diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc
index 5a70641..e6cbef3 100644
--- a/rlz/lib/financial_ping.cc
+++ b/rlz/lib/financial_ping.cc
@@ -265,6 +265,10 @@ bool FinancialPing::PingServer(const char* request, std::string* response) {
return true;
#else
+ // Browser shutdown will cause the context to be reset to NULL.
+ if (!g_context)
+ return false;
+
// Run a blocking event loop to match the win inet implementation.
scoped_ptr<base::MessageLoop> message_loop;
// Ensure that we have a MessageLoop.
@@ -288,7 +292,6 @@ bool FinancialPing::PingServer(const char* request, std::string* response) {
// Ensure rlz_lib::SetURLRequestContext() has been called before sending
// pings.
- CHECK(g_context);
fetcher->SetRequestContext(g_context);
const base::TimeDelta kTimeout = base::TimeDelta::FromMinutes(5);