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

Side by Side Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 8341117: Converted top-level NewRunnable* to Bind for Sync module (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indenting. Removed trailing whitespace. Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/profile_sync_service_harness.h" 5 #include "chrome/browser/sync/profile_sync_service_harness.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <iterator> 9 #include <iterator>
10 #include <ostream> 10 #include <ostream>
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 LOG(ERROR) << "Sync disabled for " << profile_debug_name_ << "."; 757 LOG(ERROR) << "Sync disabled for " << profile_debug_name_ << ".";
758 return false; 758 return false;
759 } 759 }
760 scoped_refptr<StateChangeTimeoutEvent> timeout_signal( 760 scoped_refptr<StateChangeTimeoutEvent> timeout_signal(
761 new StateChangeTimeoutEvent(this, reason)); 761 new StateChangeTimeoutEvent(this, reason));
762 MessageLoop* loop = MessageLoop::current(); 762 MessageLoop* loop = MessageLoop::current();
763 bool did_allow_nestable_tasks = loop->NestableTasksAllowed(); 763 bool did_allow_nestable_tasks = loop->NestableTasksAllowed();
764 loop->SetNestableTasksAllowed(true); 764 loop->SetNestableTasksAllowed(true);
765 loop->PostDelayedTask( 765 loop->PostDelayedTask(
766 FROM_HERE, 766 FROM_HERE,
767 NewRunnableMethod(timeout_signal.get(), 767 base::Bind(&StateChangeTimeoutEvent::Callback,
768 &StateChangeTimeoutEvent::Callback), 768 timeout_signal.get()),
769 timeout_milliseconds); 769 timeout_milliseconds);
770 loop->Run(); 770 loop->Run();
771 loop->SetNestableTasksAllowed(did_allow_nestable_tasks); 771 loop->SetNestableTasksAllowed(did_allow_nestable_tasks);
772 if (timeout_signal->Abort()) { 772 if (timeout_signal->Abort()) {
773 VLOG(1) << GetClientInfoString("AwaitStatusChangeWithTimeout succeeded"); 773 VLOG(1) << GetClientInfoString("AwaitStatusChangeWithTimeout succeeded");
774 return true; 774 return true;
775 } else { 775 } else {
776 VLOG(0) << GetClientInfoString("AwaitStatusChangeWithTimeout timed out"); 776 VLOG(0) << GetClientInfoString("AwaitStatusChangeWithTimeout timed out");
777 return false; 777 return false;
778 } 778 }
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 return (synced_types.count(type) != 0); 1131 return (synced_types.count(type) != 0);
1132 } 1132 }
1133 1133
1134 std::string ProfileSyncServiceHarness::GetServiceStatus() { 1134 std::string ProfileSyncServiceHarness::GetServiceStatus() {
1135 DictionaryValue value; 1135 DictionaryValue value;
1136 sync_ui_util::ConstructAboutInformation(service_, &value); 1136 sync_ui_util::ConstructAboutInformation(service_, &value);
1137 std::string service_status; 1137 std::string service_status;
1138 base::JSONWriter::Write(&value, true, &service_status); 1138 base::JSONWriter::Write(&value, true, &service_status);
1139 return service_status; 1139 return service_status;
1140 } 1140 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_autofill_unittest.cc ('k') | chrome/browser/sync/profile_sync_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698