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 <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "components/content_settings/core/common/content_settings_pattern.h" | 17 #include "components/content_settings/core/common/content_settings_pattern.h" |
18 | 18 |
19 namespace content_settings { | 19 namespace content_settings { |
20 | 20 |
21 struct Rule { | 21 struct Rule { |
22 Rule(); | 22 Rule(); |
23 // Rule takes ownership of |value|. | 23 // Rule takes ownership of |value|. |
24 Rule(const ContentSettingsPattern& primary_pattern, | 24 Rule(const ContentSettingsPattern& primary_pattern, |
25 const ContentSettingsPattern& secondary_pattern, | 25 const ContentSettingsPattern& secondary_pattern, |
26 base::Value* value); | 26 base::Value* value); |
| 27 Rule(const Rule& other); |
27 ~Rule(); | 28 ~Rule(); |
28 | 29 |
29 ContentSettingsPattern primary_pattern; | 30 ContentSettingsPattern primary_pattern; |
30 ContentSettingsPattern secondary_pattern; | 31 ContentSettingsPattern secondary_pattern; |
31 linked_ptr<base::Value> value; | 32 linked_ptr<base::Value> value; |
32 }; | 33 }; |
33 | 34 |
34 class RuleIterator { | 35 class RuleIterator { |
35 public: | 36 public: |
36 virtual ~RuleIterator(); | 37 virtual ~RuleIterator(); |
(...skipping 19 matching lines...) Expand all Loading... |
56 Rule Next() override; | 57 Rule Next() override; |
57 | 58 |
58 private: | 59 private: |
59 std::vector<scoped_ptr<RuleIterator>> iterators_; | 60 std::vector<scoped_ptr<RuleIterator>> iterators_; |
60 scoped_ptr<base::AutoLock> auto_lock_; | 61 scoped_ptr<base::AutoLock> auto_lock_; |
61 }; | 62 }; |
62 | 63 |
63 } // namespace content_settings | 64 } // namespace content_settings |
64 | 65 |
65 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ | 66 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_RULE_H_ |
OLD | NEW |