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_WRITE_NODE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // you want to fetch using client_tag. Note that the behavior of these | 78 // you want to fetch using client_tag. Note that the behavior of these |
79 // items is slightly different than that of normal items. | 79 // items is slightly different than that of normal items. |
80 // Most importantly, if it exists locally, this function will | 80 // Most importantly, if it exists locally, this function will |
81 // actually undelete it | 81 // actually undelete it |
82 // Client unique tagged nodes must NOT be folders. | 82 // Client unique tagged nodes must NOT be folders. |
83 InitUniqueByCreationResult InitUniqueByCreation( | 83 InitUniqueByCreationResult InitUniqueByCreation( |
84 ModelType model_type, | 84 ModelType model_type, |
85 const BaseNode& parent, | 85 const BaseNode& parent, |
86 const std::string& client_tag); | 86 const std::string& client_tag); |
87 | 87 |
88 // Each server-created permanent node is tagged with a unique string. | 88 // Looks up the type's root folder. This is usually created by the sync |
89 // Look up the node with the particular tag. If it does not exist, | 89 // server during initial sync, though we do eventually wish to remove it from |
90 // return false. | 90 // the protocol and have the client "fake it" instead. |
91 InitByLookupResult InitByTagLookup(const std::string& tag); | 91 InitByLookupResult InitTypeRoot(ModelType type); |
92 | 92 |
93 // These Set() functions correspond to the Get() functions of BaseNode. | 93 // These Set() functions correspond to the Get() functions of BaseNode. |
94 void SetIsFolder(bool folder); | 94 void SetIsFolder(bool folder); |
95 void SetTitle(const std::string& title); | 95 void SetTitle(const std::string& title); |
96 | 96 |
97 // External ID is a client-only field, so setting it doesn't cause the item to | 97 // External ID is a client-only field, so setting it doesn't cause the item to |
98 // be synced again. | 98 // be synced again. |
99 void SetExternalId(int64 external_id); | 99 void SetExternalId(int64 external_id); |
100 | 100 |
101 // Remove this node and its children and sync deletion to server. | 101 // Remove this node and its children and sync deletion to server. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 // The sync API transaction that is the parent of this node. | 202 // The sync API transaction that is the parent of this node. |
203 WriteTransaction* transaction_; | 203 WriteTransaction* transaction_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(WriteNode); | 205 DISALLOW_COPY_AND_ASSIGN(WriteNode); |
206 }; | 206 }; |
207 | 207 |
208 } // namespace syncer | 208 } // namespace syncer |
209 | 209 |
210 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ | 210 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ |
OLD | NEW |