OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "chrome/browser/prefs/pref_service.h" | 6 #include "chrome/browser/prefs/pref_service.h" |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/net/gaia/token_service.h" | 8 #include "chrome/browser/net/gaia/token_service.h" |
9 #include "chrome/browser/sync/glue/sync_backend_host.h" | 9 #include "chrome/browser/sync/glue/sync_backend_host.h" |
10 #include "chrome/browser/sync/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/profile_sync_service_harness.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 MessageLoop* loop = MessageLoop::current(); | 417 MessageLoop* loop = MessageLoop::current(); |
418 bool did_allow_nestable_tasks = loop->NestableTasksAllowed(); | 418 bool did_allow_nestable_tasks = loop->NestableTasksAllowed(); |
419 loop->SetNestableTasksAllowed(true); | 419 loop->SetNestableTasksAllowed(true); |
420 loop->PostDelayedTask( | 420 loop->PostDelayedTask( |
421 FROM_HERE, | 421 FROM_HERE, |
422 NewRunnableMethod(timeout_signal.get(), | 422 NewRunnableMethod(timeout_signal.get(), |
423 &StateChangeTimeoutEvent::Callback), | 423 &StateChangeTimeoutEvent::Callback), |
424 timeout_milliseconds); | 424 timeout_milliseconds); |
425 loop->Run(); | 425 loop->Run(); |
426 loop->SetNestableTasksAllowed(did_allow_nestable_tasks); | 426 loop->SetNestableTasksAllowed(did_allow_nestable_tasks); |
427 LogClientInfo("AwaitStatusChangeWithTimeout succeeded"); | 427 if (timeout_signal->Abort()) { |
428 return timeout_signal->Abort(); | 428 LogClientInfo("AwaitStatusChangeWithTimeout succeeded"); |
| 429 return true; |
| 430 } else { |
| 431 LogClientInfo("AwaitStatusChangeWithTimeout timed out"); |
| 432 return false; |
| 433 } |
429 } | 434 } |
430 | 435 |
431 ProfileSyncService::Status ProfileSyncServiceHarness::GetStatus() { | 436 ProfileSyncService::Status ProfileSyncServiceHarness::GetStatus() { |
432 DCHECK(service() != NULL) << "GetStatus(): service() is NULL."; | 437 DCHECK(service() != NULL) << "GetStatus(): service() is NULL."; |
433 return service()->QueryDetailedSyncStatus(); | 438 return service()->QueryDetailedSyncStatus(); |
434 } | 439 } |
435 | 440 |
436 bool ProfileSyncServiceHarness::IsSynced() { | 441 bool ProfileSyncServiceHarness::IsSynced() { |
437 LogClientInfo("IsSynced"); | 442 LogClientInfo("IsSynced"); |
438 if (service() == NULL) | 443 if (service() == NULL) |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 << ", service_is_pushing_changes: " << ServiceIsPushingChanges(); | 567 << ", service_is_pushing_changes: " << ServiceIsPushingChanges(); |
563 } else { | 568 } else { |
564 VLOG(1) << "Client " << id_ << ": " << message | 569 VLOG(1) << "Client " << id_ << ": " << message |
565 << ": Sync session snapshot not available."; | 570 << ": Sync session snapshot not available."; |
566 } | 571 } |
567 } else { | 572 } else { |
568 VLOG(1) << "Client " << id_ << ": " << message | 573 VLOG(1) << "Client " << id_ << ": " << message |
569 << ": Sync service not available."; | 574 << ": Sync service not available."; |
570 } | 575 } |
571 } | 576 } |
OLD | NEW |