OLD | NEW |
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 COMPONENTS_SYNC_CORE_BASE_NODE_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 6 #define COMPONENTS_SYNC_CORE_BASE_NODE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "sync/api/attachments/attachment.h" | 18 #include "components/sync/api/attachments/attachment.h" |
19 #include "sync/base/sync_export.h" | 19 #include "components/sync/base/model_type.h" |
20 #include "sync/internal_api/public/base/model_type.h" | 20 #include "components/sync/base/sync_export.h" |
21 #include "sync/protocol/sync.pb.h" | 21 #include "components/sync/protocol/sync.pb.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 // Forward declarations of internal class types so that sync API objects | 24 // Forward declarations of internal class types so that sync API objects |
25 // may have opaque pointers to these types. | 25 // may have opaque pointers to these types. |
26 namespace base { | 26 namespace base { |
27 class DictionaryValue; | 27 class DictionaryValue; |
28 } | 28 } |
29 | 29 |
30 namespace sync_pb { | 30 namespace sync_pb { |
31 class AppSpecifics; | 31 class AppSpecifics; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 }; | 77 }; |
78 | 78 |
79 // All subclasses of BaseNode must provide a way to initialize themselves by | 79 // All subclasses of BaseNode must provide a way to initialize themselves by |
80 // doing an ID lookup. Returns false on failure. An invalid or deleted | 80 // doing an ID lookup. Returns false on failure. An invalid or deleted |
81 // ID will result in failure. | 81 // ID will result in failure. |
82 virtual InitByLookupResult InitByIdLookup(int64_t id) = 0; | 82 virtual InitByLookupResult InitByIdLookup(int64_t id) = 0; |
83 | 83 |
84 // All subclasses of BaseNode must also provide a way to initialize themselves | 84 // All subclasses of BaseNode must also provide a way to initialize themselves |
85 // by doing a client tag lookup. Returns false on failure. A deleted node | 85 // by doing a client tag lookup. Returns false on failure. A deleted node |
86 // will return FALSE. | 86 // will return FALSE. |
87 virtual InitByLookupResult InitByClientTagLookup( | 87 virtual InitByLookupResult InitByClientTagLookup(ModelType model_type, |
88 ModelType model_type, | 88 const std::string& tag) = 0; |
89 const std::string& tag) = 0; | |
90 | 89 |
91 // Each object is identified by a 64-bit id (internally, the syncable | 90 // Each object is identified by a 64-bit id (internally, the syncable |
92 // metahandle). These ids are strictly local handles. They will persist | 91 // metahandle). These ids are strictly local handles. They will persist |
93 // on this client, but the same object on a different client may have a | 92 // on this client, but the same object on a different client may have a |
94 // different ID value. | 93 // different ID value. |
95 virtual int64_t GetId() const; | 94 virtual int64_t GetId() const; |
96 | 95 |
97 // Returns the modification time of the object. | 96 // Returns the modification time of the object. |
98 base::Time GetModificationTime() const; | 97 base::Time GetModificationTime() const; |
99 | 98 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 sync_pb::EntitySpecifics unencrypted_data_; | 234 sync_pb::EntitySpecifics unencrypted_data_; |
236 | 235 |
237 // Same as |unencrypted_data_|, but for legacy password encryption. | 236 // Same as |unencrypted_data_|, but for legacy password encryption. |
238 std::unique_ptr<sync_pb::PasswordSpecificsData> password_data_; | 237 std::unique_ptr<sync_pb::PasswordSpecificsData> password_data_; |
239 | 238 |
240 DISALLOW_COPY_AND_ASSIGN(BaseNode); | 239 DISALLOW_COPY_AND_ASSIGN(BaseNode); |
241 }; | 240 }; |
242 | 241 |
243 } // namespace syncer | 242 } // namespace syncer |
244 | 243 |
245 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 244 #endif // COMPONENTS_SYNC_CORE_BASE_NODE_H_ |
OLD | NEW |