Index: components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc |
diff --git a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc |
index 3f6133b67a8cb760ad7fb12b8d5c3c8ec5633a74..c52103eded9ad49f845ef93314aa3182e3cf06dd 100644 |
--- a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc |
+++ b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc |
@@ -38,10 +38,11 @@ class RuleIteratorImpl : public RuleIterator { |
Rule Next() override { |
DCHECK(HasNext()); |
- DCHECK(current_rule_->second.get()); |
+ DCHECK(current_rule_->second.value.get()); |
Rule to_return(current_rule_->first.primary_pattern, |
current_rule_->first.secondary_pattern, |
- current_rule_->second.get()->DeepCopy()); |
+ current_rule_->second.last_modified, |
+ current_rule_->second.value.get()->DeepCopy()); |
++current_rule_; |
return to_return; |
} |
@@ -83,6 +84,10 @@ bool OriginIdentifierValueMap::PatternPair::operator<( |
std::tie(other.primary_pattern, other.secondary_pattern); |
} |
+OriginIdentifierValueMap::ValueEntry::ValueEntry() : last_modified(), value(){}; |
+ |
+OriginIdentifierValueMap::ValueEntry::~ValueEntry(){}; |
+ |
std::unique_ptr<RuleIterator> OriginIdentifierValueMap::GetRuleIterator( |
ContentSettingsType content_type, |
const ResourceIdentifier& resource_identifier, |
@@ -129,7 +134,7 @@ base::Value* OriginIdentifierValueMap::GetValue( |
for (const auto& entry : it->second) { |
if (entry.first.primary_pattern.Matches(primary_url) && |
entry.first.secondary_pattern.Matches(secondary_url)) { |
- return entry.second.get(); |
+ return entry.second.value.get(); |
} |
} |
return nullptr; |
@@ -140,6 +145,7 @@ void OriginIdentifierValueMap::SetValue( |
const ContentSettingsPattern& secondary_pattern, |
ContentSettingsType content_type, |
const ResourceIdentifier& resource_identifier, |
+ base::Time last_modified, |
base::Value* value) { |
DCHECK(primary_pattern.IsValid()); |
DCHECK(secondary_pattern.IsValid()); |
@@ -150,7 +156,8 @@ void OriginIdentifierValueMap::SetValue( |
EntryMapKey key(content_type, resource_identifier); |
PatternPair patterns(primary_pattern, secondary_pattern); |
// This will create the entry and the linked_ptr if needed. |
- entries_[key][patterns].reset(value); |
+ entries_[key][patterns].value.reset(value); |
+ entries_[key][patterns].last_modified = last_modified; |
} |
void OriginIdentifierValueMap::DeleteValue( |