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

Side by Side Diff: sync/internal_api/sync_manager_impl.cc

Issue 19309002: sync: Add pre-commit update avoidance mode + flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years, 5 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
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 "sync/internal_api/sync_manager_impl.h" 5 #include "sync/internal_api/sync_manager_impl.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 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 ReadNode favicon_sync_node(&trans); 1288 ReadNode favicon_sync_node(&trans);
1289 if (favicon_sync_node.InitByClientTagLookup( 1289 if (favicon_sync_node.InitByClientTagLookup(
1290 syncer::EXPERIMENTS, 1290 syncer::EXPERIMENTS,
1291 syncer::kFaviconSyncTag) == BaseNode::INIT_OK) { 1291 syncer::kFaviconSyncTag) == BaseNode::INIT_OK) {
1292 experiments->favicon_sync_limit = 1292 experiments->favicon_sync_limit =
1293 favicon_sync_node.GetExperimentsSpecifics().favicon_sync(). 1293 favicon_sync_node.GetExperimentsSpecifics().favicon_sync().
1294 favicon_sync_limit(); 1294 favicon_sync_limit();
1295 found_experiment = true; 1295 found_experiment = true;
1296 } 1296 }
1297 1297
1298 ReadNode pre_commit_update_avoidance_node(&trans);
1299 if (pre_commit_update_avoidance_node.InitByClientTagLookup(
1300 syncer::EXPERIMENTS,
1301 syncer::kPreCommitUpdateAvoidanceTag) == BaseNode::INIT_OK) {
1302 session_context_->set_server_enabled_pre_commit_update_avoidance(
1303 pre_commit_update_avoidance_node.GetExperimentsSpecifics().
1304 pre_commit_update_avoidance().enabled());
1305 // We don't bother setting found_experiment. The frontend doesn't need to
1306 // know about this.
1307 }
1308
1298 return found_experiment; 1309 return found_experiment;
1299 } 1310 }
1300 1311
1301 bool SyncManagerImpl::HasUnsyncedItems() { 1312 bool SyncManagerImpl::HasUnsyncedItems() {
1302 ReadTransaction trans(FROM_HERE, GetUserShare()); 1313 ReadTransaction trans(FROM_HERE, GetUserShare());
1303 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); 1314 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0);
1304 } 1315 }
1305 1316
1306 SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() { 1317 SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() {
1307 return sync_encryption_handler_.get(); 1318 return sync_encryption_handler_.get();
1308 } 1319 }
1309 1320
1310 // static. 1321 // static.
1311 int SyncManagerImpl::GetDefaultNudgeDelay() { 1322 int SyncManagerImpl::GetDefaultNudgeDelay() {
1312 return kDefaultNudgeDelayMilliseconds; 1323 return kDefaultNudgeDelayMilliseconds;
1313 } 1324 }
1314 1325
1315 // static. 1326 // static.
1316 int SyncManagerImpl::GetPreferencesNudgeDelay() { 1327 int SyncManagerImpl::GetPreferencesNudgeDelay() {
1317 return kPreferencesNudgeDelayMilliseconds; 1328 return kPreferencesNudgeDelayMilliseconds;
1318 } 1329 }
1319 1330
1320 } // namespace syncer 1331 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/util/experiments.h ('k') | sync/internal_api/test/test_internal_components_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698