Chromium Code Reviews| 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_SYNCABLE_ENTRY_H_ | 5 #ifndef SYNC_SYNCABLE_ENTRY_H_ |
| 6 #define SYNC_SYNCABLE_ENTRY_H_ | 6 #define SYNC_SYNCABLE_ENTRY_H_ |
| 7 | 7 |
| 8 #include "sync/base/sync_export.h" | 8 #include "sync/base/sync_export.h" |
| 9 #include "sync/syncable/entry_kernel.h" | 9 #include "sync/syncable/entry_kernel.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 // constructor. | 28 // constructor. |
| 29 enum GetById { | 29 enum GetById { |
| 30 GET_BY_ID | 30 GET_BY_ID |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 enum GetByClientTag { | 33 enum GetByClientTag { |
| 34 GET_BY_CLIENT_TAG | 34 GET_BY_CLIENT_TAG |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 enum GetByServerTag { | 37 enum GetByServerTag { |
| 38 GET_BY_SERVER_TAG | 38 // Server tagged items are deprecated for all types but bookmarks. |
| 39 GET_BY_SERVER_TAG_DEPRECATED | |
|
tim (not reviewing)
2014/06/03 15:21:22
The decision to deprecate this seems separate from
rlarocque
2014/06/03 17:29:40
I added a suffix because I wanted the compiler to
| |
| 40 }; | |
| 41 | |
| 42 enum GetTypeRoot { | |
| 43 GET_TYPE_ROOT | |
| 39 }; | 44 }; |
| 40 | 45 |
| 41 enum GetByHandle { | 46 enum GetByHandle { |
| 42 GET_BY_HANDLE | 47 GET_BY_HANDLE |
| 43 }; | 48 }; |
| 44 | 49 |
| 45 class SYNC_EXPORT Entry { | 50 class SYNC_EXPORT Entry { |
| 46 public: | 51 public: |
| 47 // After constructing, you must check good() to test whether the Get | 52 // After constructing, you must check good() to test whether the Get |
| 48 // succeeded. | 53 // succeeded. |
| 49 Entry(BaseTransaction* trans, GetByHandle, int64 handle); | 54 Entry(BaseTransaction* trans, GetByHandle, int64 handle); |
| 50 Entry(BaseTransaction* trans, GetById, const Id& id); | 55 Entry(BaseTransaction* trans, GetById, const Id& id); |
| 56 Entry(BaseTransaction* trans, GetTypeRoot, ModelType type); | |
| 57 Entry(BaseTransaction* trans, GetByClientTag, const std::string& tag); | |
| 58 | |
| 59 // This lookup function is deprecated. All types except bookmarks can use | |
| 60 // the GetTypeRoot variant instead. | |
| 51 Entry(BaseTransaction* trans, GetByServerTag, const std::string& tag); | 61 Entry(BaseTransaction* trans, GetByServerTag, const std::string& tag); |
| 52 Entry(BaseTransaction* trans, GetByClientTag, const std::string& tag); | |
| 53 | 62 |
| 54 bool good() const { return 0 != kernel_; } | 63 bool good() const { return 0 != kernel_; } |
| 55 | 64 |
| 56 BaseTransaction* trans() const { return basetrans_; } | 65 BaseTransaction* trans() const { return basetrans_; } |
| 57 | 66 |
| 58 // Field accessors. | 67 // Field accessors. |
| 59 int64 GetMetahandle() const { | 68 int64 GetMetahandle() const { |
| 60 DCHECK(kernel_); | 69 DCHECK(kernel_); |
| 61 return kernel_->ref(META_HANDLE); | 70 return kernel_->ref(META_HANDLE); |
| 62 } | 71 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 | 274 |
| 266 DISALLOW_COPY_AND_ASSIGN(Entry); | 275 DISALLOW_COPY_AND_ASSIGN(Entry); |
| 267 }; | 276 }; |
| 268 | 277 |
| 269 std::ostream& operator<<(std::ostream& os, const Entry& entry); | 278 std::ostream& operator<<(std::ostream& os, const Entry& entry); |
| 270 | 279 |
| 271 } // namespace syncable | 280 } // namespace syncable |
| 272 } // namespace syncer | 281 } // namespace syncer |
| 273 | 282 |
| 274 #endif // SYNC_SYNCABLE_ENTRY_H_ | 283 #endif // SYNC_SYNCABLE_ENTRY_H_ |
| OLD | NEW |