From 967d402e91488f4e18f90022aae7dc2d82e933bf Mon Sep 17 00:00:00 2001 From: "bcwhite@chromium.org" Date: Tue, 30 Apr 2013 01:30:31 +0000 Subject: 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 --- rlz/lib/financial_ping.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rlz/lib') 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 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); -- cgit v1.1