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

Side by Side Diff: components/sync/base/unique_position.h

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: Fix presumit; fix Windows; git cl format Created 4 years, 1 month 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
« no previous file with comments | « components/sync/base/proto_value_ptr.h ('k') | components/sync/base/unique_position.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 COMPONENTS_SYNC_BASE_UNIQUE_POSITION_H_ 5 #ifndef COMPONENTS_SYNC_BASE_UNIQUE_POSITION_H_
6 #define COMPONENTS_SYNC_BASE_UNIQUE_POSITION_H_ 6 #define COMPONENTS_SYNC_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 std::string GetSuffixForTest() const; 94 std::string GetSuffixForTest() const;
95 95
96 // Performs a lossy conversion to an int64_t position. Positions converted to 96 // Performs a lossy conversion to an int64_t position. Positions converted to
97 // and from int64_ts using this and the FromInt64 function should maintain 97 // and from int64_ts using this and the FromInt64 function should maintain
98 // their 98 // their
99 // relative orderings unless the int64_t values conflict. 99 // relative orderings unless the int64_t values conflict.
100 int64_t ToInt64() const; 100 int64_t ToInt64() const;
101 101
102 bool IsValid() const; 102 bool IsValid() const;
103 103
104 // Returns memory usage estimate.
105 size_t EstimateMemoryUsage() const;
106
104 private: 107 private:
105 friend class UniquePositionTest; 108 friend class UniquePositionTest;
106 109
107 // Returns a string X such that (X ++ |suffix|) < |str|. 110 // Returns a string X such that (X ++ |suffix|) < |str|.
108 // |str| must be a trailing substring of a valid ordinal. 111 // |str| must be a trailing substring of a valid ordinal.
109 // |suffix| must be a valid unique suffix. 112 // |suffix| must be a valid unique suffix.
110 static std::string FindSmallerWithSuffix(const std::string& str, 113 static std::string FindSmallerWithSuffix(const std::string& str,
111 const std::string& suffix); 114 const std::string& suffix);
112 // Returns a string X such that (X ++ |suffix|) > |str|. 115 // Returns a string X such that (X ++ |suffix|) > |str|.
113 // |str| must be a trailing substring of a valid ordinal. 116 // |str| must be a trailing substring of a valid ordinal.
(...skipping 22 matching lines...) Expand all
136 139
137 // The position value after it has been run through the custom compression 140 // The position value after it has been run through the custom compression
138 // algorithm. See Compress() and Uncompress() functions above. 141 // algorithm. See Compress() and Uncompress() functions above.
139 std::string compressed_; 142 std::string compressed_;
140 bool is_valid_; 143 bool is_valid_;
141 }; 144 };
142 145
143 } // namespace syncer 146 } // namespace syncer
144 147
145 #endif // COMPONENTS_SYNC_BASE_UNIQUE_POSITION_H_ 148 #endif // COMPONENTS_SYNC_BASE_UNIQUE_POSITION_H_
OLDNEW
« no previous file with comments | « components/sync/base/proto_value_ptr.h ('k') | components/sync/base/unique_position.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698