| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "components/content_settings/core/browser/content_settings_rule.h" | 6 #include "components/content_settings/core/browser/content_settings_rule.h" |
| 7 | 7 |
| 8 namespace content_settings { | 8 namespace content_settings { |
| 9 | 9 |
| 10 Rule::Rule() {} | 10 Rule::Rule() {} |
| 11 | 11 |
| 12 Rule::Rule( | 12 Rule::Rule( |
| 13 const ContentSettingsPattern& primary_pattern, | 13 const ContentSettingsPattern& primary_pattern, |
| 14 const ContentSettingsPattern& secondary_pattern, | 14 const ContentSettingsPattern& secondary_pattern, |
| 15 base::Value* value) | 15 base::Value* value) |
| 16 : primary_pattern(primary_pattern), | 16 : primary_pattern(primary_pattern), |
| 17 secondary_pattern(secondary_pattern), | 17 secondary_pattern(secondary_pattern), |
| 18 value(value) { | 18 value(value) { |
| 19 DCHECK(value); | 19 DCHECK(value); |
| 20 } | 20 } |
| 21 | 21 |
| 22 Rule::Rule(const Rule& other) = default; |
| 23 |
| 22 Rule::~Rule() {} | 24 Rule::~Rule() {} |
| 23 | 25 |
| 24 RuleIterator::~RuleIterator() {} | 26 RuleIterator::~RuleIterator() {} |
| 25 | 27 |
| 26 EmptyRuleIterator::~EmptyRuleIterator() {} | 28 EmptyRuleIterator::~EmptyRuleIterator() {} |
| 27 | 29 |
| 28 bool EmptyRuleIterator::HasNext() const { | 30 bool EmptyRuleIterator::HasNext() const { |
| 29 return false; | 31 return false; |
| 30 } | 32 } |
| 31 | 33 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 57 auto current_iterator = iterators_.begin(); | 59 auto current_iterator = iterators_.begin(); |
| 58 DCHECK(current_iterator != iterators_.end()); | 60 DCHECK(current_iterator != iterators_.end()); |
| 59 DCHECK((*current_iterator)->HasNext()); | 61 DCHECK((*current_iterator)->HasNext()); |
| 60 const Rule& to_return = (*current_iterator)->Next(); | 62 const Rule& to_return = (*current_iterator)->Next(); |
| 61 if (!(*current_iterator)->HasNext()) | 63 if (!(*current_iterator)->HasNext()) |
| 62 iterators_.erase(current_iterator); | 64 iterators_.erase(current_iterator); |
| 63 return to_return; | 65 return to_return; |
| 64 } | 66 } |
| 65 | 67 |
| 66 } // namespace content_settings | 68 } // namespace content_settings |
| OLD | NEW |