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

Side by Side Diff: sync/internal_api/public/base/unique_position.h

Issue 2084243004: [WIP][tracing] Add memory dump provider for sync Directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add visitors for memory. Created 4 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
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_BASE_UNIQUE_POSITION_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 // Serializes the protobuf representation of this object as a string. 89 // Serializes the protobuf representation of this object as a string.
90 void SerializeToString(std::string* blob) const; 90 void SerializeToString(std::string* blob) const;
91 91
92 // Returns a human-readable representation of this item's internal state. 92 // Returns a human-readable representation of this item's internal state.
93 std::string ToDebugString() const; 93 std::string ToDebugString() const;
94 94
95 // Returns the suffix. 95 // Returns the suffix.
96 std::string GetSuffixForTest() const; 96 std::string GetSuffixForTest() const;
97 97
98 size_t compressed_size() const { return compressed_.capacity(); }
stanisc 2016/07/06 21:50:31 Perhaps the function name should be compressed_byt
ssid 2016/07/19 22:10:34 Done.
99
98 // Performs a lossy conversion to an int64_t position. Positions converted to 100 // Performs a lossy conversion to an int64_t position. Positions converted to
99 // and from int64_ts using this and the FromInt64 function should maintain 101 // and from int64_ts using this and the FromInt64 function should maintain
100 // their 102 // their
101 // relative orderings unless the int64_t values conflict. 103 // relative orderings unless the int64_t values conflict.
102 int64_t ToInt64() const; 104 int64_t ToInt64() const;
103 105
104 bool IsValid() const; 106 bool IsValid() const;
105 107
106 private: 108 private:
107 friend class UniquePositionTest; 109 friend class UniquePositionTest;
(...skipping 30 matching lines...) Expand all
138 140
139 // The position value after it has been run through the custom compression 141 // The position value after it has been run through the custom compression
140 // algorithm. See Compress() and Uncompress() functions above. 142 // algorithm. See Compress() and Uncompress() functions above.
141 std::string compressed_; 143 std::string compressed_;
142 bool is_valid_; 144 bool is_valid_;
143 }; 145 };
144 146
145 } // namespace syncer 147 } // namespace syncer
146 148
147 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_ 149 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698