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

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

Issue 14117004: [Sync] Add support for server-controlled favicon sync limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add proto conversions Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/glue/favicon_cache.cc ('k') | sync/internal_api/public/util/experiments.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 DataTypeErrorHandler* error_handler) 96 DataTypeErrorHandler* error_handler)
97 : tab_pool_(sync_service), 97 : tab_pool_(sync_service),
98 local_session_syncid_(syncer::kInvalidId), 98 local_session_syncid_(syncer::kInvalidId),
99 sync_service_(sync_service), 99 sync_service_(sync_service),
100 stale_session_threshold_days_(kDefaultStaleSessionThresholdDays), 100 stale_session_threshold_days_(kDefaultStaleSessionThresholdDays),
101 setup_for_test_(false), 101 setup_for_test_(false),
102 waiting_for_change_(false), 102 waiting_for_change_(false),
103 ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)), 103 ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)),
104 profile_(sync_service->profile()), 104 profile_(sync_service->profile()),
105 error_handler_(error_handler), 105 error_handler_(error_handler),
106 favicon_cache_(profile_, kMaxSyncFavicons) { 106 favicon_cache_(profile_,
107 sync_service->current_experiments().favicon_sync_limit) {
107 DCHECK(CalledOnValidThread()); 108 DCHECK(CalledOnValidThread());
108 DCHECK(sync_service_); 109 DCHECK(sync_service_);
109 DCHECK(profile_); 110 DCHECK(profile_);
110 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 111 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
111 if (command_line.HasSwitch(switches::kSyncTabFavicons)) 112 if (command_line.HasSwitch(switches::kSyncTabFavicons))
112 favicon_cache_.SetLegacyDelegate(this); 113 favicon_cache_.SetLegacyDelegate(this);
113 } 114 }
114 115
115 SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service, 116 SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service,
116 bool setup_for_test) 117 bool setup_for_test)
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 1159
1159 bool SessionModelAssociator::CryptoReadyIfNecessary() { 1160 bool SessionModelAssociator::CryptoReadyIfNecessary() {
1160 // We only access the cryptographer while holding a transaction. 1161 // We only access the cryptographer while holding a transaction.
1161 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); 1162 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
1162 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); 1163 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes();
1163 return !encrypted_types.Has(SESSIONS) || 1164 return !encrypted_types.Has(SESSIONS) ||
1164 sync_service_->IsCryptographerReady(&trans); 1165 sync_service_->IsCryptographerReady(&trans);
1165 } 1166 }
1166 1167
1167 } // namespace browser_sync 1168 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/favicon_cache.cc ('k') | sync/internal_api/public/util/experiments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698