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

Side by Side Diff: chrome/browser/sync/glue/session_model_associator.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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) 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/glue/session_model_associator.h" 5 #include "chrome/browser/sync/glue/session_model_associator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)), 95 ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)),
96 profile_(sync_service->profile()), 96 profile_(sync_service->profile()),
97 pref_service_(profile_->GetPrefs()), 97 pref_service_(profile_->GetPrefs()),
98 error_handler_(error_handler) { 98 error_handler_(error_handler) {
99 DCHECK(CalledOnValidThread()); 99 DCHECK(CalledOnValidThread());
100 DCHECK(sync_service_); 100 DCHECK(sync_service_);
101 DCHECK(profile_); 101 DCHECK(profile_);
102 if (pref_service_->FindPreference(kSyncSessionsGUID) == NULL) { 102 if (pref_service_->FindPreference(kSyncSessionsGUID) == NULL) {
103 pref_service_->RegisterStringPref(kSyncSessionsGUID, 103 pref_service_->RegisterStringPref(kSyncSessionsGUID,
104 std::string(), 104 std::string(),
105 PrefService::UNSYNCABLE_PREF); 105 PrefServiceSyncable::UNSYNCABLE_PREF);
106 } 106 }
107 } 107 }
108 108
109 SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service, 109 SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service,
110 bool setup_for_test) 110 bool setup_for_test)
111 : tab_pool_(sync_service), 111 : tab_pool_(sync_service),
112 local_session_syncid_(syncer::kInvalidId), 112 local_session_syncid_(syncer::kInvalidId),
113 sync_service_(sync_service), 113 sync_service_(sync_service),
114 stale_session_threshold_days_(kDefaultStaleSessionThresholdDays), 114 stale_session_threshold_days_(kDefaultStaleSessionThresholdDays),
115 setup_for_test_(setup_for_test), 115 setup_for_test_(setup_for_test),
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1298
1299 bool SessionModelAssociator::CryptoReadyIfNecessary() { 1299 bool SessionModelAssociator::CryptoReadyIfNecessary() {
1300 // We only access the cryptographer while holding a transaction. 1300 // We only access the cryptographer while holding a transaction.
1301 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); 1301 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
1302 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); 1302 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes();
1303 return !encrypted_types.Has(SESSIONS) || 1303 return !encrypted_types.Has(SESSIONS) ||
1304 sync_service_->IsCryptographerReady(&trans); 1304 sync_service_->IsCryptographerReady(&trans);
1305 } 1305 }
1306 1306
1307 } // namespace browser_sync 1307 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698