Index: components/content_settings/core/browser/content_settings_origin_identifier_value_map.h |
diff --git a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h |
index 1ac2fe56bed118f216876804e563e97c8d9a14a4..f27816b6574e3159cc6f1a0cac840e2f2b4cb775 100644 |
--- a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h |
+++ b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h |
@@ -13,6 +13,7 @@ |
#include "base/macros.h" |
#include "base/memory/linked_ptr.h" |
+#include "base/time/time.h" |
#include "components/content_settings/core/common/content_settings.h" |
class GURL; |
@@ -44,7 +45,14 @@ class OriginIdentifierValueMap { |
bool operator<(const OriginIdentifierValueMap::PatternPair& other) const; |
}; |
- typedef std::map<PatternPair, linked_ptr<base::Value> > Rules; |
+ struct ValueEntry { |
+ base::Time last_modified; |
+ linked_ptr<base::Value> value; |
+ ValueEntry(); |
+ ~ValueEntry(); |
+ }; |
+ |
+ typedef std::map<PatternPair, ValueEntry> Rules; |
typedef std::map<EntryMapKey, Rules> EntryMap; |
EntryMap::iterator begin() { |
@@ -92,15 +100,22 @@ class OriginIdentifierValueMap { |
ContentSettingsType content_type, |
const ResourceIdentifier& resource_identifier) const; |
- // Sets the |value| for the given |primary_pattern|, |secondary_pattern|, |
- // |content_type|, |resource_identifier| tuple. The method takes the ownership |
- // of the passed |value|. |
- void SetValue( |
+ base::Time GetLastModified( |
const ContentSettingsPattern& primary_pattern, |
const ContentSettingsPattern& secondary_pattern, |
ContentSettingsType content_type, |
- const ResourceIdentifier& resource_identifier, |
- base::Value* value); |
+ const ResourceIdentifier& resource_identifier) const; |
+ |
+ // Sets the |value| for the given |primary_pattern|, |secondary_pattern|, |
+ // |content_type|, |resource_identifier| tuple. The method takes the ownership |
+ // of the passed |value|. The caller can also store a |last_modified| date |
+ // for each value. |
+ void SetValue(const ContentSettingsPattern& primary_pattern, |
+ const ContentSettingsPattern& secondary_pattern, |
+ ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ base::Time last_modified, |
+ base::Value* value); |
// Deletes the map entry for the given |primary_pattern|, |
// |secondary_pattern|, |content_type|, |resource_identifier| tuple. |