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

Side by Side Diff: rlz/lib/financial_ping.cc

Issue 11275284: [cros,rlz] Financial ping livelock fix and proper shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert ps#2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « rlz/chromeos/lib/rlz_value_store_chromeos.cc ('k') | rlz/lib/rlz_lib.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Library functions related to the Financial Server ping. 5 // Library functions related to the Financial Server ping.
6 6
7 #include "rlz/lib/financial_ping.h" 7 #include "rlz/lib/financial_ping.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | 290 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN |
291 net::LOAD_DO_NOT_SEND_COOKIES | 291 net::LOAD_DO_NOT_SEND_COOKIES |
292 net::LOAD_DO_NOT_SAVE_COOKIES); 292 net::LOAD_DO_NOT_SAVE_COOKIES);
293 293
294 // Ensure rlz_lib::SetURLRequestContext() has been called before sending 294 // Ensure rlz_lib::SetURLRequestContext() has been called before sending
295 // pings. 295 // pings.
296 CHECK(g_context); 296 CHECK(g_context);
297 fetcher->SetRequestContext(g_context); 297 fetcher->SetRequestContext(g_context);
298 298
299 const base::TimeDelta kTimeout = base::TimeDelta::FromMinutes(5); 299 const base::TimeDelta kTimeout = base::TimeDelta::FromMinutes(5);
300 MessageLoop::ScopedNestableTaskAllower allow_nested(MessageLoop::current());
300 MessageLoop::current()->PostTask( 301 MessageLoop::current()->PostTask(
301 FROM_HERE, 302 FROM_HERE,
302 base::Bind(&net::URLFetcher::Start, base::Unretained(fetcher.get()))); 303 base::Bind(&net::URLFetcher::Start, base::Unretained(fetcher.get())));
303 MessageLoop::current()->PostNonNestableDelayedTask( 304 MessageLoop::current()->PostDelayedTask(
304 FROM_HERE, loop.QuitClosure(), kTimeout); 305 FROM_HERE, loop.QuitClosure(), kTimeout);
305 306
306 loop.Run(); 307 loop.Run();
307 308
308 if (fetcher->GetResponseCode() != 200) 309 if (fetcher->GetResponseCode() != 200)
309 return false; 310 return false;
310 311
311 return fetcher->GetResponseAsString(response); 312 return fetcher->GetResponseAsString(response);
312 #endif 313 #endif
313 } 314 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 354
354 bool FinancialPing::ClearLastPingTime(Product product) { 355 bool FinancialPing::ClearLastPingTime(Product product) {
355 ScopedRlzValueStoreLock lock; 356 ScopedRlzValueStoreLock lock;
356 RlzValueStore* store = lock.GetStore(); 357 RlzValueStore* store = lock.GetStore();
357 if (!store || !store->HasAccess(RlzValueStore::kWriteAccess)) 358 if (!store || !store->HasAccess(RlzValueStore::kWriteAccess))
358 return false; 359 return false;
359 return store->ClearPingTime(product); 360 return store->ClearPingTime(product);
360 } 361 }
361 362
362 } // namespace 363 } // namespace
OLDNEW
« no previous file with comments | « rlz/chromeos/lib/rlz_value_store_chromeos.cc ('k') | rlz/lib/rlz_lib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698