summaryrefslogtreecommitdiffstats
path: root/chrome/browser/host_content_settings_map.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 20:44:08 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 20:44:08 +0000
commitcaef08681cdb94e7ed838c28e4c6789e89d1bbc6 (patch)
treee5e7696da5cda768144d4173791abf4c3c6b5f7d /chrome/browser/host_content_settings_map.cc
parentd23ca37c840cfd3b43a23d3e3e122f0674608935 (diff)
downloadchromium_src-caef08681cdb94e7ed838c28e4c6789e89d1bbc6.zip
chromium_src-caef08681cdb94e7ed838c28e4c6789e89d1bbc6.tar.gz
chromium_src-caef08681cdb94e7ed838c28e4c6789e89d1bbc6.tar.bz2
Don't return CONTENT_SETTING_DEFAULT from GetContentSetting() under any conditions.
BUG=35775 TEST=Covered by unittests TBR=jorlow Review URL: http://codereview.chromium.org/609008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/host_content_settings_map.cc')
-rw-r--r--chrome/browser/host_content_settings_map.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc
index f09fe8c..9ae31a3 100644
--- a/chrome/browser/host_content_settings_map.cc
+++ b/chrome/browser/host_content_settings_map.cc
@@ -127,9 +127,12 @@ ContentSetting HostContentSettingsMap::GetContentSetting(
ContentSettingsType content_type) const {
AutoLock auto_lock(lock_);
HostContentSettings::const_iterator i(host_content_settings_.find(host));
- return (i == host_content_settings_.end()) ?
- default_content_settings_.settings[content_type] :
- i->second.settings[content_type];
+ if (i != host_content_settings_.end()) {
+ ContentSetting setting = i->second.settings[content_type];
+ if (setting != CONTENT_SETTING_DEFAULT)
+ return setting;
+ }
+ return default_content_settings_.settings[content_type];
}
ContentSetting HostContentSettingsMap::GetContentSetting(