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 "chrome/browser/content_settings/content_settings_origin_identifier_val
ue_map.h" | 5 #include "chrome/browser/content_settings/content_settings_origin_identifier_val
ue_map.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 | 10 |
11 namespace content_settings { | 11 namespace content_settings { |
12 | 12 |
| 13 OriginIdentifierValueMap::Entry::Entry( |
| 14 ContentSettingsPattern item_pattern, |
| 15 ContentSettingsPattern top_level_frame_pattern, |
| 16 ContentSettingsType content_type, |
| 17 OriginIdentifierValueMap::ResourceIdentifier identifier, |
| 18 Value* value) |
| 19 : item_pattern(item_pattern), |
| 20 top_level_frame_pattern(top_level_frame_pattern), |
| 21 content_type(content_type), |
| 22 identifier(identifier), |
| 23 value(value) { |
| 24 } |
| 25 |
| 26 OriginIdentifierValueMap::Entry::~Entry() {} |
| 27 |
13 OriginIdentifierValueMap::OriginIdentifierValueMap() {} | 28 OriginIdentifierValueMap::OriginIdentifierValueMap() {} |
14 | 29 |
15 OriginIdentifierValueMap::~OriginIdentifierValueMap() { | 30 OriginIdentifierValueMap::~OriginIdentifierValueMap() { |
16 Clear(); | 31 Clear(); |
17 } | 32 } |
18 | 33 |
19 bool operator>(const OriginIdentifierValueMap::Entry& first, | 34 bool operator>(const OriginIdentifierValueMap::Entry& first, |
20 const OriginIdentifierValueMap::Entry& second) { | 35 const OriginIdentifierValueMap::Entry& second) { |
21 // Compare item patterns. | 36 // Compare item patterns. |
22 if (first.item_pattern > second.item_pattern) | 37 if (first.item_pattern > second.item_pattern) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 top_level_frame_pattern == entry->top_level_frame_pattern && | 137 top_level_frame_pattern == entry->top_level_frame_pattern && |
123 content_type == entry->content_type && | 138 content_type == entry->content_type && |
124 resource_identifier == entry->identifier) { | 139 resource_identifier == entry->identifier) { |
125 return entry; | 140 return entry; |
126 } | 141 } |
127 } | 142 } |
128 return entries_.end(); | 143 return entries_.end(); |
129 } | 144 } |
130 | 145 |
131 } // namespace content_settings | 146 } // namespace content_settings |
OLD | NEW |