OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Implementation of ChunkRange class. | 5 // Implementation of ChunkRange class. |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/safe_browsing/chunk_range.h" | 9 #include "chrome/browser/safe_browsing/chunk_range.h" |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 | 15 |
| 16 namespace safe_browsing { |
| 17 |
16 ChunkRange::ChunkRange(int start) : start_(start), stop_(start) { | 18 ChunkRange::ChunkRange(int start) : start_(start), stop_(start) { |
17 } | 19 } |
18 | 20 |
19 ChunkRange::ChunkRange(int start, int stop) : start_(start), stop_(stop) { | 21 ChunkRange::ChunkRange(int start, int stop) : start_(start), stop_(stop) { |
20 } | 22 } |
21 | 23 |
22 ChunkRange::ChunkRange(const ChunkRange& rhs) | 24 ChunkRange::ChunkRange(const ChunkRange& rhs) |
23 : start_(rhs.start()), stop_(rhs.stop()) { | 25 : start_(rhs.start()), stop_(rhs.stop()) { |
24 } | 26 } |
25 | 27 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 107 |
106 // Adjust our mid point. | 108 // Adjust our mid point. |
107 if (chunk.stop() < chunk_number) | 109 if (chunk.stop() < chunk_number) |
108 low = mid + 1; | 110 low = mid + 1; |
109 else | 111 else |
110 high = mid - 1; | 112 high = mid - 1; |
111 } | 113 } |
112 | 114 |
113 return false; | 115 return false; |
114 } | 116 } |
| 117 |
| 118 } // namespace safe_browsing |
OLD | NEW |