Changeset 169357 in webkit
- Timestamp:
- May 26, 2014 11:01:45 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r169356 r169357 1 2014-05-26 Sam Weinig <sam@webkit.org> 2 3 [WebKit2] Add better default preferences while keeping backward compatibility for the C-SPI 4 https://bugs.webkit.org/show_bug.cgi?id=133289 5 6 Reviewed by Anders Carlsson. 7 8 * Shared/WebPreferencesStore.h: 9 Change a few defaults: 10 - PluginsEnabled -> false 11 - JavaEnabled -> false 12 - JavaEnabledForLocalFiles -> false 13 - StorageBlockingPolicy -> BlockThirdPartyStorage 14 15 * UIProcess/API/C/WKPreferences.cpp: 16 (WKPreferencesCreate): 17 (WKPreferencesCreateWithIdentifier): 18 * UIProcess/WebPageGroup.cpp: 19 (WebKit::WebPageGroup::WebPageGroup): 20 Switch to using WebPreferences::createWithLegacyDefaults(). 21 22 * UIProcess/WebPreferences.cpp: 23 (WebKit::WebPreferences::create): 24 (WebKit::WebPreferences::createWithLegacyDefaults): 25 * UIProcess/WebPreferences.h: 26 Move create functions to the cpp file and add createWithLegacyDefaults() which keeps 27 the old defaults; 28 29 * UIProcess/API/C/WKPreferencesRef.h: 30 Fix the comment. 31 32 * UIProcess/API/Cocoa/WKPreferences.h: 33 Update the comment to reflect the new defaults. 34 35 * WebProcess/WebPage/WebPage.cpp: 36 (WebKit::WebPage::updatePreferences): 37 Unconditionally set setShouldDispatchJavaScriptWindowOnErrorEvents() to true. This setting only 38 exists for legacy WebKit. 39 1 40 2014-05-26 Dan Bernstein <mitz@apple.com> 2 41 -
trunk/Source/WebKit2/Shared/WebPreferencesStore.h
r169321 r169357 107 107 macro(LoadsImagesAutomatically, loadsImagesAutomatically, Bool, bool, true) \ 108 108 macro(LoadsSiteIconsIgnoringImageLoadingPreference, loadsSiteIconsIgnoringImageLoadingPreference, Bool, bool, false) \ 109 macro(PluginsEnabled, pluginsEnabled, Bool, bool, true) \110 macro(JavaEnabled, javaEnabled, Bool, bool, true) \111 macro(JavaEnabledForLocalFiles, javaEnabledForLocalFiles, Bool, bool, true) \109 macro(PluginsEnabled, pluginsEnabled, Bool, bool, false) \ 110 macro(JavaEnabled, javaEnabled, Bool, bool, false) \ 111 macro(JavaEnabledForLocalFiles, javaEnabledForLocalFiles, Bool, bool, false) \ 112 112 macro(OfflineWebApplicationCacheEnabled, offlineWebApplicationCacheEnabled, Bool, bool, false) \ 113 113 macro(LocalStorageEnabled, localStorageEnabled, Bool, bool, true) \ … … 244 244 macro(InspectorAttachedWidth, inspectorAttachedWidth, UInt32, uint32_t, 750) \ 245 245 macro(InspectorAttachmentSide, inspectorAttachmentSide, UInt32, uint32_t, 0) \ 246 macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, WebCore::SecurityOrigin:: AllowAllStorage) \246 macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, WebCore::SecurityOrigin::BlockThirdPartyStorage) \ 247 247 \ 248 248 -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
r168978 r169357 44 44 WKPreferencesRef WKPreferencesCreate() 45 45 { 46 RefPtr<WebPreferences> preferences = WebPreferences::create (String(), "WebKit2.");46 RefPtr<WebPreferences> preferences = WebPreferences::createWithLegacyDefaults(String(), "WebKit2."); 47 47 return toAPI(preferences.release().leakRef()); 48 48 } … … 50 50 WKPreferencesRef WKPreferencesCreateWithIdentifier(WKStringRef identifierRef) 51 51 { 52 RefPtr<WebPreferences> preferences = WebPreferences::create (toWTFString(identifierRef), "WebKit2.");52 RefPtr<WebPreferences> preferences = WebPreferences::createWithLegacyDefaults(toWTFString(identifierRef), "WebKit2."); 53 53 return toAPI(preferences.release().leakRef()); 54 54 } -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h
r168541 r169357 217 217 WK_EXPORT bool WKPreferencesGetShouldRespectImageOrientation(WKPreferencesRef preferencesRef); 218 218 219 // Defaults to false219 // Defaults to kWKAllowAllStorage 220 220 WK_EXPORT void WKPreferencesSetStorageBlockingPolicy(WKPreferencesRef preferencesRef, WKStorageBlockingPolicy policy); 221 221 WK_EXPORT WKStorageBlockingPolicy WKPreferencesGetStorageBlockingPolicy(WKPreferencesRef preferencesRef); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h
r169323 r169357 80 80 81 81 #if !TARGET_OS_IPHONE 82 /*! @abstract Whether Java is enabled. Defaults to YES.82 /*! @abstract Whether Java is enabled. Defaults to NO. 83 83 */ 84 84 @property (nonatomic, getter=isJavaEnabled) BOOL javaEnabled; 85 85 86 /*! abstract Whether plug-ins are enabled. Defaults to YES.86 /*! abstract Whether plug-ins are enabled. Defaults to NO. 87 87 */ 88 88 @property (nonatomic, getter=arePlugInsEnabled) BOOL plugInsEnabled; -
trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp
r166553 r169357 85 85 WebPageGroup::WebPageGroup(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient) 86 86 : m_data(pageGroupData(identifier, visibleToInjectedBundle, visibleToHistoryClient)) 87 , m_preferences(WebPreferences::create (m_data.identifer, ".WebKit2"))87 , m_preferences(WebPreferences::createWithLegacyDefaults(m_data.identifer, ".WebKit2")) 88 88 { 89 89 webPageGroupMap().set(m_data.pageGroupID, this); -
trunk/Source/WebKit2/UIProcess/WebPreferences.cpp
r166553 r169357 36 36 // Instead of tracking private browsing state as a boolean preference, we should let the client provide storage sessions explicitly. 37 37 static unsigned privateBrowsingPageCount; 38 39 PassRefPtr<WebPreferences> WebPreferences::create(const String& identifier, const String& keyPrefix) 40 { 41 return adoptRef(new WebPreferences(identifier, keyPrefix)); 42 } 43 44 PassRefPtr<WebPreferences> WebPreferences::createWithLegacyDefaults(const String& identifier, const String& keyPrefix) 45 { 46 RefPtr<WebPreferences> preferences = adoptRef(new WebPreferences(identifier, keyPrefix)); 47 preferences->m_store.setOverrideDefaultsBoolValueForKey(WebPreferencesKey::javaEnabledKey(), true); 48 preferences->m_store.setOverrideDefaultsBoolValueForKey(WebPreferencesKey::javaEnabledForLocalFilesKey(), true); 49 preferences->m_store.setOverrideDefaultsBoolValueForKey(WebPreferencesKey::pluginsEnabledKey(), true); 50 preferences->m_store.setOverrideDefaultsUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey(), WebCore::SecurityOrigin::AllowAllStorage); 51 return preferences.release(); 52 } 38 53 39 54 WebPreferences::WebPreferences(const String& identifier, const String& keyPrefix) -
trunk/Source/WebKit2/UIProcess/WebPreferences.h
r166553 r169357 44 44 class WebPreferences : public API::ObjectImpl<API::Object::Type::Preferences> { 45 45 public: 46 static PassRefPtr<WebPreferences> create(const String& identifier, const String& keyPrefix) 47 { 48 return adoptRef(new WebPreferences(identifier, keyPrefix)); 49 } 46 static PassRefPtr<WebPreferences> create(const String& identifier, const String& keyPrefix); 47 static PassRefPtr<WebPreferences> createWithLegacyDefaults(const String& identifier, const String& keyPrefix); 50 48 51 49 virtual ~WebPreferences(); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r169332 r169357 2740 2740 settings.setEnableInheritURIQueryComponent(store.getBoolValueForKey(WebPreferencesKey::enableInheritURIQueryComponentKey())); 2741 2741 2742 settings.setShouldDispatchJavaScriptWindowOnErrorEvents(true); 2743 2742 2744 if (store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey())) 2743 2745 m_processSuppressionDisabledByWebPreference.stop();
Note: See TracChangeset
for help on using the changeset viewer.