| 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ORIGIN_IDENTIFIER_VALUE
_MAP_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ORIGIN_IDENTIFIER_VALUE
_MAP_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ORIGIN_IDENTIFIER_VALUE
_MAP_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ORIGIN_IDENTIFIER_VALUE
_MAP_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Deletes the map entry for the given |item_pattern|, | 89 // Deletes the map entry for the given |item_pattern|, |
| 90 // |top_level_frame_pattern|, |content_type|, |resource_identifier| tuple. | 90 // |top_level_frame_pattern|, |content_type|, |resource_identifier| tuple. |
| 91 void DeleteValue( | 91 void DeleteValue( |
| 92 const ContentSettingsPattern& item_pattern, | 92 const ContentSettingsPattern& item_pattern, |
| 93 const ContentSettingsPattern& top_level_frame_pattern, | 93 const ContentSettingsPattern& top_level_frame_pattern, |
| 94 ContentSettingsType content_type, | 94 ContentSettingsType content_type, |
| 95 const ResourceIdentifier& resource_identifier); | 95 const ResourceIdentifier& resource_identifier); |
| 96 | 96 |
| 97 // Deletes the map entry at the passed position. The method returns the | 97 // Deletes the map entry at the passed position. The method returns the |
| 98 // position of the next entry in the map. | 98 // position of the next entry in the map. |
| 99 EntryList::iterator DeleteValue(EntryList::iterator entry); | 99 EntryList::iterator erase(EntryList::iterator entry); |
| 100 | 100 |
| 101 // Clears all map entries. | 101 // Clears all map entries. |
| 102 void Clear(); | 102 void clear(); |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 // Finds the list entry for the given |item_pattern|, | 105 // Finds the list entry for the given |item_pattern|, |
| 106 // |top_level_frame_pattern|, |content_type|, |resource_identifier| tuple and | 106 // |top_level_frame_pattern|, |content_type|, |resource_identifier| tuple and |
| 107 // returns the iterator of the list entry. If no entry is found for the passed | 107 // returns the iterator of the list entry. If no entry is found for the passed |
| 108 // parameters then the end of list iterator is returned. | 108 // parameters then the end of list iterator is returned. |
| 109 EntryList::iterator FindEntry( | 109 EntryList::iterator FindEntry( |
| 110 const ContentSettingsPattern& item_pattern, | 110 const ContentSettingsPattern& item_pattern, |
| 111 const ContentSettingsPattern& top_level_frame_pattern, | 111 const ContentSettingsPattern& top_level_frame_pattern, |
| 112 ContentSettingsType content_type, | 112 ContentSettingsType content_type, |
| 113 const ResourceIdentifier& resource_identifier); | 113 const ResourceIdentifier& resource_identifier); |
| 114 | 114 |
| 115 EntryList entries_; | 115 EntryList entries_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(OriginIdentifierValueMap); | 117 DISALLOW_COPY_AND_ASSIGN(OriginIdentifierValueMap); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Compares two origin value map entries and tests if the item, top-level-frame | 120 // Compares two origin value map entries and tests if the item, top-level-frame |
| 121 // pattern pair of the first entry has a higher precedences then the pattern | 121 // pattern pair of the first entry has a higher precedences then the pattern |
| 122 // pair of the second entry. | 122 // pair of the second entry. |
| 123 bool operator>(const OriginIdentifierValueMap::Entry& first, | 123 bool operator>(const OriginIdentifierValueMap::Entry& first, |
| 124 const OriginIdentifierValueMap::Entry& second); | 124 const OriginIdentifierValueMap::Entry& second); |
| 125 | 125 |
| 126 } // namespace content_settings | 126 } // namespace content_settings |
| 127 | 127 |
| 128 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ORIGIN_IDENTIFIER_VA
LUE_MAP_H_ | 128 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ORIGIN_IDENTIFIER_VA
LUE_MAP_H_ |
| OLD | NEW |