| 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 "components/safe_browsing_db/prefix_set.h" | 5 #include "components/safe_browsing_db/prefix_set.h" |
| 6 | 6 |
| 7 #include <limits.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 | 10 |
| 9 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_file.h" | 12 #include "base/files/scoped_file.h" |
| 11 #include "base/logging.h" | 13 #include "base/logging.h" |
| 12 #include "base/md5.h" | 14 #include "base/md5.h" |
| 13 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 14 #include "base/metrics/sparse_histogram.h" | 16 #include "base/metrics/sparse_histogram.h" |
| 15 | 17 |
| 16 namespace safe_browsing { | 18 namespace safe_browsing { |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 443 } |
| 442 buffer_.push_back(prefix); | 444 buffer_.push_back(prefix); |
| 443 | 445 |
| 444 // Flush buffer when a run can be constructed. +1 for the index item, and +1 | 446 // Flush buffer when a run can be constructed. +1 for the index item, and +1 |
| 445 // to leave at least one item in the buffer for dropping duplicates. | 447 // to leave at least one item in the buffer for dropping duplicates. |
| 446 if (buffer_.size() > PrefixSet::kMaxRun + 2) | 448 if (buffer_.size() > PrefixSet::kMaxRun + 2) |
| 447 EmitRun(); | 449 EmitRun(); |
| 448 } | 450 } |
| 449 | 451 |
| 450 } // namespace safe_browsing | 452 } // namespace safe_browsing |
| OLD | NEW |