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

Unified Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 7167007: Use empty resource identifier unless --enable-resource-content-settings is set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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: chrome/browser/content_settings/host_content_settings_map.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index 153a6c71cadbf151151adef7ea4a8495e85e48c3..682256e2064263f4ce43c9ee8ebc294ec679f25d 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/content_settings/content_settings_policy_provider.h"
#include "chrome/browser/content_settings/content_settings_pref_provider.h"
#include "chrome/browser/content_settings/content_settings_provider.h"
+#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
@@ -162,6 +163,8 @@ ContentSetting HostContentSettingsMap::GetContentSetting(
ContentSettingsType content_type,
const std::string& resource_identifier) const {
DCHECK_NE(CONTENT_SETTINGS_TYPE_COOKIES, content_type);
+ DCHECK_NE(content_settings::RequiresResourceIdentifier(content_type),
+ resource_identifier.empty());
return GetContentSettingInternal(url, content_type, resource_identifier);
}
@@ -261,6 +264,8 @@ void HostContentSettingsMap::GetSettingsForOneType(
ContentSettingsType content_type,
const std::string& resource_identifier,
SettingsForOneType* settings) const {
+ DCHECK_NE(content_settings::RequiresResourceIdentifier(content_type),
+ resource_identifier.empty());
DCHECK(settings);
// Collect content_settings::Rules for the given content_type and
// resource_identifier from the content settings providers.
@@ -309,6 +314,8 @@ void HostContentSettingsMap::SetContentSetting(
const std::string& resource_identifier,
ContentSetting setting) {
DCHECK(IsSettingAllowedForType(setting, content_type));
+ DCHECK_NE(content_settings::RequiresResourceIdentifier(content_type),
+ resource_identifier.empty());
for (ProviderIterator provider = content_settings_providers_.begin();
provider != content_settings_providers_.end();
++provider) {
« no previous file with comments | « chrome/browser/content_settings/content_settings_pref_provider.cc ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698