Chromium Code Reviews| Index: chrome/browser/content_settings/content_settings_pref_provider.cc |
| diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc |
| index 1a684868c985b645a2d1167593af7e169ed27202..c0d5f765121980c762d5fb9eb4ad6333bc3f68ba 100644 |
| --- a/chrome/browser/content_settings/content_settings_pref_provider.cc |
| +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc |
| @@ -443,6 +443,18 @@ ContentSetting PrefProvider::GetContentSetting( |
| const GURL& secondary_url, |
| ContentSettingsType content_type, |
| const ResourceIdentifier& resource_identifier) const { |
| + Value* value = GetContentSettingValue(primary_url, |
|
Bernhard Bauer
2011/09/01 13:33:19
This leaks |value|.
markusheintz_
2011/09/01 14:32:49
Fixed here and in the PolicyProvider as well.
|
| + secondary_url, |
| + content_type, |
| + resource_identifier); |
| + return value ? ValueToContentSetting(value) : CONTENT_SETTING_DEFAULT; |
| +} |
| + |
| +Value* PrefProvider::GetContentSettingValue( |
| + const GURL& primary_url, |
| + const GURL& secondary_url, |
| + ContentSettingsType content_type, |
| + const ResourceIdentifier& resource_identifier) const { |
| // For a |PrefProvider| used in a |HostContentSettingsMap| of a non incognito |
| // profile, this will always return NULL. |
| // TODO(markusheintz): I don't like this. I'd like to have an |
| @@ -455,17 +467,14 @@ ContentSetting PrefProvider::GetContentSetting( |
| content_type, |
| resource_identifier); |
| if (incognito_value) |
| - return ValueToContentSetting(incognito_value); |
| + return incognito_value->DeepCopy(); |
| Value* value = value_map_.GetValue( |
| primary_url, |
| secondary_url, |
| content_type, |
| resource_identifier); |
| - if (value) |
| - return ValueToContentSetting(value); |
| - |
| - return CONTENT_SETTING_DEFAULT; |
| + return value ? value->DeepCopy() : NULL; |
| } |
| void PrefProvider::GetAllContentSettingsRules( |