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

Side by Side Diff: components/content_settings/core/browser/content_settings_registry.cc

Issue 2853983002: Ensure settings returned from Content Settings providers are valid (Closed)
Patch Set: Ensure settings returned from Content Settings providers are valid Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/content_settings/core/browser/content_settings_registry.h" 5 #include "components/content_settings/core/browser/content_settings_registry.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, 243 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
244 CONTENT_SETTING_ASK), 244 CONTENT_SETTING_ASK),
245 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE, 245 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE,
246 WebsiteSettingsRegistry::PLATFORM_ANDROID | 246 WebsiteSettingsRegistry::PLATFORM_ANDROID |
247 WebsiteSettingsRegistry::PLATFORM_CHROMEOS, 247 WebsiteSettingsRegistry::PLATFORM_CHROMEOS,
248 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); 248 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE);
249 249
250 Register(CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, "durable-storage", 250 Register(CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, "durable-storage",
251 CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE, 251 CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE,
252 WhitelistedSchemes(), 252 WhitelistedSchemes(),
253 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), 253 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
254 CONTENT_SETTING_ASK),
254 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, 255 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE,
255 WebsiteSettingsRegistry::DESKTOP | 256 WebsiteSettingsRegistry::DESKTOP |
256 WebsiteSettingsRegistry::PLATFORM_ANDROID, 257 WebsiteSettingsRegistry::PLATFORM_ANDROID,
257 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); 258 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE);
258 259
259 Register(CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync", 260 Register(CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync",
260 CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, 261 CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE,
261 WhitelistedSchemes(), 262 WhitelistedSchemes(),
262 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), 263 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK),
263 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, 264 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (!website_settings_info) 336 if (!website_settings_info)
336 return; 337 return;
337 338
338 DCHECK(!base::ContainsKey(content_settings_info_, type)); 339 DCHECK(!base::ContainsKey(content_settings_info_, type));
339 content_settings_info_[type] = base::MakeUnique<ContentSettingsInfo>( 340 content_settings_info_[type] = base::MakeUnique<ContentSettingsInfo>(
340 website_settings_info, whitelisted_schemes, valid_settings, 341 website_settings_info, whitelisted_schemes, valid_settings,
341 incognito_behavior); 342 incognito_behavior);
342 } 343 }
343 344
344 } // namespace content_settings 345 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698