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

Side by Side Diff: chrome/browser/sync/engine/syncapi.cc

Issue 3078022: Unplumb AllStatus from SyncerThread. (Closed)
Patch Set: parens Created 10 years, 4 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/sync/engine/syncapi.h" 5 #include "chrome/browser/sync/engine/syncapi.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <iomanip> 9 #include <iomanip>
10 #include <list> 10 #include <list>
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 return false; 841 return false;
842 } 842 }
843 *response_code = static_cast<int>(int_response_code); 843 *response_code = static_cast<int>(int_response_code);
844 response_body->assign(http->GetResponseContent(), 844 response_body->assign(http->GetResponseContent(),
845 http->GetResponseContentLength()); 845 http->GetResponseContentLength());
846 post_factory_->Destroy(http); 846 post_factory_->Destroy(http);
847 return true; 847 return true;
848 } 848 }
849 849
850 virtual int GetBackoffDelaySeconds(int current_backoff_delay) { 850 virtual int GetBackoffDelaySeconds(int current_backoff_delay) {
851 return AllStatus::GetRecommendedDelaySeconds(current_backoff_delay); 851 return SyncerThread::GetRecommendedDelaySeconds(current_backoff_delay);
852 } 852 }
853 private: 853 private:
854 const std::string gaia_source_; 854 const std::string gaia_source_;
855 scoped_ptr<HttpPostProviderFactory> post_factory_; 855 scoped_ptr<HttpPostProviderFactory> post_factory_;
856 DISALLOW_COPY_AND_ASSIGN(BridgedGaiaAuthenticator); 856 DISALLOW_COPY_AND_ASSIGN(BridgedGaiaAuthenticator);
857 }; 857 };
858 858
859 ////////////////////////////////////////////////////////////////////////// 859 //////////////////////////////////////////////////////////////////////////
860 // SyncManager's implementation: SyncManager::SyncInternal 860 // SyncManager's implementation: SyncManager::SyncInternal
861 class SyncManager::SyncInternal 861 class SyncManager::SyncInternal
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 1367
1368 authwatcher_hookup_.reset(NewEventListenerHookup(auth_watcher_->channel(), 1368 authwatcher_hookup_.reset(NewEventListenerHookup(auth_watcher_->channel(),
1369 this, &SyncInternal::HandleAuthWatcherEvent)); 1369 this, &SyncInternal::HandleAuthWatcherEvent));
1370 1370
1371 // Build a SyncSessionContext and store the worker in it. 1371 // Build a SyncSessionContext and store the worker in it.
1372 SyncSessionContext* context = new SyncSessionContext( 1372 SyncSessionContext* context = new SyncSessionContext(
1373 connection_manager_.get(), auth_watcher(), 1373 connection_manager_.get(), auth_watcher(),
1374 dir_manager(), model_safe_worker_registrar); 1374 dir_manager(), model_safe_worker_registrar);
1375 1375
1376 // The SyncerThread takes ownership of |context|. 1376 // The SyncerThread takes ownership of |context|.
1377 syncer_thread_ = new SyncerThread(context, &allstatus_); 1377 syncer_thread_ = new SyncerThread(context);
1378 allstatus_.WatchSyncerThread(syncer_thread()); 1378 allstatus_.WatchSyncerThread(syncer_thread());
1379 1379
1380 // Subscribe to the syncer thread's channel. 1380 // Subscribe to the syncer thread's channel.
1381 syncer_event_.reset(syncer_thread()->relay_channel()->AddObserver(this)); 1381 syncer_event_.reset(syncer_thread()->relay_channel()->AddObserver(this));
1382 1382
1383 bool attempting_auth = false; 1383 bool attempting_auth = false;
1384 std::string username, auth_token; 1384 std::string username, auth_token;
1385 if (attempt_last_user_authentication && 1385 if (attempt_last_user_authentication &&
1386 auth_watcher()->settings()->GetLastUserAndServiceToken( 1386 auth_watcher()->settings()->GetLastUserAndServiceToken(
1387 SYNC_SERVICE_NAME, &username, &auth_token)) { 1387 SYNC_SERVICE_NAME, &username, &auth_token)) {
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; 2157 DCHECK(data_->initialized()) << "GetUserShare requires initialization!";
2158 return data_->GetUserShare(); 2158 return data_->GetUserShare();
2159 } 2159 }
2160 2160
2161 bool SyncManager::HasUnsyncedItems() const { 2161 bool SyncManager::HasUnsyncedItems() const {
2162 sync_api::ReadTransaction trans(GetUserShare()); 2162 sync_api::ReadTransaction trans(GetUserShare());
2163 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); 2163 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0);
2164 } 2164 }
2165 2165
2166 } // namespace sync_api 2166 } // namespace sync_api
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/auth_watcher_unittest.cc ('k') | chrome/browser/sync/engine/syncer_end_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698