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

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

Issue 10795018: [Sync] Remove unneeded 'using syncer::' lines and 'syncer::' scopings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fiix indent Created 8 years, 5 months 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
« no previous file with comments | « sync/internal_api/public/util/weak_handle.h ('k') | sync/internal_api/read_node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Create a WriteNode using the given transaction. 57 // Create a WriteNode using the given transaction.
58 explicit WriteNode(WriteTransaction* transaction); 58 explicit WriteNode(WriteTransaction* transaction);
59 virtual ~WriteNode(); 59 virtual ~WriteNode();
60 60
61 // A client must use one (and only one) of the following Init variants to 61 // A client must use one (and only one) of the following Init variants to
62 // populate the node. 62 // populate the node.
63 63
64 // BaseNode implementation. 64 // BaseNode implementation.
65 virtual InitByLookupResult InitByIdLookup(int64 id) OVERRIDE; 65 virtual InitByLookupResult InitByIdLookup(int64 id) OVERRIDE;
66 virtual InitByLookupResult InitByClientTagLookup( 66 virtual InitByLookupResult InitByClientTagLookup(
67 syncer::ModelType model_type, 67 ModelType model_type,
68 const std::string& tag) OVERRIDE; 68 const std::string& tag) OVERRIDE;
69 69
70 // Create a new node with the specified parent and predecessor. |model_type| 70 // Create a new node with the specified parent and predecessor. |model_type|
71 // dictates the type of the item, and controls which EntitySpecifics proto 71 // dictates the type of the item, and controls which EntitySpecifics proto
72 // extension can be used with this item. Use a NULL |predecessor| 72 // extension can be used with this item. Use a NULL |predecessor|
73 // to indicate that this is to be the first child. 73 // to indicate that this is to be the first child.
74 // |predecessor| must be a child of |new_parent| or NULL. Returns false on 74 // |predecessor| must be a child of |new_parent| or NULL. Returns false on
75 // failure. 75 // failure.
76 bool InitByCreation(syncer::ModelType model_type, 76 bool InitByCreation(ModelType model_type,
77 const BaseNode& parent, 77 const BaseNode& parent,
78 const BaseNode* predecessor); 78 const BaseNode* predecessor);
79 79
80 // Create nodes using this function if they're unique items that 80 // Create nodes using this function if they're unique items that
81 // you want to fetch using client_tag. Note that the behavior of these 81 // you want to fetch using client_tag. Note that the behavior of these
82 // items is slightly different than that of normal items. 82 // items is slightly different than that of normal items.
83 // Most importantly, if it exists locally, this function will 83 // Most importantly, if it exists locally, this function will
84 // actually undelete it 84 // actually undelete it
85 // Client unique tagged nodes must NOT be folders. 85 // Client unique tagged nodes must NOT be folders.
86 InitUniqueByCreationResult InitUniqueByCreation( 86 InitUniqueByCreationResult InitUniqueByCreation(
87 syncer::ModelType model_type, 87 ModelType model_type,
88 const BaseNode& parent, 88 const BaseNode& parent,
89 const std::string& client_tag); 89 const std::string& client_tag);
90 90
91 // Each server-created permanent node is tagged with a unique string. 91 // Each server-created permanent node is tagged with a unique string.
92 // Look up the node with the particular tag. If it does not exist, 92 // Look up the node with the particular tag. If it does not exist,
93 // return false. 93 // return false.
94 InitByLookupResult InitByTagLookup(const std::string& tag); 94 InitByLookupResult InitByTagLookup(const std::string& tag);
95 95
96 // These Set() functions correspond to the Get() functions of BaseNode. 96 // These Set() functions correspond to the Get() functions of BaseNode.
97 void SetIsFolder(bool folder); 97 void SetIsFolder(bool folder);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 virtual const BaseTransaction* GetTransaction() const OVERRIDE; 170 virtual const BaseTransaction* GetTransaction() const OVERRIDE;
171 171
172 syncable::MutableEntry* GetMutableEntryForTest(); 172 syncable::MutableEntry* GetMutableEntryForTest();
173 173
174 private: 174 private:
175 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, EncryptBookmarksWithLegacyData); 175 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, EncryptBookmarksWithLegacyData);
176 176
177 void* operator new(size_t size); // Node is meant for stack use only. 177 void* operator new(size_t size); // Node is meant for stack use only.
178 178
179 // Helper to set model type. This will clear any specifics data. 179 // Helper to set model type. This will clear any specifics data.
180 void PutModelType(syncer::ModelType model_type); 180 void PutModelType(ModelType model_type);
181 181
182 // Helper to set the previous node. 182 // Helper to set the previous node.
183 bool PutPredecessor(const BaseNode* predecessor) WARN_UNUSED_RESULT; 183 bool PutPredecessor(const BaseNode* predecessor) WARN_UNUSED_RESULT;
184 184
185 // Sets IS_UNSYNCED and SYNCING to ensure this entry is considered in an 185 // Sets IS_UNSYNCED and SYNCING to ensure this entry is considered in an
186 // upcoming commit pass. 186 // upcoming commit pass.
187 void MarkForSyncing(); 187 void MarkForSyncing();
188 188
189 // The underlying syncable object which this class wraps. 189 // The underlying syncable object which this class wraps.
190 syncable::MutableEntry* entry_; 190 syncable::MutableEntry* entry_;
191 191
192 // The sync API transaction that is the parent of this node. 192 // The sync API transaction that is the parent of this node.
193 WriteTransaction* transaction_; 193 WriteTransaction* transaction_;
194 194
195 DISALLOW_COPY_AND_ASSIGN(WriteNode); 195 DISALLOW_COPY_AND_ASSIGN(WriteNode);
196 }; 196 };
197 197
198 } // namespace syncer 198 } // namespace syncer
199 199
200 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ 200 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_
OLDNEW
« no previous file with comments | « sync/internal_api/public/util/weak_handle.h ('k') | sync/internal_api/read_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698