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

Unified Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months 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
Index: chrome/browser/sync/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index 34b6124c510140ac1f4de1c4be07818fbdd28bad..c13f8add31dee9520fecc2f6b5dac36e85601368 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -746,16 +746,16 @@ bool ProfileSyncServiceHarness::AwaitStatusChangeWithTimeout(
}
scoped_refptr<StateChangeTimeoutEvent> timeout_signal(
new StateChangeTimeoutEvent(this, reason));
+
jar (doing other things) 2012/02/11 03:24:38 nit: You probably don't need the black line.
dhollowa 2012/02/13 17:44:26 Done.
MessageLoop* loop = MessageLoop::current();
- bool did_allow_nestable_tasks = loop->NestableTasksAllowed();
- loop->SetNestableTasksAllowed(true);
+ MessageLoop::ScopedNestableTaskAllower allow(loop);
loop->PostDelayedTask(
FROM_HERE,
base::Bind(&StateChangeTimeoutEvent::Callback,
timeout_signal.get()),
base::TimeDelta::FromMilliseconds(timeout_milliseconds));
loop->Run();
- loop->SetNestableTasksAllowed(did_allow_nestable_tasks);
+
if (timeout_signal->Abort()) {
Ryan Sleevi 2012/02/11 02:17:22 Is it any concern that this call now runs while ne
jar (doing other things) 2012/02/11 03:24:38 +1 Please enclose lines 751 to 757 in a local sco
dhollowa 2012/02/13 17:44:26 I'd left it out for readability, the signal manipu
dhollowa 2012/02/13 17:44:26 Done.
DVLOG(1) << GetClientInfoString("AwaitStatusChangeWithTimeout succeeded");
return true;

Powered by Google App Engine
This is Rietveld 408576698