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 #include "sync/internal_api/public/base/unique_position.h" | 5 #include "sync/internal_api/public/base/unique_position.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "sync/protocol/unique_position.pb.h" | 10 #include "sync/protocol/unique_position.pb.h" |
11 #include "third_party/zlib/zlib.h" | 11 #include "third_party/zlib/zlib.h" |
12 | 12 |
13 namespace syncer { | 13 namespace syncer { |
14 | 14 |
15 const size_t UniquePosition::kSuffixLength = 28; | 15 const size_t UniquePosition::kSuffixLength = 28; |
16 const size_t UniquePosition::kCompressBytesThreshold = 128; | 16 const size_t UniquePosition::kCompressBytesThreshold = 128; |
17 | 17 |
18 // static. | 18 // static. |
19 bool UniquePosition::IsValidSuffix(const std::string& suffix) { | 19 bool UniquePosition::IsValidSuffix(const std::string& suffix) { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 UniquePosition::UniquePosition( | 374 UniquePosition::UniquePosition( |
375 const std::string& prefix, | 375 const std::string& prefix, |
376 const std::string& suffix) | 376 const std::string& suffix) |
377 : bytes_(prefix + suffix), | 377 : bytes_(prefix + suffix), |
378 is_valid_(IsValidBytes(bytes_)) { | 378 is_valid_(IsValidBytes(bytes_)) { |
379 DCHECK(IsValidSuffix(suffix)); | 379 DCHECK(IsValidSuffix(suffix)); |
380 DCHECK(IsValid()); | 380 DCHECK(IsValid()); |
381 } | 381 } |
382 | 382 |
383 } // namespace syncer | 383 } // namespace syncer |
OLD | NEW |