Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "chrome/browser/sync/internal_api/sync_manager.h" | 5 #include "chrome/browser/sync/internal_api/sync_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 670 | 670 |
| 671 SyncManager::ChangeObserver::~ChangeObserver() {} | 671 SyncManager::ChangeObserver::~ChangeObserver() {} |
| 672 | 672 |
| 673 SyncManager::Observer::~Observer() {} | 673 SyncManager::Observer::~Observer() {} |
| 674 | 674 |
| 675 SyncManager::SyncManager(const std::string& name) | 675 SyncManager::SyncManager(const std::string& name) |
| 676 : data_(new SyncInternal(name)) {} | 676 : data_(new SyncInternal(name)) {} |
| 677 | 677 |
| 678 SyncManager::Status::Status() | 678 SyncManager::Status::Status() |
| 679 : summary(INVALID), | 679 : summary(INVALID), |
| 680 authenticated(false), | |
|
lipalani1
2012/02/11 00:12:10
Not sure removing authenticated is a good idea. I
| |
| 681 server_up(false), | |
| 682 server_reachable(false), | |
| 683 notifications_enabled(false), | 680 notifications_enabled(false), |
| 684 notifications_received(0), | 681 notifications_received(0), |
| 685 unsynced_count(0), | 682 unsynced_count(0), |
| 686 conflicting_count(0), | 683 conflicting_count(0), |
| 687 committed_count(0), | 684 committed_count(0), |
| 688 syncing(false), | 685 syncing(false), |
| 689 initial_sync_ended(false), | 686 initial_sync_ended(false), |
| 690 updates_available(0), | 687 updates_available(0), |
| 691 updates_received(0), | 688 updates_received(0), |
| 692 tombstone_updates_received(0), | 689 tombstone_updates_received(0), |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1714 | 1711 |
| 1715 void SyncManager::SyncInternal::OnIPAddressChangedImpl() { | 1712 void SyncManager::SyncInternal::OnIPAddressChangedImpl() { |
| 1716 DCHECK(thread_checker_.CalledOnValidThread()); | 1713 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1717 if (scheduler()) | 1714 if (scheduler()) |
| 1718 scheduler()->OnConnectionStatusChange(); | 1715 scheduler()->OnConnectionStatusChange(); |
| 1719 } | 1716 } |
| 1720 | 1717 |
| 1721 void SyncManager::SyncInternal::OnServerConnectionEvent( | 1718 void SyncManager::SyncInternal::OnServerConnectionEvent( |
| 1722 const ServerConnectionEvent& event) { | 1719 const ServerConnectionEvent& event) { |
| 1723 DCHECK(thread_checker_.CalledOnValidThread()); | 1720 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1724 allstatus_.HandleServerConnectionEvent(event); | |
| 1725 if (event.connection_code == | 1721 if (event.connection_code == |
| 1726 browser_sync::HttpResponse::SERVER_CONNECTION_OK) { | 1722 browser_sync::HttpResponse::SERVER_CONNECTION_OK) { |
| 1727 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1723 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 1728 OnAuthError(AuthError::None())); | 1724 OnAuthError(AuthError::None())); |
| 1729 } | 1725 } |
| 1730 | 1726 |
| 1731 if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) { | 1727 if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) { |
| 1732 observing_ip_address_changes_ = false; | 1728 observing_ip_address_changes_ = false; |
| 1733 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1729 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 1734 OnAuthError(AuthError(AuthError::INVALID_GAIA_CREDENTIALS))); | 1730 OnAuthError(AuthError(AuthError::INVALID_GAIA_CREDENTIALS))); |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2493 lookup->GetDownloadProgress(i.Get(), &marker); | 2489 lookup->GetDownloadProgress(i.Get(), &marker); |
| 2494 | 2490 |
| 2495 if (marker.token().empty()) | 2491 if (marker.token().empty()) |
| 2496 result.Put(i.Get()); | 2492 result.Put(i.Get()); |
| 2497 | 2493 |
| 2498 } | 2494 } |
| 2499 return result; | 2495 return result; |
| 2500 } | 2496 } |
| 2501 | 2497 |
| 2502 } // namespace sync_api | 2498 } // namespace sync_api |
| OLD | NEW |