| 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 "components/content_settings/core/browser/content_settings_rule.h" | 5 #include "components/content_settings/core/browser/content_settings_rule.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| 11 namespace content_settings { | 11 namespace content_settings { |
| 12 | 12 |
| 13 Rule::Rule() {} | 13 Rule::Rule() {} |
| 14 | 14 |
| 15 Rule::Rule( | 15 Rule::Rule(const ContentSettingsPattern& primary_pattern, |
| 16 const ContentSettingsPattern& primary_pattern, | 16 const ContentSettingsPattern& secondary_pattern, |
| 17 const ContentSettingsPattern& secondary_pattern, | 17 base::Time last_modified, |
| 18 base::Value* value) | 18 base::Value* value) |
| 19 : primary_pattern(primary_pattern), | 19 : primary_pattern(primary_pattern), |
| 20 secondary_pattern(secondary_pattern), | 20 secondary_pattern(secondary_pattern), |
| 21 last_modified(last_modified), |
| 21 value(value) { | 22 value(value) { |
| 22 DCHECK(value); | 23 DCHECK(value); |
| 23 } | 24 } |
| 24 | 25 |
| 25 Rule::Rule(const Rule& other) = default; | 26 Rule::Rule(const Rule& other) = default; |
| 26 | 27 |
| 27 Rule::~Rule() {} | 28 Rule::~Rule() {} |
| 28 | 29 |
| 29 RuleIterator::~RuleIterator() {} | 30 RuleIterator::~RuleIterator() {} |
| 30 | 31 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 auto current_iterator = iterators_.begin(); | 52 auto current_iterator = iterators_.begin(); |
| 52 DCHECK(current_iterator != iterators_.end()); | 53 DCHECK(current_iterator != iterators_.end()); |
| 53 DCHECK((*current_iterator)->HasNext()); | 54 DCHECK((*current_iterator)->HasNext()); |
| 54 const Rule& to_return = (*current_iterator)->Next(); | 55 const Rule& to_return = (*current_iterator)->Next(); |
| 55 if (!(*current_iterator)->HasNext()) | 56 if (!(*current_iterator)->HasNext()) |
| 56 iterators_.erase(current_iterator); | 57 iterators_.erase(current_iterator); |
| 57 return to_return; | 58 return to_return; |
| 58 } | 59 } |
| 59 | 60 |
| 60 } // namespace content_settings | 61 } // namespace content_settings |
| OLD | NEW |