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 "chrome/browser/safe_browsing/prefix_set.h" | 5 #include "chrome/browser/safe_browsing/prefix_set.h" |
6 | 6 |
7 #include <math.h> | |
Scott Hess - ex-Googler
2014/06/04 16:19:08
Is math.h even necessary? I don't see anything ob
jaekyeom
2014/06/05 11:58:57
Done.
| |
7 #include <algorithm> | 8 #include <algorithm> |
8 #include <math.h> | |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/md5.h" | 13 #include "base/md5.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/metrics/sparse_histogram.h" | 15 #include "base/metrics/sparse_histogram.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 } | 483 } |
484 buffer_.push_back(prefix); | 484 buffer_.push_back(prefix); |
485 | 485 |
486 // Flush buffer when a run can be constructed. +1 for the index item, and +1 | 486 // Flush buffer when a run can be constructed. +1 for the index item, and +1 |
487 // to leave at least one item in the buffer for dropping duplicates. | 487 // to leave at least one item in the buffer for dropping duplicates. |
488 if (buffer_.size() > PrefixSet::kMaxRun + 2) | 488 if (buffer_.size() > PrefixSet::kMaxRun + 2) |
489 EmitRun(); | 489 EmitRun(); |
490 } | 490 } |
491 | 491 |
492 } // namespace safe_browsing | 492 } // namespace safe_browsing |
OLD | NEW |