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

Side by Side Diff: sync/internal_api/public/base_node.h

Issue 11571092: sync: Move unique_client_tag hashing code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // Transfers ownership of the DictionaryValue to the caller. 193 // Transfers ownership of the DictionaryValue to the caller.
194 base::DictionaryValue* GetSummaryAsValue() const; 194 base::DictionaryValue* GetSummaryAsValue() const;
195 195
196 // Dumps all node details into a DictionaryValue and returns it. 196 // Dumps all node details into a DictionaryValue and returns it.
197 // Transfers ownership of the DictionaryValue to the caller. 197 // Transfers ownership of the DictionaryValue to the caller.
198 base::DictionaryValue* GetDetailsAsValue() const; 198 base::DictionaryValue* GetDetailsAsValue() const;
199 199
200 protected: 200 protected:
201 BaseNode(); 201 BaseNode();
202 virtual ~BaseNode(); 202 virtual ~BaseNode();
203 // The server has a size limit on client tags, so we generate a fixed length
204 // hash locally. This also ensures that ModelTypes have unique namespaces.
205 static std::string GenerateSyncableHash(
206 ModelType model_type,
207 const std::string& client_tag);
208 203
209 // Determines whether part of the entry is encrypted, and if so attempts to 204 // Determines whether part of the entry is encrypted, and if so attempts to
210 // decrypt it. Unless decryption is necessary and fails, this will always 205 // decrypt it. Unless decryption is necessary and fails, this will always
211 // return |true|. If the contents are encrypted, the decrypted data will be 206 // return |true|. If the contents are encrypted, the decrypted data will be
212 // stored in |unencrypted_data_|. 207 // stored in |unencrypted_data_|.
213 // This method is invoked once when the BaseNode is initialized. 208 // This method is invoked once when the BaseNode is initialized.
214 bool DecryptIfNecessary(); 209 bool DecryptIfNecessary();
215 210
216 // Returns the unencrypted specifics associated with |entry|. If |entry| was 211 // Returns the unencrypted specifics associated with |entry|. If |entry| was
217 // not encrypted, it directly returns |entry|'s EntitySpecifics. Otherwise, 212 // not encrypted, it directly returns |entry|'s EntitySpecifics. Otherwise,
(...skipping 29 matching lines...) Expand all
247 242
248 // Same as |unencrypted_data_|, but for legacy password encryption. 243 // Same as |unencrypted_data_|, but for legacy password encryption.
249 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; 244 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_;
250 245
251 DISALLOW_COPY_AND_ASSIGN(BaseNode); 246 DISALLOW_COPY_AND_ASSIGN(BaseNode);
252 }; 247 };
253 248
254 } // namespace syncer 249 } // namespace syncer
255 250
256 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ 251 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698