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

Unified Diff: chrome/browser/extensions/extension_webkit_preferences.cc

Issue 9192021: Disallow WebSQL and localStorage in platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_webkit_preferences.cc
diff --git a/chrome/browser/extensions/extension_webkit_preferences.cc b/chrome/browser/extensions/extension_webkit_preferences.cc
index c72cc3446e690f457182d41a0ec5db1d75ab67c0..d20390c40647d58f2814602ecfa82db3f15bb7c9 100644
--- a/chrome/browser/extensions/extension_webkit_preferences.cc
+++ b/chrome/browser/extensions/extension_webkit_preferences.cc
@@ -12,7 +12,10 @@ namespace extension_webkit_preferences {
void SetPreferences(const Extension* extension,
content::ViewType render_view_type,
WebPreferences* webkit_prefs) {
- if (extension && !extension->is_hosted_app()) {
+ if (!extension)
+ return;
+
+ if (!extension->is_hosted_app()) {
// Extensions are trusted so we override any user preferences for disabling
// javascript or images.
webkit_prefs->loads_images_automatically = true;
@@ -30,11 +33,15 @@ void SetPreferences(const Extension* extension,
webkit_prefs->accelerated_2d_canvas_enabled = false;
}
}
- if (extension) {
- // Enable WebGL features that regular pages can't access, since they add
- // more risk of fingerprinting.
- webkit_prefs->privileged_webgl_extensions_enabled = true;
+
+ if (extension->is_platform_app()) {
+ webkit_prefs->databases_enabled = false;
+ webkit_prefs->local_storage_enabled = false;
}
+
+ // Enable WebGL features that regular pages can't access, since they add
+ // more risk of fingerprinting.
+ webkit_prefs->privileged_webgl_extensions_enabled = true;
}
} // extension_webkit_preferences
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698