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

Side by Side Diff: sync/engine/get_commit_ids_command.cc

Issue 10454105: sync: Refactor per-datatype throttling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 6 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 | « sync/engine/all_status.cc ('k') | sync/engine/sync_scheduler.cc » ('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 (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/engine/get_commit_ids_command.h" 5 #include "sync/engine/get_commit_ids_command.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "sync/engine/nigori_util.h" 11 #include "sync/engine/nigori_util.h"
12 #include "sync/engine/syncer_util.h" 12 #include "sync/engine/syncer_util.h"
13 #include "sync/engine/throttled_data_type_tracker.h"
13 #include "sync/syncable/syncable.h" 14 #include "sync/syncable/syncable.h"
14 #include "sync/util/cryptographer.h" 15 #include "sync/util/cryptographer.h"
15 16
16 using std::set; 17 using std::set;
17 using std::vector; 18 using std::vector;
18 19
19 namespace browser_sync { 20 namespace browser_sync {
20 21
21 using sessions::OrderedCommitSet; 22 using sessions::OrderedCommitSet;
22 using sessions::SyncSession; 23 using sessions::SyncSession;
(...skipping 20 matching lines...) Expand all
43 bool passphrase_missing = false; 44 bool passphrase_missing = false;
44 Cryptographer* cryptographer = 45 Cryptographer* cryptographer =
45 session->context()-> 46 session->context()->
46 directory()->GetCryptographer(session->write_transaction()); 47 directory()->GetCryptographer(session->write_transaction());
47 if (cryptographer) { 48 if (cryptographer) {
48 encrypted_types = cryptographer->GetEncryptedTypes(); 49 encrypted_types = cryptographer->GetEncryptedTypes();
49 passphrase_missing = cryptographer->has_pending_keys(); 50 passphrase_missing = cryptographer->has_pending_keys();
50 }; 51 };
51 52
52 const syncable::ModelTypeSet throttled_types = 53 const syncable::ModelTypeSet throttled_types =
53 session->context()->GetThrottledTypes(); 54 session->context()->throttled_data_type_tracker()->GetThrottledTypes();
54 // We filter out all unready entries from the set of unsynced handles. This 55 // We filter out all unready entries from the set of unsynced handles. This
55 // new set of ready and unsynced items (which excludes throttled items as 56 // new set of ready and unsynced items (which excludes throttled items as
56 // well) is then what we use to determine what is a candidate for commit. 57 // well) is then what we use to determine what is a candidate for commit.
57 FilterUnreadyEntries(session->write_transaction(), 58 FilterUnreadyEntries(session->write_transaction(),
58 throttled_types, 59 throttled_types,
59 encrypted_types, 60 encrypted_types,
60 passphrase_missing, 61 passphrase_missing,
61 all_unsynced_handles, 62 all_unsynced_handles,
62 &ready_unsynced_set); 63 &ready_unsynced_set);
63 64
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // delete trees. 416 // delete trees.
416 417
417 // Add moves and creates, and prepend their uncommitted parents. 418 // Add moves and creates, and prepend their uncommitted parents.
418 AddCreatesAndMoves(write_transaction, routes, ready_unsynced_set); 419 AddCreatesAndMoves(write_transaction, routes, ready_unsynced_set);
419 420
420 // Add all deletes. 421 // Add all deletes.
421 AddDeletes(write_transaction, ready_unsynced_set); 422 AddDeletes(write_transaction, ready_unsynced_set);
422 } 423 }
423 424
424 } // namespace browser_sync 425 } // namespace browser_sync
OLDNEW
« no previous file with comments | « sync/engine/all_status.cc ('k') | sync/engine/sync_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698