Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: components/content_settings/core/browser/content_settings_origin_identifier_value_map.h

Issue 2812113004: Write last_modified date to Content Settings in the PrefProvider (Closed)
Patch Set: fix ios Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0ba4c20912ce443709a578c6e0898c389f9cd162 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,21 @@ 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;
raymes 2017/04/24 03:20:22 Cool, that makes more sense to me. I was thinking
dullweber 2017/04/25 10:50:44 that sounds like a good idea and I tried to implem
raymes 2017/04/26 01:54:17 Ah that makes sense. Thanks for looking at it. Per
+
+ // 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(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type,
+ const ResourceIdentifier& resource_identifier,
+ base::Time last_modified,
raymes 2017/04/24 03:20:22 const base::Time&
dullweber 2017/04/25 10:50:44 I thought that base::Time and other very small cla
raymes 2017/04/26 01:54:17 Thanks for looking at it. I think it's fine to pas
+ base::Value* value);
// Deletes the map entry for the given |primary_pattern|,
// |secondary_pattern|, |content_type|, |resource_identifier| tuple.

Powered by Google App Engine
This is Rietveld 408576698