Chromium Code Reviews| Index: chrome/browser/content_settings/content_settings_policy_provider.cc |
| diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc |
| index 4b135b8c867d52d407f219ebd75f312021a7541e..8015b56589c258beaf2258e365b55635c9bf1220 100644 |
| --- a/chrome/browser/content_settings/content_settings_policy_provider.cc |
| +++ b/chrome/browser/content_settings/content_settings_policy_provider.cc |
| @@ -391,17 +391,34 @@ ContentSetting PolicyProvider::GetContentSetting( |
| const ResourceIdentifier& resource_identifier) const { |
| // Resource identifier are not supported by policies as long as the feature is |
| // behind a flag. So resource identifiers are simply ignored. |
| - Value* value = value_map_.GetValue(primary_url, |
| - secondary_url, |
| - content_type, |
| - resource_identifier); |
| + scoped_ptr<Value> value(GetContentSettingValue(primary_url, |
| + secondary_url, |
| + content_type, |
| + resource_identifier)); |
| ContentSetting setting = |
| - value == NULL ? CONTENT_SETTING_DEFAULT : ValueToContentSetting(value); |
| + value.get() ? ValueToContentSetting(value.get()) |
| + : CONTENT_SETTING_DEFAULT; |
| if (setting == CONTENT_SETTING_DEFAULT && default_provider_) |
| setting = default_provider_->ProvideDefaultSetting(content_type); |
| return setting; |
| } |
| +Value* PolicyProvider::GetContentSettingValue( |
| + const GURL& primary_url, |
| + const GURL& secondary_url, |
| + ContentSettingsType content_type, |
| + const ResourceIdentifier& resource_identifier) const { |
| + // Resource identifier are not supported by policies as long as the feature is |
| + // behind a flag. So resource identifiers are simply ignored. |
| + Value* value = value_map_.GetValue(primary_url, |
| + secondary_url, |
| + content_type, |
| + resource_identifier); |
| + return value ? value->DeepCopy() : NULL; |
|
wtc
2011/09/01 18:21:09
I hope these DeepCopy() calls are not expensive.
markusheintz_
2011/09/02 15:22:21
Using a pointer may cause synchronization issues.
|
| +} |
| + |
| + |
|
wtc
2011/09/01 18:21:09
Nit: remove these two blank lines.
markusheintz_
2011/09/02 15:22:21
Done.
|
| + |
| void PolicyProvider::GetAllContentSettingsRules( |
| ContentSettingsType content_type, |
| const ResourceIdentifier& resource_identifier, |