| OLD | NEW |
| 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_READ_NODE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // of Init to populate the ReadNode with a database entry. | 22 // of Init to populate the ReadNode with a database entry. |
| 23 explicit ReadNode(const BaseTransaction* transaction); | 23 explicit ReadNode(const BaseTransaction* transaction); |
| 24 virtual ~ReadNode(); | 24 virtual ~ReadNode(); |
| 25 | 25 |
| 26 // A client must use one (and only one) of the following Init variants to | 26 // A client must use one (and only one) of the following Init variants to |
| 27 // populate the node. | 27 // populate the node. |
| 28 | 28 |
| 29 // BaseNode implementation. | 29 // BaseNode implementation. |
| 30 virtual InitByLookupResult InitByIdLookup(int64 id) OVERRIDE; | 30 virtual InitByLookupResult InitByIdLookup(int64 id) OVERRIDE; |
| 31 virtual InitByLookupResult InitByClientTagLookup( | 31 virtual InitByLookupResult InitByClientTagLookup( |
| 32 syncer::ModelType model_type, | 32 ModelType model_type, |
| 33 const std::string& tag) OVERRIDE; | 33 const std::string& tag) OVERRIDE; |
| 34 | 34 |
| 35 // There is always a root node, so this can't fail. The root node is | 35 // There is always a root node, so this can't fail. The root node is |
| 36 // never mutable, so root lookup is only possible on a ReadNode. | 36 // never mutable, so root lookup is only possible on a ReadNode. |
| 37 void InitByRootLookup(); | 37 void InitByRootLookup(); |
| 38 | 38 |
| 39 // Each server-created permanent node is tagged with a unique string. | 39 // Each server-created permanent node is tagged with a unique string. |
| 40 // Look up the node with the particular tag. If it does not exist, | 40 // Look up the node with the particular tag. If it does not exist, |
| 41 // return false. | 41 // return false. |
| 42 InitByLookupResult InitByTagLookup(const std::string& tag); | 42 InitByLookupResult InitByTagLookup(const std::string& tag); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 | 56 |
| 57 // The sync API transaction that is the parent of this node. | 57 // The sync API transaction that is the parent of this node. |
| 58 const BaseTransaction* transaction_; | 58 const BaseTransaction* transaction_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(ReadNode); | 60 DISALLOW_COPY_AND_ASSIGN(ReadNode); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace syncer | 63 } // namespace syncer |
| 64 | 64 |
| 65 #endif // SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ | 65 #endif // SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ |
| OLD | NEW |