OLD | NEW |
1 // Copyright (c) 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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "sync/base/sync_export.h" |
16 #include "sync/internal_api/public/base/model_type.h" | 17 #include "sync/internal_api/public/base/model_type.h" |
17 #include "sync/protocol/sync.pb.h" | 18 #include "sync/protocol/sync.pb.h" |
18 | 19 |
19 // Forward declarations of internal class types so that sync API objects | 20 // Forward declarations of internal class types so that sync API objects |
20 // may have opaque pointers to these types. | 21 // may have opaque pointers to these types. |
21 namespace base { | 22 namespace base { |
22 class DictionaryValue; | 23 class DictionaryValue; |
23 } | 24 } |
24 | 25 |
25 namespace sync_pb { | 26 namespace sync_pb { |
(...skipping 21 matching lines...) Expand all Loading... |
47 } | 48 } |
48 | 49 |
49 // A valid BaseNode will never have an ID of zero. | 50 // A valid BaseNode will never have an ID of zero. |
50 static const int64 kInvalidId = 0; | 51 static const int64 kInvalidId = 0; |
51 | 52 |
52 // BaseNode wraps syncable::Entry, and corresponds to a single object's state. | 53 // BaseNode wraps syncable::Entry, and corresponds to a single object's state. |
53 // This, like syncable::Entry, is intended for use on the stack. A valid | 54 // This, like syncable::Entry, is intended for use on the stack. A valid |
54 // transaction is necessary to create a BaseNode or any of its children. | 55 // transaction is necessary to create a BaseNode or any of its children. |
55 // Unlike syncable::Entry, a sync API BaseNode is identified primarily by its | 56 // Unlike syncable::Entry, a sync API BaseNode is identified primarily by its |
56 // int64 metahandle, which we call an ID here. | 57 // int64 metahandle, which we call an ID here. |
57 class BaseNode { | 58 class SYNC_EXPORT BaseNode { |
58 public: | 59 public: |
59 // Enumerates the possible outcomes of trying to initialize a sync node. | 60 // Enumerates the possible outcomes of trying to initialize a sync node. |
60 enum InitByLookupResult { | 61 enum InitByLookupResult { |
61 INIT_OK, | 62 INIT_OK, |
62 // Could not find an entry matching the lookup criteria. | 63 // Could not find an entry matching the lookup criteria. |
63 INIT_FAILED_ENTRY_NOT_GOOD, | 64 INIT_FAILED_ENTRY_NOT_GOOD, |
64 // Found an entry, but it is already deleted. | 65 // Found an entry, but it is already deleted. |
65 INIT_FAILED_ENTRY_IS_DEL, | 66 INIT_FAILED_ENTRY_IS_DEL, |
66 // Found an entry, but was unable to decrypt. | 67 // Found an entry, but was unable to decrypt. |
67 INIT_FAILED_DECRYPT_IF_NECESSARY, | 68 INIT_FAILED_DECRYPT_IF_NECESSARY, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 247 |
247 // Same as |unencrypted_data_|, but for legacy password encryption. | 248 // Same as |unencrypted_data_|, but for legacy password encryption. |
248 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; | 249 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; |
249 | 250 |
250 DISALLOW_COPY_AND_ASSIGN(BaseNode); | 251 DISALLOW_COPY_AND_ASSIGN(BaseNode); |
251 }; | 252 }; |
252 | 253 |
253 } // namespace syncer | 254 } // namespace syncer |
254 | 255 |
255 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 256 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
OLD | NEW |