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

Side by Side Diff: sync/syncable/nigori_util.cc

Issue 302173004: sync: Specialize functions that fetch type root (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/GET_BY_SERVER_TAG_DEPRECATED/GET_BY_SERVER_TAG/ Created 6 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/syncable/mutable_entry.cc ('k') | no next file » | 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 "sync/syncable/nigori_util.h" 5 #include "sync/syncable/nigori_util.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // Mainly for testing. 93 // Mainly for testing.
94 bool VerifyDataTypeEncryptionForTest( 94 bool VerifyDataTypeEncryptionForTest(
95 BaseTransaction* const trans, 95 BaseTransaction* const trans,
96 ModelType type, 96 ModelType type,
97 bool is_encrypted) { 97 bool is_encrypted) {
98 Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans); 98 Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans);
99 if (type == PASSWORDS || IsControlType(type)) { 99 if (type == PASSWORDS || IsControlType(type)) {
100 NOTREACHED(); 100 NOTREACHED();
101 return true; 101 return true;
102 } 102 }
103 std::string type_tag = ModelTypeToRootTag(type); 103 Entry type_root(trans, GET_TYPE_ROOT, type);
104 Entry type_root(trans, GET_BY_SERVER_TAG, type_tag);
105 if (!type_root.good()) { 104 if (!type_root.good()) {
106 NOTREACHED(); 105 NOTREACHED();
107 return false; 106 return false;
108 } 107 }
109 108
110 std::queue<Id> to_visit; 109 std::queue<Id> to_visit;
111 Id id_string = type_root.GetFirstChildId(); 110 Id id_string = type_root.GetFirstChildId();
112 to_visit.push(id_string); 111 to_visit.push(id_string);
113 while (!to_visit.empty()) { 112 while (!to_visit.empty()) {
114 id_string = to_visit.front(); 113 id_string = to_visit.front();
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 encrypted_types.Put(FAVICON_TRACKING); 314 encrypted_types.Put(FAVICON_TRACKING);
316 if (nigori.encrypt_articles()) 315 if (nigori.encrypt_articles())
317 encrypted_types.Put(ARTICLES); 316 encrypted_types.Put(ARTICLES);
318 if (nigori.encrypt_app_list()) 317 if (nigori.encrypt_app_list())
319 encrypted_types.Put(APP_LIST); 318 encrypted_types.Put(APP_LIST);
320 return encrypted_types; 319 return encrypted_types;
321 } 320 }
322 321
323 } // namespace syncable 322 } // namespace syncable
324 } // namespace syncer 323 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/mutable_entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698