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

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

Issue 8895008: [Sync] Relax EnumSet semantics for some functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | chrome/browser/sync/engine/nigori_util.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/get_commit_ids_command.h" 5 #include "chrome/browser/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
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. 90 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed.
91 DVLOG(1) << "Excluding entry from commit due to version mismatch " 91 DVLOG(1) << "Excluding entry from commit due to version mismatch "
92 << entry; 92 << entry;
93 return false; 93 return false;
94 } 94 }
95 95
96 const syncable::ModelType type = entry.GetModelType(); 96 const syncable::ModelType type = entry.GetModelType();
97 // We special case the nigori node because even though it is considered an 97 // We special case the nigori node because even though it is considered an
98 // "encrypted type", not all nigori node changes require valid encryption 98 // "encrypted type", not all nigori node changes require valid encryption
99 // (ex: sync_tabs). 99 // (ex: sync_tabs).
100 if (syncable::IsRealDataType(type) && 100 if ((type != syncable::NIGORI) &&
101 (type != syncable::NIGORI) &&
102 encrypted_types.Has(type) && 101 encrypted_types.Has(type) &&
103 (passphrase_missing || 102 (passphrase_missing ||
104 syncable::EntryNeedsEncryption(encrypted_types, entry))) { 103 syncable::EntryNeedsEncryption(encrypted_types, entry))) {
105 // This entry requires encryption but is not properly encrypted (possibly 104 // This entry requires encryption but is not properly encrypted (possibly
106 // due to the cryptographer not being initialized or the user hasn't 105 // due to the cryptographer not being initialized or the user hasn't
107 // provided the most recent passphrase). 106 // provided the most recent passphrase).
108 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. 107 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed.
109 DVLOG(1) << "Excluding entry from commit due to lack of encryption " 108 DVLOG(1) << "Excluding entry from commit due to lack of encryption "
110 << entry; 109 << entry;
111 return false; 110 return false;
112 } 111 }
113 112
114 // Look at the throttled types. 113 // Look at the throttled types.
115 if (syncable::IsRealDataType(type) && throttled_types.Has(type)) 114 if (throttled_types.Has(type))
116 return false; 115 return false;
117 116
118 return true; 117 return true;
119 } 118 }
120 119
121 } // namespace 120 } // namespace
122 121
123 void GetCommitIdsCommand::FilterUnreadyEntries( 122 void GetCommitIdsCommand::FilterUnreadyEntries(
124 syncable::BaseTransaction* trans, 123 syncable::BaseTransaction* trans,
125 syncable::ModelEnumSet throttled_types, 124 syncable::ModelEnumSet throttled_types,
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 354
356 // Add moves and creates, and prepend their uncommitted parents. 355 // Add moves and creates, and prepend their uncommitted parents.
357 AddCreatesAndMoves(unsynced_handles, write_transaction, routes, 356 AddCreatesAndMoves(unsynced_handles, write_transaction, routes,
358 throttled_types); 357 throttled_types);
359 358
360 // Add all deletes. 359 // Add all deletes.
361 AddDeletes(unsynced_handles, write_transaction); 360 AddDeletes(unsynced_handles, write_transaction);
362 } 361 }
363 362
364 } // namespace browser_sync 363 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/nigori_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698