OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/rappor/byte_vector_utils.h" | 5 #include "components/rappor/byte_vector_utils.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include <string> | 8 #include <string> |
8 | 9 |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
12 #include "crypto/random.h" | 13 #include "crypto/random.h" |
13 | 14 |
14 namespace rappor { | 15 namespace rappor { |
15 | 16 |
16 namespace { | 17 namespace { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 bytes_to_go -= n; | 228 bytes_to_go -= n; |
228 generated_bytes_ += n; | 229 generated_bytes_ += n; |
229 // Check max_number_of_bits_per_request from 10.1 Table 2 | 230 // Check max_number_of_bits_per_request from 10.1 Table 2 |
230 // max_number_of_bits_per_request == 2^19 bits == 2^16 bytes | 231 // max_number_of_bits_per_request == 2^19 bits == 2^16 bytes |
231 DCHECK_LT(generated_bytes_, 1U << 16); | 232 DCHECK_LT(generated_bytes_, 1U << 16); |
232 } | 233 } |
233 return bytes; | 234 return bytes; |
234 } | 235 } |
235 | 236 |
236 } // namespace rappor | 237 } // namespace rappor |
OLD | NEW |