| 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 // Interface for objects providing content setting rules. | 5 // Interface for objects providing content setting rules. |
| 6 | 6 |
| 7 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ | 7 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ |
| 8 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ | 8 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class RuleIterator { | 33 class RuleIterator { |
| 34 public: | 34 public: |
| 35 virtual ~RuleIterator(); | 35 virtual ~RuleIterator(); |
| 36 virtual bool HasNext() const = 0; | 36 virtual bool HasNext() const = 0; |
| 37 virtual Rule Next() = 0; | 37 virtual Rule Next() = 0; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class EmptyRuleIterator : public RuleIterator { | 40 class EmptyRuleIterator : public RuleIterator { |
| 41 public: | 41 public: |
| 42 virtual ~EmptyRuleIterator(); | 42 ~EmptyRuleIterator() override; |
| 43 virtual bool HasNext() const override; | 43 bool HasNext() const override; |
| 44 virtual Rule Next() override; | 44 Rule Next() override; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class ConcatenationIterator : public RuleIterator { | 47 class ConcatenationIterator : public RuleIterator { |
| 48 public: | 48 public: |
| 49 // ConcatenationIterator takes ownership of the pointers in the |iterators| | 49 // ConcatenationIterator takes ownership of the pointers in the |iterators| |
| 50 // list and |auto_lock|. |auto_lock| can be NULL if no locking is needed. | 50 // list and |auto_lock|. |auto_lock| can be NULL if no locking is needed. |
| 51 ConcatenationIterator(ScopedVector<RuleIterator>* iterators, | 51 ConcatenationIterator(ScopedVector<RuleIterator>* iterators, |
| 52 base::AutoLock* auto_lock); | 52 base::AutoLock* auto_lock); |
| 53 virtual ~ConcatenationIterator(); | 53 ~ConcatenationIterator() override; |
| 54 virtual bool HasNext() const override; | 54 bool HasNext() const override; |
| 55 virtual Rule Next() override; | 55 Rule Next() override; |
| 56 |
| 56 private: | 57 private: |
| 57 ScopedVector<RuleIterator> iterators_; | 58 ScopedVector<RuleIterator> iterators_; |
| 58 scoped_ptr<base::AutoLock> auto_lock_; | 59 scoped_ptr<base::AutoLock> auto_lock_; |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace content_settings | 62 } // namespace content_settings |
| 62 | 63 |
| 63 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ | 64 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ |
| OLD | NEW |