| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ |
| 6 #define CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ | 6 #define CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // Returns the unencrypted specifics associated with |entry|. If |entry| was | 201 // Returns the unencrypted specifics associated with |entry|. If |entry| was |
| 202 // not encrypted, it directly returns |entry|'s EntitySpecifics. Otherwise, | 202 // not encrypted, it directly returns |entry|'s EntitySpecifics. Otherwise, |
| 203 // returns |unencrypted_data_|. | 203 // returns |unencrypted_data_|. |
| 204 const sync_pb::EntitySpecifics& GetUnencryptedSpecifics( | 204 const sync_pb::EntitySpecifics& GetUnencryptedSpecifics( |
| 205 const syncable::Entry* entry) const; | 205 const syncable::Entry* entry) const; |
| 206 | 206 |
| 207 // Copy |specifics| into |unencrypted_data_|. | 207 // Copy |specifics| into |unencrypted_data_|. |
| 208 void SetUnencryptedSpecifics(const sync_pb::EntitySpecifics& specifics); | 208 void SetUnencryptedSpecifics(const sync_pb::EntitySpecifics& specifics); |
| 209 | 209 |
| 210 private: | 210 private: |
| 211 // Have to friend the test class as well to allow member functions to access |
| 212 // protected/private BaseNode methods. |
| 213 friend class SyncManagerTest; |
| 214 FRIEND_TEST_ALL_PREFIXES(SyncApiTest, GenerateSyncableHash); |
| 215 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, UpdateEntryWithEncryption); |
| 216 |
| 211 void* operator new(size_t size); // Node is meant for stack use only. | 217 void* operator new(size_t size); // Node is meant for stack use only. |
| 212 | 218 |
| 213 // A holder for the unencrypted data stored in an encrypted node. | 219 // A holder for the unencrypted data stored in an encrypted node. |
| 214 sync_pb::EntitySpecifics unencrypted_data_; | 220 sync_pb::EntitySpecifics unencrypted_data_; |
| 215 | 221 |
| 216 // Same as |unencrypted_data_|, but for legacy password encryption. | 222 // Same as |unencrypted_data_|, but for legacy password encryption. |
| 217 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; | 223 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; |
| 218 | 224 |
| 219 friend class SyncApiTest; | |
| 220 FRIEND_TEST_ALL_PREFIXES(SyncApiTest, GenerateSyncableHash); | |
| 221 | |
| 222 DISALLOW_COPY_AND_ASSIGN(BaseNode); | 225 DISALLOW_COPY_AND_ASSIGN(BaseNode); |
| 223 }; | 226 }; |
| 224 | 227 |
| 225 } // namespace sync_api | 228 } // namespace sync_api |
| 226 | 229 |
| 227 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ | 230 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ |
| OLD | NEW |