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

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 8592001: Valgrind: Fix a leak in ContentSettingsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/content_settings/content_settings_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/content_settings/host_content_settings_map.h" 5 #include "chrome/browser/content_settings/host_content_settings_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 } 205 }
206 206
207 void HostContentSettingsMap::SetDefaultContentSetting( 207 void HostContentSettingsMap::SetDefaultContentSetting(
208 ContentSettingsType content_type, 208 ContentSettingsType content_type,
209 ContentSetting setting) { 209 ContentSetting setting) {
210 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE); 210 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE);
211 DCHECK(IsSettingAllowedForType(setting, content_type)); 211 DCHECK(IsSettingAllowedForType(setting, content_type));
212 212
213 base::Value* value = Value::CreateIntegerValue(setting); 213 base::Value* value = Value::CreateIntegerValue(setting);
214 content_settings_providers_[DEFAULT_PROVIDER]->SetWebsiteSetting( 214 if (!content_settings_providers_[DEFAULT_PROVIDER]->SetWebsiteSetting(
215 ContentSettingsPattern::Wildcard(), 215 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
216 ContentSettingsPattern::Wildcard(), 216 content_type, std::string(), value)) {
217 content_type, 217 delete value;
218 std::string(), 218 }
219 value);
220 } 219 }
221 220
222 void HostContentSettingsMap::SetWebsiteSetting( 221 void HostContentSettingsMap::SetWebsiteSetting(
223 const ContentSettingsPattern& primary_pattern, 222 const ContentSettingsPattern& primary_pattern,
224 const ContentSettingsPattern& secondary_pattern, 223 const ContentSettingsPattern& secondary_pattern,
225 ContentSettingsType content_type, 224 ContentSettingsType content_type,
226 const std::string& resource_identifier, 225 const std::string& resource_identifier,
227 base::Value* value) { 226 base::Value* value) {
228 DCHECK(IsValueAllowedForType(value, content_type)); 227 DCHECK(IsValueAllowedForType(value, content_type));
229 DCHECK(content_settings::SupportsResourceIdentifier(content_type) || 228 DCHECK(content_settings::SupportsResourceIdentifier(content_type) ||
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 441 }
443 } 442 }
444 443
445 if (info) { 444 if (info) {
446 info->source = content_settings::SETTING_SOURCE_NONE; 445 info->source = content_settings::SETTING_SOURCE_NONE;
447 info->primary_pattern = ContentSettingsPattern(); 446 info->primary_pattern = ContentSettingsPattern();
448 info->secondary_pattern = ContentSettingsPattern(); 447 info->secondary_pattern = ContentSettingsPattern();
449 } 448 }
450 return NULL; 449 return NULL;
451 } 450 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698