OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/previews/core/previews_black_list_item.h" | 5 #include "components/previews/core/previews_black_list_item.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "components/previews/core/previews_opt_out_store.h" | 9 #include "components/previews/core/previews_opt_out_store.h" |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 DCHECK_LE(opt_out_records_.size(), max_stored_history_length_); | 50 DCHECK_LE(opt_out_records_.size(), max_stored_history_length_); |
51 } | 51 } |
52 | 52 |
53 bool PreviewsBlackListItem::IsBlackListed(base::Time now) const { | 53 bool PreviewsBlackListItem::IsBlackListed(base::Time now) const { |
54 DCHECK_LE(opt_out_records_.size(), max_stored_history_length_); | 54 DCHECK_LE(opt_out_records_.size(), max_stored_history_length_); |
55 return most_recent_opt_out_time_ && | 55 return most_recent_opt_out_time_ && |
56 now - most_recent_opt_out_time_.value() < max_black_list_duration_ && | 56 now - most_recent_opt_out_time_.value() < max_black_list_duration_ && |
57 total_opt_out_ >= opt_out_black_list_threshold_; | 57 total_opt_out_ >= opt_out_black_list_threshold_; |
58 } | 58 } |
59 | 59 |
| 60 size_t PreviewsBlackListItem::OptOutRecordsSizeForTesting() const { |
| 61 return opt_out_records_.size(); |
| 62 } |
| 63 |
60 } // namespace previews | 64 } // namespace previews |
OLD | NEW |