../WebCore: [Windows] Refactor RuntimeEnabledFeatures as a Singleton
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Sep 2013 22:18:34 +0000 (22:18 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Sep 2013 22:18:34 +0000 (22:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121883

Windows is experiencing crashes when client programs (such as
DumpRenderTree) attemp to change settings on the RuntimeEnabledFeatures
object. The inlined static accessor methods are not accessing
memory safely (when compiled by Visual Studio) resulting in
crashes.

Reviewed by Jer Noble.

* WebCore.exp.in: Remove static accessors for RuntimeEnabledFeatures.
* bindings/generic/RuntimeEnabledFeatures.cpp: Switch methods to
conform to a singleton pattern.
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::sharedRuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::fileSystemEnabled):
(WebCore::RuntimeEnabledFeatures::javaScriptI18NAPIEnabled):
(WebCore::RuntimeEnabledFeatures::audioEnabled):
(WebCore::RuntimeEnabledFeatures::htmlMediaElementEnabled):
(WebCore::RuntimeEnabledFeatures::htmlAudioElementEnabled):
(WebCore::RuntimeEnabledFeatures::htmlVideoElementEnabled):
(WebCore::RuntimeEnabledFeatures::htmlSourceElementEnabled):
(WebCore::RuntimeEnabledFeatures::mediaControllerEnabled):
(WebCore::RuntimeEnabledFeatures::mediaErrorEnabled):
(WebCore::RuntimeEnabledFeatures::timeRangesEnabled):
(WebCore::RuntimeEnabledFeatures::sharedWorkerEnabled):
(WebCore::RuntimeEnabledFeatures::webSocketEnabled):
(WebCore::RuntimeEnabledFeatures::openDatabaseEnabled):
(WebCore::RuntimeEnabledFeatures::openDatabaseSyncEnabled):
* bindings/generic/RuntimeEnabledFeatures.h: Ditto.
(WebCore::RuntimeEnabledFeatures::setLocalStorageEnabled):
(WebCore::RuntimeEnabledFeatures::localStorageEnabled):
(WebCore::RuntimeEnabledFeatures::setSessionStorageEnabled):
(WebCore::RuntimeEnabledFeatures::sessionStorageEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitNotificationsEnabled):
(WebCore::RuntimeEnabledFeatures::webkitNotificationsEnabled):
(WebCore::RuntimeEnabledFeatures::setApplicationCacheEnabled):
(WebCore::RuntimeEnabledFeatures::applicationCacheEnabled):
(WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled):
(WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled):
(WebCore::RuntimeEnabledFeatures::setGeolocationEnabled):
(WebCore::RuntimeEnabledFeatures::geolocationEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitIndexedDBEnabled):
(WebCore::RuntimeEnabledFeatures::webkitIndexedDBEnabled):
(WebCore::RuntimeEnabledFeatures::indexedDBEnabled):
(WebCore::RuntimeEnabledFeatures::setCanvasPathEnabled):
(WebCore::RuntimeEnabledFeatures::canvasPathEnabled):
(WebCore::RuntimeEnabledFeatures::setCSSExclusionsEnabled):
(WebCore::RuntimeEnabledFeatures::cssExclusionsEnabled):
(WebCore::RuntimeEnabledFeatures::setCSSShapesEnabled):
(WebCore::RuntimeEnabledFeatures::cssShapesEnabled):
(WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled):
(WebCore::RuntimeEnabledFeatures::cssRegionsEnabled):
(WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled):
(WebCore::RuntimeEnabledFeatures::cssCompositingEnabled):
(WebCore::RuntimeEnabledFeatures::setFontLoadEventsEnabled):
(WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled):
(WebCore::RuntimeEnabledFeatures::webkitFullScreenAPIEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitFullScreenAPIEnabled):
(WebCore::RuntimeEnabledFeatures::webkitRequestFullScreenEnabled):
(WebCore::RuntimeEnabledFeatures::webkitIsFullScreenEnabled):
(WebCore::RuntimeEnabledFeatures::webkitFullScreenKeyboardInputAllowedEnabled):
(WebCore::RuntimeEnabledFeatures::webkitCurrentFullScreenElementEnabled):
(WebCore::RuntimeEnabledFeatures::webkitCancelFullScreenEnabled):
(WebCore::RuntimeEnabledFeatures::webkitFullscreenEnabledEnabled):
(WebCore::RuntimeEnabledFeatures::webkitFullscreenElementEnabled):
(WebCore::RuntimeEnabledFeatures::webkitExitFullscreenEnabled):
(WebCore::RuntimeEnabledFeatures::webkitRequestFullscreenEnabled):
(WebCore::RuntimeEnabledFeatures::touchEnabled):
(WebCore::RuntimeEnabledFeatures::setTouchEnabled):
(WebCore::RuntimeEnabledFeatures::setDeviceMotionEnabled):
(WebCore::RuntimeEnabledFeatures::deviceMotionEnabled):
(WebCore::RuntimeEnabledFeatures::deviceMotionEventEnabled):
(WebCore::RuntimeEnabledFeatures::ondevicemotionEnabled):
(WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled):
(WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled):
(WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled):
(WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled):
(WebCore::RuntimeEnabledFeatures::setSpeechInputEnabled):
(WebCore::RuntimeEnabledFeatures::speechInputEnabled):
(WebCore::RuntimeEnabledFeatures::webkitSpeechEnabled):
(WebCore::RuntimeEnabledFeatures::webkitGrammarEnabled):
(WebCore::RuntimeEnabledFeatures::setScriptedSpeechEnabled):
(WebCore::RuntimeEnabledFeatures::scriptedSpeechEnabled):
(WebCore::RuntimeEnabledFeatures::webkitSpeechRecognitionEnabled):
(WebCore::RuntimeEnabledFeatures::webkitSpeechRecognitionErrorEnabled):
(WebCore::RuntimeEnabledFeatures::webkitSpeechRecognitionEventEnabled):
(WebCore::RuntimeEnabledFeatures::webkitSpeechGrammarEnabled):
(WebCore::RuntimeEnabledFeatures::webkitSpeechGrammarListEnabled):
(WebCore::RuntimeEnabledFeatures::setFileSystemEnabled):
(WebCore::RuntimeEnabledFeatures::setJavaScriptI18NAPIEnabled):
(WebCore::RuntimeEnabledFeatures::mediaStreamEnabled):
(WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled):
(WebCore::RuntimeEnabledFeatures::webkitGetUserMediaEnabled):
(WebCore::RuntimeEnabledFeatures::webkitMediaStreamEnabled):
(WebCore::RuntimeEnabledFeatures::peerConnectionEnabled):
(WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
(WebCore::RuntimeEnabledFeatures::webkitRTCPeerConnectionEnabled):
(WebCore::RuntimeEnabledFeatures::setLegacyCSSVendorPrefixesEnabled):
(WebCore::RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitGetGamepadsEnabled):
(WebCore::RuntimeEnabledFeatures::webkitGetGamepadsEnabled):
(WebCore::RuntimeEnabledFeatures::quotaEnabled):
(WebCore::RuntimeEnabledFeatures::setQuotaEnabled):
(WebCore::RuntimeEnabledFeatures::mediaSourceEnabled):
(WebCore::RuntimeEnabledFeatures::setMediaSourceEnabled):
(WebCore::RuntimeEnabledFeatures::encryptedMediaEnabled):
(WebCore::RuntimeEnabledFeatures::setEncryptedMediaEnabled):
(WebCore::RuntimeEnabledFeatures::webkitVideoTrackEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitVideoTrackEnabled):
(WebCore::RuntimeEnabledFeatures::shadowDOMEnabled):
(WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled):
(WebCore::RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled):
(WebCore::RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled):
(WebCore::RuntimeEnabledFeatures::customDOMElementsEnabled):
(WebCore::RuntimeEnabledFeatures::setCustomDOMElements):
(WebCore::RuntimeEnabledFeatures::styleScopedEnabled):
(WebCore::RuntimeEnabledFeatures::setStyleScopedEnabled):
(WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled):
(WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled):
(WebCore::RuntimeEnabledFeatures::inputTypeDateTimeEnabled):
(WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeEnabled):
(WebCore::RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled):
(WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled):
(WebCore::RuntimeEnabledFeatures::inputTypeMonthEnabled):
(WebCore::RuntimeEnabledFeatures::setInputTypeMonthEnabled):
(WebCore::RuntimeEnabledFeatures::inputTypeTimeEnabled):
(WebCore::RuntimeEnabledFeatures::setInputTypeTimeEnabled):
(WebCore::RuntimeEnabledFeatures::inputTypeWeekEnabled):
(WebCore::RuntimeEnabledFeatures::setInputTypeWeekEnabled):
(WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled):
(WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled):
(WebCore::RuntimeEnabledFeatures::seamlessIFramesEnabled):
(WebCore::RuntimeEnabledFeatures::setSeamlessIFramesEnabled):
(WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled):
(WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::getCSSPropertyNamePrefix): Use singleton accessors.
(WebCore::cssPropertyIDForJSCSSPropertyName): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GetRuntimeEnableFunctionName): Generate singleton version of
accessors.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::fontLoaded): Use singleton accessors.
(WebCore::CSSFontFace::getFontData): Ditto.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Ditto.
* css/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID): Ditto.
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::rewriteSpecifiers):
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::fontLoaded): Ditto.
* css/StyleResolver.h:
(WebCore::StyleResolver::ensureScopeResolver): Ditto.
* dom/Document.cpp:
(WebCore::Document::cssRegionsEnabled): Ditto.
(WebCore::Document::cssCompositingEnabled):
(WebCore::Document::shouldDisplaySeamlesslyWithParent):
(WebCore::Document::getCachedLocale):
* dom/Element.cpp:
(WebCore::Element::createShadowRoot): Ditto.
* dom/Position.cpp:
(WebCore::Position::Position): Ditto.
(WebCore::Position::findParent):
* dom/TreeScope.cpp:
(WebCore::TreeScope::getSelection): Ditto.
* dom/make_names.pl:
(printConstructorInterior): Generate singleton version of accessors.
(printWrapperFunctions): Ditto.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isSpeechEnabled): Use singleton accessors.
(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishParsingChildren): Ditto.
(WebCore::HTMLMediaElement::scheduleDelayedAction):
(WebCore::HTMLMediaElement::loadTimerFired):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::loadInternal):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::playbackProgressTimerFired):
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
(WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack):
(WebCore::HTMLMediaElement::addAudioTrack):
(WebCore::HTMLMediaElement::addTextTrack):
(WebCore::HTMLMediaElement::addVideoTrack):
(WebCore::HTMLMediaElement::removeAudioTrack):
(WebCore::HTMLMediaElement::removeTextTrack):
(WebCore::HTMLMediaElement::removeVideoTrack):
(WebCore::HTMLMediaElement::audioTracks):
(WebCore::HTMLMediaElement::textTracks):
(WebCore::HTMLMediaElement::videoTracks):
(WebCore::HTMLMediaElement::didAddTextTrack):
(WebCore::HTMLMediaElement::didRemoveTextTrack):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::userCancelledLoad):
(WebCore::HTMLMediaElement::hasClosedCaptions):
(WebCore::HTMLMediaElement::setClosedCaptionsVisible):
(WebCore::HTMLMediaElement::configureTextTrackDisplay):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute): Ditto.
(WebCore::HTMLStyleElement::scopedAttributeChanged):
(WebCore::HTMLStyleElement::unregisterWithScopingNode):
(WebCore::HTMLStyleElement::scoped):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::parseAttribute): Ditto.
(WebCore::HTMLTrackElement::scheduleLoad):
(WebCore::HTMLTrackElement::canLoadUrl):
* html/InputType.cpp:
(WebCore::createInputTypeFactoryMap): Ditto.
* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener): Ditto.
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks): Ditto.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Ditto.
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShadowDOMEnabled):
(WebCore::InternalSettings::setAuthorShadowDOMForAnyElementEnabled):
(WebCore::InternalSettings::setStyleScopedEnabled):
(WebCore::InternalSettings::setCSSExclusionsEnabled):
(WebCore::InternalSettings::setCSSShapesEnabled):
(WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):

../WebKit: [Windows] Refactor RuntimeEnabledFeatures as a Singleton
https://bugs.webkit.org/show_bug.cgi?id=121883

Reviewed by Jer Noble.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Expose singleton accessor for DLL clients.

../WebKit/blackberry: Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883.

Reviewed by Jer Noble.

* WebKitSupport/DumpRenderTreeSupport.cpp:
(DumpRenderTreeSupport::setStyleScopedEnabled): use
singleton accessor.

../WebKit/efl: Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883.

Reviewed by Jer Noble.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::setCSSRegionsEnabled): Use singleton.
(DumpRenderTreeSupportEfl::setSeamlessIFramesEnabled): Ditto.
* ewk/ewk_settings.cpp:
(ewk_settings_shadow_dom_enable_get): Ditto.
(ewk_settings_shadow_dom_enable_set):
* ewk/ewk_view.cpp:
(_ewk_view_priv_new): Ditto.

../WebKit/gtk: Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883.

Reviewed by Jer Noble.

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::setCSSRegionsEnabled): Use singleton.
(DumpRenderTreeSupportGtk::setExperimentalContentSecurityPolicyFeaturesEnabled):
(DumpRenderTreeSupportGtk::setSeamlessIFramesEnabled):
(DumpRenderTreeSupportGtk::setShadowDOMEnabled):
(DumpRenderTreeSupportGtk::setStyleScopedEnabled):
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings): Ditto.

../WebKit/mac: Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883.

Reviewed by Jer Noble.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Use singleton accessor.
(-[WebView _setDashboardBehavior:to:]): Ditto.

../WebKit/qt: Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883.

Reviewed by Jer Noble.

* Api/qwebsettings.cpp:
(QWebSettingsPrivate::apply): Use singleton accessor.
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::setSeamlessIFramesEnabled): Ditto.

../WebKit/win: [Windows] Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883

Reviewed by Jer Noble.

* WebView.cpp:
(WebView::notifyPreferencesChanged): Use singleton accessor

../WebKit2: Refactor RuntimeEnabledFeatures as a Singleton.
https://bugs.webkit.org/show_bug.cgi?id=121883.

Reviewed by Jer Noble.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Use
Singleton accessor.
(WebKit::InjectedBundle::setShadowDOMEnabled):
(WebKit::InjectedBundle::setCSSRegionsEnabled):
(WebKit::InjectedBundle::setCSSCompositingEnabled):
(WebKit::InjectedBundle::setSeamlessIFramesEnabled):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Ditto.
* WebProcess/qt/WebProcessQt.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156424 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSSegmentedFontFace.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/dom/make_names.pl
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/InputType.cpp
Source/WebCore/page/ContentSecurityPolicy.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/ewk/ewk_settings.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebsettings.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/qt/WebProcessQt.cpp

index 66e53f0980fa420d634c5f43e34092e3f061edc2..b0b7395890b6bd7bd81d6fb49ab9bcf15d438074 100644 (file)
@@ -1,3 +1,234 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        [Windows] Refactor RuntimeEnabledFeatures as a Singleton
+        https://bugs.webkit.org/show_bug.cgi?id=121883
+
+        Windows is experiencing crashes when client programs (such as
+        DumpRenderTree) attemp to change settings on the RuntimeEnabledFeatures
+        object. The inlined static accessor methods are not accessing
+        memory safely (when compiled by Visual Studio) resulting in
+        crashes.
+
+        Reviewed by Jer Noble.
+
+        * WebCore.exp.in: Remove static accessors for RuntimeEnabledFeatures.
+        * bindings/generic/RuntimeEnabledFeatures.cpp: Switch methods to
+        conform to a singleton pattern.
+        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
+        (WebCore::RuntimeEnabledFeatures::sharedRuntimeEnabledFeatures):
+        (WebCore::RuntimeEnabledFeatures::fileSystemEnabled):
+        (WebCore::RuntimeEnabledFeatures::javaScriptI18NAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::audioEnabled):
+        (WebCore::RuntimeEnabledFeatures::htmlMediaElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::htmlAudioElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::htmlVideoElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::htmlSourceElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::mediaControllerEnabled):
+        (WebCore::RuntimeEnabledFeatures::mediaErrorEnabled):
+        (WebCore::RuntimeEnabledFeatures::timeRangesEnabled):
+        (WebCore::RuntimeEnabledFeatures::sharedWorkerEnabled):
+        (WebCore::RuntimeEnabledFeatures::webSocketEnabled):
+        (WebCore::RuntimeEnabledFeatures::openDatabaseEnabled):
+        (WebCore::RuntimeEnabledFeatures::openDatabaseSyncEnabled):
+        * bindings/generic/RuntimeEnabledFeatures.h: Ditto.
+        (WebCore::RuntimeEnabledFeatures::setLocalStorageEnabled):
+        (WebCore::RuntimeEnabledFeatures::localStorageEnabled):
+        (WebCore::RuntimeEnabledFeatures::setSessionStorageEnabled):
+        (WebCore::RuntimeEnabledFeatures::sessionStorageEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitNotificationsEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitNotificationsEnabled):
+        (WebCore::RuntimeEnabledFeatures::setApplicationCacheEnabled):
+        (WebCore::RuntimeEnabledFeatures::applicationCacheEnabled):
+        (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled):
+        (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled):
+        (WebCore::RuntimeEnabledFeatures::setGeolocationEnabled):
+        (WebCore::RuntimeEnabledFeatures::geolocationEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitIndexedDBEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitIndexedDBEnabled):
+        (WebCore::RuntimeEnabledFeatures::indexedDBEnabled):
+        (WebCore::RuntimeEnabledFeatures::setCanvasPathEnabled):
+        (WebCore::RuntimeEnabledFeatures::canvasPathEnabled):
+        (WebCore::RuntimeEnabledFeatures::setCSSExclusionsEnabled):
+        (WebCore::RuntimeEnabledFeatures::cssExclusionsEnabled):
+        (WebCore::RuntimeEnabledFeatures::setCSSShapesEnabled):
+        (WebCore::RuntimeEnabledFeatures::cssShapesEnabled):
+        (WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled):
+        (WebCore::RuntimeEnabledFeatures::cssRegionsEnabled):
+        (WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled):
+        (WebCore::RuntimeEnabledFeatures::cssCompositingEnabled):
+        (WebCore::RuntimeEnabledFeatures::setFontLoadEventsEnabled):
+        (WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitFullScreenAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitFullScreenAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitRequestFullScreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitIsFullScreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitFullScreenKeyboardInputAllowedEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitCurrentFullScreenElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitCancelFullScreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitFullscreenEnabledEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitFullscreenElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitExitFullscreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitRequestFullscreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::touchEnabled):
+        (WebCore::RuntimeEnabledFeatures::setTouchEnabled):
+        (WebCore::RuntimeEnabledFeatures::setDeviceMotionEnabled):
+        (WebCore::RuntimeEnabledFeatures::deviceMotionEnabled):
+        (WebCore::RuntimeEnabledFeatures::deviceMotionEventEnabled):
+        (WebCore::RuntimeEnabledFeatures::ondevicemotionEnabled):
+        (WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled):
+        (WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled):
+        (WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled):
+        (WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled):
+        (WebCore::RuntimeEnabledFeatures::setSpeechInputEnabled):
+        (WebCore::RuntimeEnabledFeatures::speechInputEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitSpeechEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitGrammarEnabled):
+        (WebCore::RuntimeEnabledFeatures::setScriptedSpeechEnabled):
+        (WebCore::RuntimeEnabledFeatures::scriptedSpeechEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitSpeechRecognitionEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitSpeechRecognitionErrorEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitSpeechRecognitionEventEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitSpeechGrammarEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitSpeechGrammarListEnabled):
+        (WebCore::RuntimeEnabledFeatures::setFileSystemEnabled):
+        (WebCore::RuntimeEnabledFeatures::setJavaScriptI18NAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::mediaStreamEnabled):
+        (WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitGetUserMediaEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitMediaStreamEnabled):
+        (WebCore::RuntimeEnabledFeatures::peerConnectionEnabled):
+        (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitRTCPeerConnectionEnabled):
+        (WebCore::RuntimeEnabledFeatures::setLegacyCSSVendorPrefixesEnabled):
+        (WebCore::RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitGetGamepadsEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitGetGamepadsEnabled):
+        (WebCore::RuntimeEnabledFeatures::quotaEnabled):
+        (WebCore::RuntimeEnabledFeatures::setQuotaEnabled):
+        (WebCore::RuntimeEnabledFeatures::mediaSourceEnabled):
+        (WebCore::RuntimeEnabledFeatures::setMediaSourceEnabled):
+        (WebCore::RuntimeEnabledFeatures::encryptedMediaEnabled):
+        (WebCore::RuntimeEnabledFeatures::setEncryptedMediaEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitVideoTrackEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitVideoTrackEnabled):
+        (WebCore::RuntimeEnabledFeatures::shadowDOMEnabled):
+        (WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled):
+        (WebCore::RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::customDOMElementsEnabled):
+        (WebCore::RuntimeEnabledFeatures::setCustomDOMElements):
+        (WebCore::RuntimeEnabledFeatures::styleScopedEnabled):
+        (WebCore::RuntimeEnabledFeatures::setStyleScopedEnabled):
+        (WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled):
+        (WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled):
+        (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeEnabled):
+        (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeEnabled):
+        (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled):
+        (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled):
+        (WebCore::RuntimeEnabledFeatures::inputTypeMonthEnabled):
+        (WebCore::RuntimeEnabledFeatures::setInputTypeMonthEnabled):
+        (WebCore::RuntimeEnabledFeatures::inputTypeTimeEnabled):
+        (WebCore::RuntimeEnabledFeatures::setInputTypeTimeEnabled):
+        (WebCore::RuntimeEnabledFeatures::inputTypeWeekEnabled):
+        (WebCore::RuntimeEnabledFeatures::setInputTypeWeekEnabled):
+        (WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled):
+        (WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled):
+        (WebCore::RuntimeEnabledFeatures::seamlessIFramesEnabled):
+        (WebCore::RuntimeEnabledFeatures::setSeamlessIFramesEnabled):
+        (WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled):
+        (WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::getCSSPropertyNamePrefix): Use singleton accessors.
+        (WebCore::cssPropertyIDForJSCSSPropertyName): Ditto.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GetRuntimeEnableFunctionName): Generate singleton version of
+        accessors.
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::fontLoaded): Use singleton accessors.
+        (WebCore::CSSFontFace::getFontData): Ditto.
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule): Ditto.
+        * css/CSSParser.cpp:
+        (WebCore::isSimpleLengthPropertyID): Ditto.
+        (WebCore::isValidKeywordPropertyAndValue):
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::rewriteSpecifiers):
+        * css/CSSSegmentedFontFace.cpp:
+        (WebCore::CSSSegmentedFontFace::fontLoaded): Ditto.
+        * css/StyleResolver.h:
+        (WebCore::StyleResolver::ensureScopeResolver): Ditto.
+        * dom/Document.cpp:
+        (WebCore::Document::cssRegionsEnabled): Ditto.
+        (WebCore::Document::cssCompositingEnabled):
+        (WebCore::Document::shouldDisplaySeamlesslyWithParent):
+        (WebCore::Document::getCachedLocale):
+        * dom/Element.cpp:
+        (WebCore::Element::createShadowRoot): Ditto.
+        * dom/Position.cpp:
+        (WebCore::Position::Position): Ditto.
+        (WebCore::Position::findParent):
+        * dom/TreeScope.cpp:
+        (WebCore::TreeScope::getSelection): Ditto.
+        * dom/make_names.pl:
+        (printConstructorInterior): Generate singleton version of accessors.
+        (printWrapperFunctions): Ditto.
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::isSpeechEnabled): Use singleton accessors.
+        (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Ditto.
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::finishParsingChildren): Ditto.
+        (WebCore::HTMLMediaElement::scheduleDelayedAction):
+        (WebCore::HTMLMediaElement::loadTimerFired):
+        (WebCore::HTMLMediaElement::prepareForLoad):
+        (WebCore::HTMLMediaElement::loadInternal):
+        (WebCore::HTMLMediaElement::setReadyState):
+        (WebCore::HTMLMediaElement::playbackProgressTimerFired):
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack):
+        (WebCore::HTMLMediaElement::addAudioTrack):
+        (WebCore::HTMLMediaElement::addTextTrack):
+        (WebCore::HTMLMediaElement::addVideoTrack):
+        (WebCore::HTMLMediaElement::removeAudioTrack):
+        (WebCore::HTMLMediaElement::removeTextTrack):
+        (WebCore::HTMLMediaElement::removeVideoTrack):
+        (WebCore::HTMLMediaElement::audioTracks):
+        (WebCore::HTMLMediaElement::textTracks):
+        (WebCore::HTMLMediaElement::videoTracks):
+        (WebCore::HTMLMediaElement::didAddTextTrack):
+        (WebCore::HTMLMediaElement::didRemoveTextTrack):
+        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
+        (WebCore::HTMLMediaElement::userCancelledLoad):
+        (WebCore::HTMLMediaElement::hasClosedCaptions):
+        (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
+        (WebCore::HTMLMediaElement::configureTextTrackDisplay):
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::parseAttribute): Ditto.
+        (WebCore::HTMLStyleElement::scopedAttributeChanged):
+        (WebCore::HTMLStyleElement::unregisterWithScopingNode):
+        (WebCore::HTMLStyleElement::scoped):
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::parseAttribute): Ditto.
+        (WebCore::HTMLTrackElement::scheduleLoad):
+        (WebCore::HTMLTrackElement::canLoadUrl):
+        * html/InputType.cpp:
+        (WebCore::createInputTypeFactoryMap): Ditto.
+        * page/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled): Ditto.
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::addEventListener): Ditto.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::performPostLayoutTasks): Ditto.
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup): Ditto.
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setShadowDOMEnabled):
+        (WebCore::InternalSettings::setAuthorShadowDOMForAnyElementEnabled):
+        (WebCore::InternalSettings::setStyleScopedEnabled):
+        (WebCore::InternalSettings::setCSSExclusionsEnabled):
+        (WebCore::InternalSettings::setCSSShapesEnabled):
+        (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
+
 2013-09-25  Andreas Kling  <akling@apple.com>
 
         Unreviewed build fix for IDBDatabase.
index d3a7298b65e52584bdcb6d1653f8a5c4c807997f..c4b8eb245d076abe048c4dccf10e8d4dea0ec25c 100644 (file)
@@ -738,10 +738,7 @@ __ZN7WebCore21setGlobalIconDatabaseEPNS_16IconDatabaseBaseE
 __ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE
 __ZN7WebCore22HTMLPlugInImageElement24restartSnapshottedPlugInEv
 __ZN7WebCore22HTMLPlugInImageElement29setIsPrimarySnapshottedPlugInEb
-__ZN7WebCore22RuntimeEnabledFeatures23isCSSCompositingEnabledE
-__ZN7WebCore22RuntimeEnabledFeatures22isCSSExclusionsEnabledE
-__ZN7WebCore22RuntimeEnabledFeatures18isCSSShapesEnabledE
-__ZN7WebCore22RuntimeEnabledFeatures40isLangAttributeAwareFormControlUIEnabledE
+__ZN7WebCore22RuntimeEnabledFeatures14sharedFeaturesEv
 __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
 __ZN7WebCore22StorageEventDispatcher34dispatchLocalStorageEventsToFramesERNS_9PageGroupERKN3WTF6VectorINS3_6RefPtrINS_5FrameEEELm0ENS3_15CrashOnOverflowEEERKNS3_6StringESE_SE_SE_PNS_14SecurityOriginE
 __ZN7WebCore22URLWithUserTypedStringEP8NSStringP5NSURL
@@ -2695,8 +2692,6 @@ __ZN7WebCore9FrameView25serviceScriptedAnimationsEd
 #endif
 
 #if ENABLE(SHADOW_DOM)
-__ZN7WebCore22RuntimeEnabledFeatures18isShadowDOMEnabledE
-__ZN7WebCore22RuntimeEnabledFeatures37isAuthorShadowDOMForAnyElementEnabledE
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ShadowRootE
 #endif
 
@@ -2764,18 +2759,6 @@ __ZN7WebCore4Page11setViewModeENS0_8ViewModeE
 __ZN7WebCore12WorkerThread17workerThreadCountEv
 #endif
 
-#if ENABLE(CSS_REGIONS)
-__ZN7WebCore22RuntimeEnabledFeatures19isCSSRegionsEnabledE
-#endif
-
-#if ENABLE(IFRAME_SEAMLESS)
-__ZN7WebCore22RuntimeEnabledFeatures25areSeamlessIFramesEnabledE
-#endif
-
-#if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
-__ZN7WebCore22RuntimeEnabledFeatures32isLegacyCSSVendorPrefixesEnabledE
-#endif
-
 #if ENABLE(ENCRYPTED_MEDIA_V2)
 __ZN7WebCore3CDM18registerCDMFactoryEPFN3WTF10PassOwnPtrINS_19CDMPrivateInterfaceEEEPS0_EPFbRKNS1_6StringEEPFbSA_SA_E
 #endif
index 89da02caee8720cf2798038de415846174152265..3d6d535d6782976707adaa96ad3de97c157b406c 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -35,6 +36,7 @@
 #include "MediaPlayer.h"
 #include "SharedWorkerRepository.h"
 #include "WebSocket.h"
+#include <wtf/NeverDestroyed.h>
 
 #if ENABLE(FILE_SYSTEM)
 #include "AsyncFileSystem.h"
 
 namespace WebCore {
 
-bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
-bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
-bool RuntimeEnabledFeatures::isWebkitNotificationsEnabled = false;
-bool RuntimeEnabledFeatures::isApplicationCacheEnabled = true;
-bool RuntimeEnabledFeatures::isDataTransferItemsEnabled = true;
-bool RuntimeEnabledFeatures::isGeolocationEnabled = true;
-bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
-bool RuntimeEnabledFeatures::isTouchEnabled = true;
-bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true;
-bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
-bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
-bool RuntimeEnabledFeatures::isCanvasPathEnabled = false;
-bool RuntimeEnabledFeatures::isCSSExclusionsEnabled = true;
-bool RuntimeEnabledFeatures::isCSSShapesEnabled = true;
-bool RuntimeEnabledFeatures::isCSSRegionsEnabled = false;
-bool RuntimeEnabledFeatures::isCSSCompositingEnabled = false;
-bool RuntimeEnabledFeatures::isLangAttributeAwareFormControlUIEnabled = false;
-
+RuntimeEnabledFeatures::RuntimeEnabledFeatures()
+    : m_isLocalStorageEnabled(true)
+    , m_isSessionStorageEnabled(true)
+    , m_isWebkitNotificationsEnabled(false)
+    , m_isApplicationCacheEnabled(true)
+    , m_isDataTransferItemsEnabled(true)
+    , m_isGeolocationEnabled(true)
+    , m_isIndexedDBEnabled(false)
+    , m_isTouchEnabled(true)
+    , m_isDeviceMotionEnabled(true)
+    , m_isDeviceOrientationEnabled(true)
+    , m_isSpeechInputEnabled(true)
+    , m_isCanvasPathEnabled(false)
+    , m_isCSSExclusionsEnabled(true)
+    , m_isCSSShapesEnabled(true)
+    , m_isCSSRegionsEnabled(false)
+    , m_isCSSCompositingEnabled(false)
+    , m_isLangAttributeAwareFormControlUIEnabled(false)
 #if ENABLE(SCRIPTED_SPEECH)
-bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false;
+    , m_isScriptedSpeechEnabled(false)
 #endif
-
 #if ENABLE(MEDIA_STREAM)
-bool RuntimeEnabledFeatures::isMediaStreamEnabled = true;
-bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true;
+    , m_isMediaStreamEnabled(true)
+    , m_isPeerConnectionEnabled(true)
 #endif
-
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
-bool RuntimeEnabledFeatures::isLegacyCSSVendorPrefixesEnabled = false;
+    , m_isLegacyCSSVendorPrefixesEnabled(false)
 #endif
-
 #if ENABLE(GAMEPAD)
-bool RuntimeEnabledFeatures::isGamepadEnabled = false;
+    , m_isGamepadEnabled(false)
 #endif
-
 #if ENABLE(FILE_SYSTEM)
-bool RuntimeEnabledFeatures::isFileSystemEnabled = false;
+    , m_isFileSystemEnabled(false)
+#endif
+#if ENABLE(JAVASCRIPT_I18N_API)
+    , m_isJavaScriptI18NAPIEnabled(false)
+#endif
+#if ENABLE(QUOTA)
+    , m_isQuotaEnabled(false)
+#endif
+#if ENABLE(FULLSCREEN_API)
+    , m_isFullScreenAPIEnabled(true)
+#endif
+#if ENABLE(MEDIA_SOURCE)
+    , m_isMediaSourceEnabled(false)
+#endif
+#if ENABLE(VIDEO_TRACK)
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(QT)
+    , m_isVideoTrackEnabled(true)
+#else
+    , m_isVideoTrackEnabled(false)
+#endif
+#endif
+#if ENABLE(ENCRYPTED_MEDIA)
+    , m_isEncryptedMediaEnabled(false)
+#endif
+#if ENABLE(SHADOW_DOM)
+    , m_isShadowDOMEnabled(false)
+    , m_isAuthorShadowDOMForAnyElementEnabled(false)
+#endif
+#if ENABLE(CUSTOM_ELEMENTS)
+    , m_isCustomDOMElementsEnabled(false)
+#endif
+#if ENABLE(STYLE_SCOPED)
+    , m_isStyleScopedEnabled(false)
+#endif
+#if ENABLE(INPUT_TYPE_DATE)
+    , m_isInputTypeDateEnabled(true)
+#endif
+#if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE)
+    , m_isInputTypeDateTimeEnabled(false)
+#endif
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+    , m_isInputTypeDateTimeLocalEnabled(true)
+#endif
+#if ENABLE(INPUT_TYPE_MONTH)
+    , m_isInputTypeMonthEnabled(true)
+#endif
+#if ENABLE(INPUT_TYPE_TIME)
+    , m_isInputTypeTimeEnabled(true)
+#endif
+#if ENABLE(INPUT_TYPE_WEEK)
+    , m_isInputTypeWeekEnabled(true)
+#endif
+#if ENABLE(CSP_NEXT)
+    , m_areExperimentalContentSecurityPolicyFeaturesEnabled(false)
+#endif
+#if ENABLE(IFRAME_SEAMLESS)
+    , m_areSeamlessIFramesEnabled(false)
+#endif
+#if ENABLE(FONT_LOAD_EVENTS)
+    , m_isFontLoadEventsEnabled(false)
+#endif
+{
+}
+
+RuntimeEnabledFeatures& RuntimeEnabledFeatures::sharedFeatures()
+{
+    static NeverDestroyed<RuntimeEnabledFeatures> runtimeEnabledFeatures;
 
+    return runtimeEnabledFeatures;
+}
+
+#if ENABLE(FILE_SYSTEM)
 bool RuntimeEnabledFeatures::fileSystemEnabled()
 {
-    return isFileSystemEnabled && AsyncFileSystem::isAvailable();
+    return m_isFileSystemEnabled && AsyncFileSystem::isAvailable();
 }
 #endif
 
 #if ENABLE(JAVASCRIPT_I18N_API)
-bool RuntimeEnabledFeatures::isJavaScriptI18NAPIEnabled = false;
-
 bool RuntimeEnabledFeatures::javaScriptI18NAPIEnabled()
 {
-    return isJavaScriptI18NAPIEnabled;
+    return m_isJavaScriptI18NAPIEnabled;
 }
 #endif
 
 #if ENABLE(VIDEO)
-
-bool RuntimeEnabledFeatures::audioEnabled()
+bool RuntimeEnabledFeatures::audioEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::htmlMediaElementEnabled()
+bool RuntimeEnabledFeatures::htmlMediaElementEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::htmlAudioElementEnabled()
+bool RuntimeEnabledFeatures::htmlAudioElementEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::htmlVideoElementEnabled()
+bool RuntimeEnabledFeatures::htmlVideoElementEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::htmlSourceElementEnabled()
+bool RuntimeEnabledFeatures::htmlSourceElementEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::mediaControllerEnabled()
+bool RuntimeEnabledFeatures::mediaControllerEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::mediaErrorEnabled()
+bool RuntimeEnabledFeatures::mediaErrorEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
 
-bool RuntimeEnabledFeatures::timeRangesEnabled()
+bool RuntimeEnabledFeatures::timeRangesEnabled() const
 {
     return MediaPlayer::isAvailable();
 }
-
 #endif
 
 #if ENABLE(SHARED_WORKERS)
-bool RuntimeEnabledFeatures::sharedWorkerEnabled()
+bool RuntimeEnabledFeatures::sharedWorkerEnabled() const
 {
     return SharedWorkerRepository::isAvailable();
 }
 #endif
 
 #if ENABLE(WEB_SOCKETS)
-bool RuntimeEnabledFeatures::webSocketEnabled()
+bool RuntimeEnabledFeatures::webSocketEnabled() const
 {
     return WebSocket::isAvailable();
 }
 #endif
 
 #if ENABLE(SQL_DATABASE)
-bool RuntimeEnabledFeatures::openDatabaseEnabled()
+bool RuntimeEnabledFeatures::openDatabaseEnabled() const
 {
     return DatabaseManager::manager().isAvailable();
 }
 
-bool RuntimeEnabledFeatures::openDatabaseSyncEnabled()
+bool RuntimeEnabledFeatures::openDatabaseSyncEnabled() const
 {
     return DatabaseManager::manager().isAvailable();
 }
 #endif
 
-#if ENABLE(QUOTA)
-bool RuntimeEnabledFeatures::isQuotaEnabled = false;
-#endif
-
-#if ENABLE(FULLSCREEN_API)
-bool RuntimeEnabledFeatures::isFullScreenAPIEnabled = true;
-#endif
-
-#if ENABLE(MEDIA_SOURCE)
-bool RuntimeEnabledFeatures::isMediaSourceEnabled = false;
-#endif
-
-#if ENABLE(VIDEO_TRACK)
-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(QT)
-    bool RuntimeEnabledFeatures::isVideoTrackEnabled = true;
-#else
-    bool RuntimeEnabledFeatures::isVideoTrackEnabled = false;
-#endif
-#endif
-
-#if ENABLE(ENCRYPTED_MEDIA)
-bool RuntimeEnabledFeatures::isEncryptedMediaEnabled = false;
-#endif
-
-#if ENABLE(SHADOW_DOM)
-bool RuntimeEnabledFeatures::isShadowDOMEnabled = false;
-
-bool RuntimeEnabledFeatures::isAuthorShadowDOMForAnyElementEnabled = false;
-#endif
-
-#if ENABLE(CUSTOM_ELEMENTS)
-bool RuntimeEnabledFeatures::isCustomDOMElementsEnabled = false;
-#endif
-
-#if ENABLE(STYLE_SCOPED)
-bool RuntimeEnabledFeatures::isStyleScopedEnabled = false;
-#endif
-
-#if ENABLE(INPUT_TYPE_DATE)
-bool RuntimeEnabledFeatures::isInputTypeDateEnabled = true;
-#endif
-
-#if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE)
-bool RuntimeEnabledFeatures::isInputTypeDateTimeEnabled = false;
-#endif
-
-#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-bool RuntimeEnabledFeatures::isInputTypeDateTimeLocalEnabled = true;
-#endif
-
-#if ENABLE(INPUT_TYPE_MONTH)
-bool RuntimeEnabledFeatures::isInputTypeMonthEnabled = true;
-#endif
-
-#if ENABLE(INPUT_TYPE_TIME)
-bool RuntimeEnabledFeatures::isInputTypeTimeEnabled = true;
-#endif
-
-#if ENABLE(INPUT_TYPE_WEEK)
-bool RuntimeEnabledFeatures::isInputTypeWeekEnabled = true;
-#endif
-
-#if ENABLE(CSP_NEXT)
-bool RuntimeEnabledFeatures::areExperimentalContentSecurityPolicyFeaturesEnabled = false;
-#endif
-
-#if ENABLE(IFRAME_SEAMLESS)
-bool RuntimeEnabledFeatures::areSeamlessIFramesEnabled = false;
-#endif
-
-#if ENABLE(FONT_LOAD_EVENTS)
-bool RuntimeEnabledFeatures::isFontLoadEventsEnabled = false;
-#endif
-
 } // namespace WebCore
index 83d9ac293383a04230a59cdcf0728c42cc5a5424..36bc42857aee1c71785f3008e4ce5d4130578d1e 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved. 
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -32,6 +33,7 @@
 #define RuntimeEnabledFeatures_h
 
 #include "PlatformExportMacros.h"
+#include <wtf/NeverDestroyed.h>
 
 namespace WebCore {
 
@@ -40,371 +42,381 @@ namespace WebCore {
 // generation to work properly.
 
 class RuntimeEnabledFeatures {
+    WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures);
 public:
-    static void setLocalStorageEnabled(bool isEnabled) { isLocalStorageEnabled = isEnabled; }
-    static bool localStorageEnabled() { return isLocalStorageEnabled; }
+    void setLocalStorageEnabled(bool isEnabled) { m_isLocalStorageEnabled = isEnabled; }
+    bool localStorageEnabled() const { return m_isLocalStorageEnabled; }
 
-    static void setSessionStorageEnabled(bool isEnabled) { isSessionStorageEnabled = isEnabled; }
-    static bool sessionStorageEnabled() { return isSessionStorageEnabled; }
+    void setSessionStorageEnabled(bool isEnabled) { m_isSessionStorageEnabled = isEnabled; }
+    bool sessionStorageEnabled() const { return m_isSessionStorageEnabled; }
 
-    static void setWebkitNotificationsEnabled(bool isEnabled) { isWebkitNotificationsEnabled = isEnabled; }
-    static bool webkitNotificationsEnabled() { return isWebkitNotificationsEnabled; }
+    void setWebkitNotificationsEnabled(bool isEnabled) { m_isWebkitNotificationsEnabled = isEnabled; }
+    bool webkitNotificationsEnabled() const { return m_isWebkitNotificationsEnabled; }
 
-    static void setApplicationCacheEnabled(bool isEnabled) { isApplicationCacheEnabled = isEnabled; }
-    static bool applicationCacheEnabled() { return isApplicationCacheEnabled; }
+    void setApplicationCacheEnabled(bool isEnabled) { m_isApplicationCacheEnabled = isEnabled; }
+    bool applicationCacheEnabled() const { return m_isApplicationCacheEnabled; }
 
-    static void setDataTransferItemsEnabled(bool isEnabled) { isDataTransferItemsEnabled = isEnabled; }
-    static bool dataTransferItemsEnabled() { return isDataTransferItemsEnabled; }
+    void setDataTransferItemsEnabled(bool isEnabled) { m_isDataTransferItemsEnabled = isEnabled; }
+    bool dataTransferItemsEnabled() const { return m_isDataTransferItemsEnabled; }
 
-    static void setGeolocationEnabled(bool isEnabled) { isGeolocationEnabled = isEnabled; }
-    static bool geolocationEnabled() { return isGeolocationEnabled; }
+    void setGeolocationEnabled(bool isEnabled) { m_isGeolocationEnabled = isEnabled; }
+    bool geolocationEnabled() const { return m_isGeolocationEnabled; }
 
-    static void setWebkitIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; }
-    static bool webkitIndexedDBEnabled() { return isIndexedDBEnabled; }
-    static bool indexedDBEnabled() { return isIndexedDBEnabled; }
+    void setWebkitIndexedDBEnabled(bool isEnabled) { m_isIndexedDBEnabled = isEnabled; }
+    bool webkitIndexedDBEnabled() const { return m_isIndexedDBEnabled; }
+    bool indexedDBEnabled() const { return m_isIndexedDBEnabled; }
 
 #if ENABLE(CANVAS_PATH)
-    static void setCanvasPathEnabled(bool isEnabled) { isCanvasPathEnabled = isEnabled; }
-    static bool canvasPathEnabled() { return isCanvasPathEnabled; }
+    void setCanvasPathEnabled(bool isEnabled) { m_isCanvasPathEnabled = isEnabled; }
+    bool canvasPathEnabled() const { return m_isCanvasPathEnabled; }
 #else
-    static void setCanvasPathEnabled(bool) { }
-    static bool canvasPathEnabled() { return false; }
+    void setCanvasPathEnabled(bool) { }
+    bool canvasPathEnabled() const { return false; }
 #endif
 
 #if ENABLE(CSS_EXCLUSIONS)
-    static void setCSSExclusionsEnabled(bool isEnabled) { isCSSExclusionsEnabled = isEnabled; }
-    static bool cssExclusionsEnabled() { return isCSSExclusionsEnabled; }
+    void setCSSExclusionsEnabled(bool isEnabled) { m_isCSSExclusionsEnabled = isEnabled; }
+    bool cssExclusionsEnabled() const { return m_isCSSExclusionsEnabled; }
 #else
-    static void setCSSExclusionsEnabled(bool) { }
-    static bool cssExclusionsEnabled() { return false; }
+    void setCSSExclusionsEnabled(bool) { }
+    bool cssExclusionsEnabled() const { return false; }
 #endif
 
 #if ENABLE(CSS_SHAPES)
-    static void setCSSShapesEnabled(bool isEnabled) { isCSSShapesEnabled = isEnabled; }
-    static bool cssShapesEnabled() { return isCSSShapesEnabled; }
+    void setCSSShapesEnabled(bool isEnabled) { m_isCSSShapesEnabled = isEnabled; }
+    bool cssShapesEnabled() const { return m_isCSSShapesEnabled; }
 #else
-    static void setCSSShapesEnabled(bool) { }
-    static bool cssShapesEnabled() { return false; }
+    void setCSSShapesEnabled(bool) { }
+    bool cssShapesEnabled() const { return false; }
 #endif
 
 #if ENABLE(CSS_REGIONS)
-    static void setCSSRegionsEnabled(bool isEnabled) { isCSSRegionsEnabled = isEnabled; }
-    static bool cssRegionsEnabled() { return isCSSRegionsEnabled; }
+    void setCSSRegionsEnabled(bool isEnabled) { m_isCSSRegionsEnabled = isEnabled; }
+    bool cssRegionsEnabled() const { return m_isCSSRegionsEnabled; }
 #else
-    static void setCSSRegionsEnabled(bool) { }
-    static bool cssRegionsEnabled() { return false; }
+    void setCSSRegionsEnabled(bool) { }
+    bool cssRegionsEnabled() const { return false; }
 #endif
 
-    static void setCSSCompositingEnabled(bool isEnabled) { isCSSCompositingEnabled = isEnabled; }
-    static bool cssCompositingEnabled() { return isCSSCompositingEnabled; }
+    void setCSSCompositingEnabled(bool isEnabled) { m_isCSSCompositingEnabled = isEnabled; }
+    bool cssCompositingEnabled() const { return m_isCSSCompositingEnabled; }
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    static void setFontLoadEventsEnabled(bool isEnabled) { isFontLoadEventsEnabled = isEnabled; }
-    static bool fontLoadEventsEnabled() { return isFontLoadEventsEnabled; }
+    void setFontLoadEventsEnabled(bool isEnabled) { m_isFontLoadEventsEnabled = isEnabled; }
+    bool fontLoadEventsEnabled() const { return m_isFontLoadEventsEnabled; }
 #else
-    static void setFontLoadEventsEnabled(bool) { }
-    static bool fontLoadEventsEnabled() { return false; }
+    void setFontLoadEventsEnabled(bool) { }
+    bool fontLoadEventsEnabled() { return false; }
 #endif
 
 #if ENABLE(FULLSCREEN_API)
     // Mozilla version
-    static bool webkitFullScreenAPIEnabled() { return isFullScreenAPIEnabled; }
-    static void setWebkitFullScreenAPIEnabled(bool isEnabled) { isFullScreenAPIEnabled = isEnabled; }
-    static bool webkitRequestFullScreenEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitIsFullScreenEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitFullScreenKeyboardInputAllowedEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitCurrentFullScreenElementEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitCancelFullScreenEnabled() { return isFullScreenAPIEnabled; }
+    bool webkitFullScreenAPIEnabled() const { return m_isFullScreenAPIEnabled; }
+    void setWebkitFullScreenAPIEnabled(bool isEnabled) { m_isFullScreenAPIEnabled = isEnabled; }
+    bool webkitRequestFullScreenEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitIsFullScreenEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitFullScreenKeyboardInputAllowedEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitCurrentFullScreenElementEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitCancelFullScreenEnabled() const { return m_isFullScreenAPIEnabled; }
 
     // W3C version
-    static bool webkitFullscreenEnabledEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitFullscreenElementEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitExitFullscreenEnabled() { return isFullScreenAPIEnabled; }
-    static bool webkitRequestFullscreenEnabled() { return isFullScreenAPIEnabled; }
+    bool webkitFullscreenEnabledEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitFullscreenElementEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitExitFullscreenEnabled() const { return m_isFullScreenAPIEnabled; }
+    bool webkitRequestFullscreenEnabled() const { return m_isFullScreenAPIEnabled; }
 #endif
 
 #if ENABLE(VIDEO)
-    static bool audioEnabled();
-    static bool htmlMediaElementEnabled();
-    static bool htmlAudioElementEnabled();
-    static bool htmlVideoElementEnabled();
-    static bool htmlSourceElementEnabled();
-    static bool mediaControllerEnabled();
-    static bool mediaErrorEnabled();
-    static bool timeRangesEnabled();
+    bool audioEnabled() const;
+    bool htmlMediaElementEnabled() const;
+    bool htmlAudioElementEnabled() const;
+    bool htmlVideoElementEnabled() const;
+    bool htmlSourceElementEnabled() const;
+    bool mediaControllerEnabled() const;
+    bool mediaErrorEnabled() const;
+    bool timeRangesEnabled() const;
 #endif
 
 #if ENABLE(SHARED_WORKERS)
-    static bool sharedWorkerEnabled();
+    bool sharedWorkerEnabled() const;
 #endif
 
 #if ENABLE(WEB_SOCKETS)
-    static bool webSocketEnabled();
+    bool webSocketEnabled() const;
 #endif
 
 #if ENABLE(SQL_DATABASE)
-    static bool openDatabaseEnabled();
-    static bool openDatabaseSyncEnabled();
+    bool openDatabaseEnabled() const;
+    bool openDatabaseSyncEnabled() const;
 #endif
 
 #if ENABLE(TOUCH_EVENTS)
-    static bool touchEnabled() { return isTouchEnabled; }
-    static void setTouchEnabled(bool isEnabled) { isTouchEnabled = isEnabled; }
+    bool touchEnabled() const { return m_isTouchEnabled; }
+    void setTouchEnabled(bool isEnabled) { m_isTouchEnabled = isEnabled; }
 #endif
 
-    static void setDeviceMotionEnabled(bool isEnabled) { isDeviceMotionEnabled = isEnabled; }
-    static bool deviceMotionEnabled() { return isDeviceMotionEnabled; }
-    static bool deviceMotionEventEnabled() { return isDeviceMotionEnabled; }
-    static bool ondevicemotionEnabled() { return isDeviceMotionEnabled; }
+    void setDeviceMotionEnabled(bool isEnabled) { m_isDeviceMotionEnabled = isEnabled; }
+    bool deviceMotionEnabled() const { return m_isDeviceMotionEnabled; }
+    bool deviceMotionEventEnabled() const { return m_isDeviceMotionEnabled; }
+    bool ondevicemotionEnabled() const { return m_isDeviceMotionEnabled; }
 
-    static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
-    static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
-    static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; }
-    static bool ondeviceorientationEnabled() { return isDeviceOrientationEnabled; }
+    void setDeviceOrientationEnabled(bool isEnabled) { m_isDeviceOrientationEnabled = isEnabled; }
+    bool deviceOrientationEnabled() const { return m_isDeviceOrientationEnabled; }
+    bool deviceOrientationEventEnabled() const { return m_isDeviceOrientationEnabled; }
+    bool ondeviceorientationEnabled() const { return m_isDeviceOrientationEnabled; }
 
-    static void setSpeechInputEnabled(bool isEnabled) { isSpeechInputEnabled = isEnabled; }
-    static bool speechInputEnabled() { return isSpeechInputEnabled; }
-    static bool webkitSpeechEnabled() { return isSpeechInputEnabled; }
-    static bool webkitGrammarEnabled() { return isSpeechInputEnabled; }
+    void setSpeechInputEnabled(bool isEnabled) { m_isSpeechInputEnabled = isEnabled; }
+    bool speechInputEnabled() const { return m_isSpeechInputEnabled; }
+    bool webkitSpeechEnabled() const { return m_isSpeechInputEnabled; }
+    bool webkitGrammarEnabled() const { return m_isSpeechInputEnabled; }
 
 #if ENABLE(SCRIPTED_SPEECH)
-    static void setScriptedSpeechEnabled(bool isEnabled) { isScriptedSpeechEnabled = isEnabled; }
-    static bool scriptedSpeechEnabled() { return isScriptedSpeechEnabled; }
-    static bool webkitSpeechRecognitionEnabled() { return isScriptedSpeechEnabled; }
-    static bool webkitSpeechRecognitionErrorEnabled() { return isScriptedSpeechEnabled; }
-    static bool webkitSpeechRecognitionEventEnabled() { return isScriptedSpeechEnabled; }
-    static bool webkitSpeechGrammarEnabled() { return isScriptedSpeechEnabled; }
-    static bool webkitSpeechGrammarListEnabled() { return isScriptedSpeechEnabled; }
+    void setScriptedSpeechEnabled(bool isEnabled) { m_isScriptedSpeechEnabled = isEnabled; }
+    bool scriptedSpeechEnabled() const { return m_isScriptedSpeechEnabled; }
+    bool webkitSpeechRecognitionEnabled() const { return m_isScriptedSpeechEnabled; }
+    bool webkitSpeechRecognitionErrorEnabled() const { return m_isScriptedSpeechEnabled; }
+    bool webkitSpeechRecognitionEventEnabled() const { return m_isScriptedSpeechEnabled; }
+    bool webkitSpeechGrammarEnabled() const { return m_isScriptedSpeechEnabled; }
+    bool webkitSpeechGrammarListEnabled() const { return m_isScriptedSpeechEnabled; }
 #endif
 
 #if ENABLE(FILE_SYSTEM)
-    static bool fileSystemEnabled();
-    static void setFileSystemEnabled(bool isEnabled) { isFileSystemEnabled = isEnabled; }
+    bool fileSystemEnabled() const;
+    void setFileSystemEnabled(bool isEnabled) { m_isFileSystemEnabled = isEnabled; }
 #endif
 
 #if ENABLE(JAVASCRIPT_I18N_API)
-    static bool javaScriptI18NAPIEnabled();
-    static void setJavaScriptI18NAPIEnabled(bool isEnabled) { isJavaScriptI18NAPIEnabled = isEnabled; }
+    bool javaScriptI18NAPIEnabled() const;
+    void setJavaScriptI18NAPIEnabled(bool isEnabled) { m_isJavaScriptI18NAPIEnabled = isEnabled; }
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-    static bool mediaStreamEnabled() { return isMediaStreamEnabled; }
-    static void setMediaStreamEnabled(bool isEnabled) { isMediaStreamEnabled = isEnabled; }
-    static bool webkitGetUserMediaEnabled() { return isMediaStreamEnabled; }
-    static bool webkitMediaStreamEnabled() { return isMediaStreamEnabled; }
+    bool mediaStreamEnabled() const { return m_isMediaStreamEnabled; }
+    void setMediaStreamEnabled(bool isEnabled) { m_isMediaStreamEnabled = isEnabled; }
+    bool webkitGetUserMediaEnabled() const { return m_isMediaStreamEnabled; }
+    bool webkitMediaStreamEnabled() const { return m_isMediaStreamEnabled; }
 
-    static bool peerConnectionEnabled() { return isMediaStreamEnabled && isPeerConnectionEnabled; }
-    static void setPeerConnectionEnabled(bool isEnabled) { isPeerConnectionEnabled = isEnabled; }
-    static bool webkitRTCPeerConnectionEnabled() { return peerConnectionEnabled(); }
+    bool peerConnectionEnabled() const { return m_isMediaStreamEnabled && m_isPeerConnectionEnabled; }
+    void setPeerConnectionEnabled(bool isEnabled) { m_isPeerConnectionEnabled = isEnabled; }
+    bool webkitRTCPeerConnectionEnabled() const { return peerConnectionEnabled(); }
 #endif
 
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
-    static void setLegacyCSSVendorPrefixesEnabled(bool isEnabled) { isLegacyCSSVendorPrefixesEnabled = isEnabled; }
-    static bool legacyCSSVendorPrefixesEnabled() { return isLegacyCSSVendorPrefixesEnabled; }
+    void setLegacyCSSVendorPrefixesEnabled(bool isEnabled) { m_isLegacyCSSVendorPrefixesEnabled = isEnabled; }
+    bool legacyCSSVendorPrefixesEnabled() const { return m_isLegacyCSSVendorPrefixesEnabled; }
 #endif
 
 #if ENABLE(GAMEPAD)
-    static void setWebkitGetGamepadsEnabled(bool isEnabled) { isGamepadEnabled = isEnabled; }
-    static bool webkitGetGamepadsEnabled() { return isGamepadEnabled; }
+    void setWebkitGetGamepadsEnabled(bool isEnabled) { m_isGamepadEnabled = isEnabled; }
+    bool webkitGetGamepadsEnabled() const { return m_isGamepadEnabled; }
 #endif
 
 #if ENABLE(QUOTA)
-    static bool quotaEnabled() { return isQuotaEnabled; }
-    static void setQuotaEnabled(bool isEnabled) { isQuotaEnabled = isEnabled; }
+    bool quotaEnabled() const { return m_isQuotaEnabled; }
+    void setQuotaEnabled(bool isEnabled) { m_isQuotaEnabled = isEnabled; }
 #endif
 
 #if ENABLE(MEDIA_SOURCE)
-    static bool mediaSourceEnabled() { return isMediaSourceEnabled; }
-    static void setMediaSourceEnabled(bool isEnabled) { isMediaSourceEnabled = isEnabled; }
+    bool mediaSourceEnabled() const { return m_isMediaSourceEnabled; }
+    void setMediaSourceEnabled(bool isEnabled) { m_isMediaSourceEnabled = isEnabled; }
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    static bool encryptedMediaEnabled() { return isEncryptedMediaEnabled; }
-    static void setEncryptedMediaEnabled(bool isEnabled) { isEncryptedMediaEnabled = isEnabled; }
+    bool encryptedMediaEnabled() const { return m_isEncryptedMediaEnabled; }
+    void setEncryptedMediaEnabled(bool isEnabled) { m_isEncryptedMediaEnabled = isEnabled; }
 #endif
 
 #if ENABLE(VIDEO_TRACK)
-    static bool webkitVideoTrackEnabled() { return isVideoTrackEnabled; }
-    static void setWebkitVideoTrackEnabled(bool isEnabled) { isVideoTrackEnabled = isEnabled; }
+    bool webkitVideoTrackEnabled() const { return m_isVideoTrackEnabled; }
+    void setWebkitVideoTrackEnabled(bool isEnabled) { m_isVideoTrackEnabled = isEnabled; }
 #endif
 
 #if ENABLE(SHADOW_DOM)
-    static bool shadowDOMEnabled() { return isShadowDOMEnabled; }
-    static void setShadowDOMEnabled(bool isEnabled) { isShadowDOMEnabled = isEnabled; }
+    bool shadowDOMEnabled() const { return m_isShadowDOMEnabled; }
+    void setShadowDOMEnabled(bool isEnabled) { m_isShadowDOMEnabled = isEnabled; }
 
-    static bool authorShadowDOMForAnyElementEnabled() { return isAuthorShadowDOMForAnyElementEnabled; }
-    static void setAuthorShadowDOMForAnyElementEnabled(bool isEnabled) { isAuthorShadowDOMForAnyElementEnabled = isEnabled; }
+    bool authorShadowDOMForAnyElementEnabled() const { return m_isAuthorShadowDOMForAnyElementEnabled; }
+    void setAuthorShadowDOMForAnyElementEnabled(bool isEnabled) { m_isAuthorShadowDOMForAnyElementEnabled = isEnabled; }
 #endif
 
 #if ENABLE(CUSTOM_ELEMENTS)
-    static bool customDOMElementsEnabled() { return isCustomDOMElementsEnabled; }
-    static void setCustomDOMElements(bool isEnabled) { isCustomDOMElementsEnabled = isEnabled; }
+    bool customDOMElementsEnabled() const { return m_isCustomDOMElementsEnabled; }
+    void setCustomDOMElements(bool isEnabled) { m_isCustomDOMElementsEnabled = isEnabled; }
 #endif
 
 #if ENABLE(STYLE_SCOPED)
-    static bool styleScopedEnabled() { return isStyleScopedEnabled; }
-    static void setStyleScopedEnabled(bool isEnabled) { isStyleScopedEnabled = isEnabled; }
+    bool styleScopedEnabled() const { return m_isStyleScopedEnabled; }
+    void setStyleScopedEnabled(bool isEnabled) { m_isStyleScopedEnabled = isEnabled; }
 #endif
 
 #if ENABLE(INPUT_TYPE_DATE)
-    static bool inputTypeDateEnabled() { return isInputTypeDateEnabled; }
-    static void setInputTypeDateEnabled(bool isEnabled) { isInputTypeDateEnabled = isEnabled; }
+    bool inputTypeDateEnabled() const { return m_isInputTypeDateEnabled; }
+    void setInputTypeDateEnabled(bool isEnabled) { m_isInputTypeDateEnabled = isEnabled; }
 #endif
 
 #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE)
-    static bool inputTypeDateTimeEnabled() { return isInputTypeDateTimeEnabled; }
-    static void setInputTypeDateTimeEnabled(bool isEnabled) { isInputTypeDateTimeEnabled = isEnabled; }
+    bool inputTypeDateTimeEnabled() const { return m_isInputTypeDateTimeEnabled; }
+    void setInputTypeDateTimeEnabled(bool isEnabled) { m_isInputTypeDateTimeEnabled = isEnabled; }
 #endif
 
 #if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-    static bool inputTypeDateTimeLocalEnabled() { return isInputTypeDateTimeLocalEnabled; }
-    static void setInputTypeDateTimeLocalEnabled(bool isEnabled) { isInputTypeDateTimeLocalEnabled = isEnabled; }
+    bool inputTypeDateTimeLocalEnabled() const { return m_isInputTypeDateTimeLocalEnabled; }
+    void setInputTypeDateTimeLocalEnabled(bool isEnabled) { m_isInputTypeDateTimeLocalEnabled = isEnabled; }
 #endif
 
 #if ENABLE(INPUT_TYPE_MONTH)
-    static bool inputTypeMonthEnabled() { return isInputTypeMonthEnabled; }
-    static void setInputTypeMonthEnabled(bool isEnabled) { isInputTypeMonthEnabled = isEnabled; }
+    bool inputTypeMonthEnabled() const { return m_isInputTypeMonthEnabled; }
+    void setInputTypeMonthEnabled(bool isEnabled) { m_isInputTypeMonthEnabled = isEnabled; }
 #endif
 
 #if ENABLE(INPUT_TYPE_TIME)
-    static bool inputTypeTimeEnabled() { return isInputTypeTimeEnabled; }
-    static void setInputTypeTimeEnabled(bool isEnabled) { isInputTypeTimeEnabled = isEnabled; }
+    bool inputTypeTimeEnabled() const { return m_isInputTypeTimeEnabled; }
+    void setInputTypeTimeEnabled(bool isEnabled) { m_isInputTypeTimeEnabled = isEnabled; }
 #endif
 
 #if ENABLE(INPUT_TYPE_WEEK)
-    static bool inputTypeWeekEnabled() { return isInputTypeWeekEnabled; }
-    static void setInputTypeWeekEnabled(bool isEnabled) { isInputTypeWeekEnabled = isEnabled; }
+    bool inputTypeWeekEnabled() const { return m_isInputTypeWeekEnabled; }
+    void setInputTypeWeekEnabled(bool isEnabled) { m_isInputTypeWeekEnabled = isEnabled; }
 #endif
 
 #if ENABLE(CSP_NEXT)
-    static bool experimentalContentSecurityPolicyFeaturesEnabled() { return areExperimentalContentSecurityPolicyFeaturesEnabled; }
-    static void setExperimentalContentSecurityPolicyFeaturesEnabled(bool isEnabled) { areExperimentalContentSecurityPolicyFeaturesEnabled = isEnabled; }
+    bool experimentalContentSecurityPolicyFeaturesEnabled() const { return m_areExperimentalContentSecurityPolicyFeaturesEnabled; }
+    void setExperimentalContentSecurityPolicyFeaturesEnabled(bool isEnabled) { m_areExperimentalContentSecurityPolicyFeaturesEnabled = isEnabled; }
 #endif
 
 #if ENABLE(IFRAME_SEAMLESS)
-    static bool seamlessIFramesEnabled() { return areSeamlessIFramesEnabled; }
-    static void setSeamlessIFramesEnabled(bool isEnabled) { areSeamlessIFramesEnabled = isEnabled; }
+    bool seamlessIFramesEnabled() const { return m_areSeamlessIFramesEnabled; }
+    void setSeamlessIFramesEnabled(bool isEnabled) { m_areSeamlessIFramesEnabled = isEnabled; }
 #endif
 
-    static bool langAttributeAwareFormControlUIEnabled() { return isLangAttributeAwareFormControlUIEnabled; }
+    bool langAttributeAwareFormControlUIEnabled() const { return m_isLangAttributeAwareFormControlUIEnabled; }
     // The lang attribute support is incomplete and should only be turned on for tests.
-    static void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { isLangAttributeAwareFormControlUIEnabled = isEnabled; }
+    void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { m_isLangAttributeAwareFormControlUIEnabled = isEnabled; }
+
+    static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
     // Never instantiate.
-    RuntimeEnabledFeatures() { }
-
-    static bool isLocalStorageEnabled;
-    static bool isSessionStorageEnabled;
-    static bool isWebkitNotificationsEnabled;
-    static bool isApplicationCacheEnabled;
-    static bool isDataTransferItemsEnabled;
-    static bool isGeolocationEnabled;
-    static bool isIndexedDBEnabled;
-    static bool isTouchEnabled;
-    static bool isDeviceMotionEnabled;
-    static bool isDeviceOrientationEnabled;
-    static bool isSpeechInputEnabled;
-    static bool isCanvasPathEnabled;
-    static bool isCSSExclusionsEnabled;
-    static bool isCSSShapesEnabled;
-    static bool isCSSRegionsEnabled;
-    static bool isCSSCompositingEnabled;
-    WEBCORE_TESTING static bool isLangAttributeAwareFormControlUIEnabled;
+    RuntimeEnabledFeatures();
+
+    bool m_isLocalStorageEnabled;
+    bool m_isSessionStorageEnabled;
+    bool m_isWebkitNotificationsEnabled;
+    bool m_isApplicationCacheEnabled;
+    bool m_isDataTransferItemsEnabled;
+    bool m_isGeolocationEnabled;
+    bool m_isIndexedDBEnabled;
+    bool m_isTouchEnabled;
+    bool m_isDeviceMotionEnabled;
+    bool m_isDeviceOrientationEnabled;
+    bool m_isSpeechInputEnabled;
+    bool m_isCanvasPathEnabled;
+    bool m_isCSSExclusionsEnabled;
+    bool m_isCSSShapesEnabled;
+    bool m_isCSSRegionsEnabled;
+    bool m_isCSSCompositingEnabled;
+    bool m_isLangAttributeAwareFormControlUIEnabled;
 #if ENABLE(SCRIPTED_SPEECH)
-    static bool isScriptedSpeechEnabled;
+    bool m_isScriptedSpeechEnabled;
 #endif
 #if ENABLE(FILE_SYSTEM)
-    static bool isFileSystemEnabled;
+    bool m_isFileSystemEnabled;
 #endif
 
 #if ENABLE(JAVASCRIPT_I18N_API)
-    static bool isJavaScriptI18NAPIEnabled;
+    bool m_isJavaScriptI18NAPIEnabled;
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-    static bool isMediaStreamEnabled;
-    static bool isPeerConnectionEnabled;
+    bool m_isMediaStreamEnabled;
+    bool m_isPeerConnectionEnabled;
 #endif
 
 #if ENABLE(GAMEPAD)
-    static bool isGamepadEnabled;
+    bool m_isGamepadEnabled;
 #endif
 
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
-    static bool isLegacyCSSVendorPrefixesEnabled;
+    bool m_isLegacyCSSVendorPrefixesEnabled;
 #endif
 
 #if ENABLE(QUOTA)
-    static bool isQuotaEnabled;
+    bool m_isQuotaEnabled;
 #endif
 
 #if ENABLE(FULLSCREEN_API)
-    static bool isFullScreenAPIEnabled;
+    bool m_isFullScreenAPIEnabled;
 #endif
 
 #if ENABLE(MEDIA_SOURCE)
-    static bool isMediaSourceEnabled;
+    bool m_isMediaSourceEnabled;
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    static bool isEncryptedMediaEnabled;
+    bool m_isEncryptedMediaEnabled;
 #endif
 
 #if ENABLE(VIDEO_TRACK)
-    static bool isVideoTrackEnabled;
+    bool m_isVideoTrackEnabled;
 #endif
 
 #if ENABLE(SHADOW_DOM)
-    static bool isShadowDOMEnabled;
-
-    static bool isAuthorShadowDOMForAnyElementEnabled;
+    bool m_isShadowDOMEnabled;
+    bool m_isAuthorShadowDOMForAnyElementEnabled;
 #endif
 
 #if ENABLE(CUSTOM_ELEMENTS)
-    static bool isCustomDOMElementsEnabled;
+    bool m_isCustomDOMElementsEnabled;
 #endif
 
 #if ENABLE(STYLE_SCOPED)
-    static bool isStyleScopedEnabled;
+    bool m_isStyleScopedEnabled;
 #endif
 
 #if ENABLE(INPUT_TYPE_DATE)
-    static bool isInputTypeDateEnabled;
+    bool m_isInputTypeDateEnabled;
 #endif
 
 #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE)
-    static bool isInputTypeDateTimeEnabled;
+    bool m_isInputTypeDateTimeEnabled;
 #endif
 
 #if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-    static bool isInputTypeDateTimeLocalEnabled;
+    bool m_isInputTypeDateTimeLocalEnabled;
 #endif
 
 #if ENABLE(INPUT_TYPE_MONTH)
-    static bool isInputTypeMonthEnabled;
+    bool m_isInputTypeMonthEnabled;
 #endif
 
 #if ENABLE(INPUT_TYPE_TIME)
-    static bool isInputTypeTimeEnabled;
+    bool m_isInputTypeTimeEnabled;
 #endif
 
 #if ENABLE(INPUT_TYPE_WEEK)
-    static bool isInputTypeWeekEnabled;
+    bool m_isInputTypeWeekEnabled;
 #endif
 
 #if ENABLE(CSP_NEXT)
-    static bool areExperimentalContentSecurityPolicyFeaturesEnabled;
+    bool m_areExperimentalContentSecurityPolicyFeaturesEnabled;
 #endif
 
 #if ENABLE(IFRAME_SEAMLESS)
-    static bool areSeamlessIFramesEnabled;
+    bool m_areSeamlessIFramesEnabled;
 #endif
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    static bool isFontLoadEventsEnabled;
+    bool m_isFontLoadEventsEnabled;
 #endif
 
+#ifndef CLASS_IF_GCC
+#if COMPILER(GCC)
+#define CLASS_IF_GCC class
+#else
+#define CLASS_IF_GCC
+#endif
+#endif
+    friend CLASS_IF_GCC NeverDestroyed<RuntimeEnabledFeatures>;
 };
 
 } // namespace WebCore
index 7e33c23c39fccfd38cec43cef3a294cdba0ec4c0..3ad5a410f7fd14a983e703355376d7f5c05bb740 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -120,7 +120,7 @@ static PropertyNamePrefix getCSSPropertyNamePrefix(const StringImpl& propertyNam
     switch (firstChar) {
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
     case 'a':
-        if (RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled() && matchesCSSPropertyNamePrefix(propertyName, "apple"))
+        if (RuntimeEnabledFeatures::sharedFeatures().legacyCSSVendorPrefixesEnabled() && matchesCSSPropertyNamePrefix(propertyName, "apple"))
             return PropertyNamePrefixApple;
         break;
 #endif
@@ -130,7 +130,7 @@ static PropertyNamePrefix getCSSPropertyNamePrefix(const StringImpl& propertyNam
         break;
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
     case 'k':
-        if (RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled() && matchesCSSPropertyNamePrefix(propertyName, "khtml"))
+        if (RuntimeEnabledFeatures::sharedFeatures().legacyCSSVendorPrefixesEnabled() && matchesCSSPropertyNamePrefix(propertyName, "khtml"))
             return PropertyNamePrefixKHTML;
         break;
 #endif
@@ -223,7 +223,7 @@ static CSSPropertyInfo cssPropertyIDForJSCSSPropertyName(PropertyName propertyNa
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
     case PropertyNamePrefixApple:
     case PropertyNamePrefixKHTML:
-        ASSERT(RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled());
+        ASSERT(RuntimeEnabledFeatures::sharedFeatures().legacyCSSVendorPrefixesEnabled());
         writeWebKitPrefix(bufferPtr);
         i += 5;
         break;
index e3554d91abd031ed9be3457bea63f5ec08fe9a32..0b25a14b80946676401229dd2a07e581da427876 100644 (file)
@@ -3,7 +3,7 @@
 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
 # Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
@@ -1444,11 +1444,11 @@ sub GetRuntimeEnableFunctionName
 {
     my $signature = shift;
 
-    # If a parameter is given (e.g. "EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::{FeatureName}Enabled() method.
-    return "RuntimeEnabledFeatures::" . ToMethodName($signature->extendedAttributes->{"EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"EnabledAtRuntime"} && $signature->extendedAttributes->{"EnabledAtRuntime"} ne "VALUE_IS_MISSING");
+    # If a parameter is given (e.g. "EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::sharedFeatures().{FeatureName}Enabled() method.
+    return "RuntimeEnabledFeatures::sharedFeatures()." . ToMethodName($signature->extendedAttributes->{"EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"EnabledAtRuntime"} && $signature->extendedAttributes->{"EnabledAtRuntime"} ne "VALUE_IS_MISSING");
 
-    # Otherwise return a function named RuntimeEnabledFeatures::{methodName}Enabled().
-    return "RuntimeEnabledFeatures::" . ToMethodName($signature->name) . "Enabled";
+    # Otherwise return a function named RuntimeEnabledFeatures::sharedFeatures().{methodName}Enabled().
+    return "RuntimeEnabledFeatures::sharedFeatures()." . ToMethodName($signature->name) . "Enabled";
 }
 
 sub GenerateImplementation
index 99ac412eddd0ceaaf42008552493c02a5b050328..57ec1d781633f76625e5eba62b6461f611bc2ecf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2011, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -90,7 +90,7 @@ void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
     fontSelector->fontLoaded();
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    if (RuntimeEnabledFeatures::fontLoadEventsEnabled() && m_loadState == Loading) {
+    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading) {
         if (source->ensureFontData())
             notifyFontLoader(Loaded);
         else if (!isValid())
@@ -103,7 +103,7 @@ void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
         (*it)->fontLoaded(this);
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    if (RuntimeEnabledFeatures::fontLoadEventsEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
         notifyLoadingDone();
 #endif
 }
@@ -118,7 +118,7 @@ PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD
     CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    if (RuntimeEnabledFeatures::fontLoadEventsEnabled() && m_loadState == NotLoaded)
+    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == NotLoaded)
         notifyFontLoader(Loading);
 #endif
 
@@ -127,7 +127,7 @@ PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD
         if (RefPtr<SimpleFontData> result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector)) {
             m_activeSource = m_sources[i].get();
 #if ENABLE(FONT_LOAD_EVENTS)
-            if (RuntimeEnabledFeatures::fontLoadEventsEnabled() && m_loadState == Loading && m_sources[i]->isLoaded()) {
+            if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading && m_sources[i]->isLoaded()) {
                 notifyFontLoader(Loaded);
                 notifyLoadingDone();
             }
@@ -137,7 +137,7 @@ PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD
     }
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    if (RuntimeEnabledFeatures::fontLoadEventsEnabled() && m_loadState == Loading) {
+    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading) {
         notifyFontLoader(Error);
         notifyLoadingDone();
     }
index f231ad8626a1f2111aa65e5e92b3399b8dc6d9a8..82cc50711c7a80a3ce434089bf3e1610a6c07f00 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2011, 2013 Apple Inc. All rights reserved.
  *           (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
  *
  * Redistribution and use in source and binary forms, with or without
@@ -235,7 +235,7 @@ void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule)
             RefPtr<CSSFontFaceRule> rule;
 #if ENABLE(FONT_LOAD_EVENTS)
             // FIXME: https://bugs.webkit.org/show_bug.cgi?id=112116 - This CSSFontFaceRule has no parent.
-            if (RuntimeEnabledFeatures::fontLoadEventsEnabled())
+            if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
                 rule = static_pointer_cast<CSSFontFaceRule>(fontFaceRule->createCSSOMWrapper());
 #endif
             fontFace = CSSFontFace::create(static_cast<FontTraitsMask>(traitsMask), rule);
index 444ed83cdf6ad68825532d85465afe2368cefd70..7268ee0ed469b5aedacfc69149f4260d387ed515 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
  * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
  * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
@@ -586,7 +586,7 @@ static inline bool isSimpleLengthPropertyID(CSSPropertyID propertyId, bool& acce
     case CSSPropertyWebkitShapeMargin:
     case CSSPropertyWebkitShapePadding:
         acceptsNegativeNumbers = false;
-        return RuntimeEnabledFeatures::cssShapesEnabled();
+        return RuntimeEnabledFeatures::sharedFeatures().cssShapesEnabled();
 #endif
     case CSSPropertyBottom:
     case CSSPropertyLeft:
@@ -1031,13 +1031,13 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
         break;
 #if ENABLE(CSS_EXCLUSIONS)
     case CSSPropertyWebkitWrapFlow:
-        if (!RuntimeEnabledFeatures::cssExclusionsEnabled())
+        if (!RuntimeEnabledFeatures::sharedFeatures().cssExclusionsEnabled())
             return false;
         if (valueID == CSSValueAuto || valueID == CSSValueBoth || valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueMaximum || valueID == CSSValueClear)
             return true;
         break;
     case CSSPropertyWebkitWrapThrough:
-        if (!RuntimeEnabledFeatures::cssExclusionsEnabled())
+        if (!RuntimeEnabledFeatures::sharedFeatures().cssExclusionsEnabled())
             return false;
         if (valueID == CSSValueWrap || valueID == CSSValueNone)
             return true;
@@ -3011,7 +3011,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
 #if ENABLE(CSS_SHAPES)
     case CSSPropertyWebkitShapeInside:
     case CSSPropertyWebkitShapeOutside:
-        if (!RuntimeEnabledFeatures::cssShapesEnabled())
+        if (!RuntimeEnabledFeatures::sharedFeatures().cssShapesEnabled())
             return false;
         if (id == CSSValueAuto)
             validPrimitive = true;
@@ -3026,7 +3026,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
         break;
     case CSSPropertyWebkitShapeMargin:
     case CSSPropertyWebkitShapePadding:
-        validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && validUnit(value, FLength | FNonNeg));
+        validPrimitive = (RuntimeEnabledFeatures::sharedFeatures().cssShapesEnabled() && !id && validUnit(value, FLength | FNonNeg));
         break;
 #endif
 #if ENABLE(CSS_IMAGE_ORIENTATION)
@@ -12199,7 +12199,7 @@ static CSSPropertyID cssPropertyID(const CharacterType* propertyName, unsigned l
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
         // If the prefix is -apple- or -khtml-, change it to -webkit-.
         // This makes the string one character longer.
-        if (RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled()
+        if (RuntimeEnabledFeatures::sharedFeatures().legacyCSSVendorPrefixesEnabled()
             && (hasPrefix(buffer, length, "-apple-") || hasPrefix(buffer, length, "-khtml-"))) {
             memmove(buffer + 7, buffer + 6, length + 1 - 6);
             memcpy(buffer, "-webkit", 7);
index f8482f0bc71e19bf2bca00c508c85bd4da346fc5..3fa82d3be27a08671658ac05213ce4ba68c06580 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -75,7 +75,7 @@ void CSSSegmentedFontFace::fontLoaded(CSSFontFace*)
     pruneTable();
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    if (RuntimeEnabledFeatures::fontLoadEventsEnabled() && !isLoading()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && !isLoading()) {
         Vector<RefPtr<LoadFontCallback> > callbacks;
         m_callbacks.swap(callbacks);
         for (size_t index = 0; index < callbacks.size(); ++index) {
index e48896371cb972e13220138dcf9cc9ab1f660033..9fe49f67af1fd5f188482f86a2945aa33f76236f 100644 (file)
@@ -209,12 +209,12 @@ public:
     {
 #if ENABLE(STYLE_SCOPED)
 #if ENABLE(SHADOW_DOM)
-        ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || RuntimeEnabledFeatures::styleScopedEnabled());
+        ASSERT(RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled() || RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled());
 #else
-        ASSERT(RuntimeEnabledFeatures::styleScopedEnabled());
+        ASSERT(RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled());
 #endif
 #else
-        ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled());
+        ASSERT(RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled());
 #endif
         if (!m_scopeResolver)
             m_scopeResolver = adoptPtr(new StyleScopeResolver());
index 801209d899853aa894f3f75c43e8d6a646ca664b..1a1d6c92167ca65b6a9cd9354d0d530270d9ab28 100644 (file)
@@ -1145,12 +1145,12 @@ bool Document::cssStickyPositionEnabled() const
 
 bool Document::cssRegionsEnabled() const
 {
-    return RuntimeEnabledFeatures::cssRegionsEnabled(); 
+    return RuntimeEnabledFeatures::sharedFeatures().cssRegionsEnabled(); 
 }
 
 bool Document::cssCompositingEnabled() const
 {
-    return RuntimeEnabledFeatures::cssCompositingEnabled();
+    return RuntimeEnabledFeatures::sharedFeatures().cssCompositingEnabled();
 }
 
 bool Document::cssGridLayoutEnabled() const
@@ -5696,7 +5696,7 @@ HTMLIFrameElement* Document::seamlessParentIFrame() const
 bool Document::shouldDisplaySeamlesslyWithParent() const
 {
 #if ENABLE(IFRAME_SEAMLESS)
-    if (!RuntimeEnabledFeatures::seamlessIFramesEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().seamlessIFramesEnabled())
         return false;
     HTMLFrameOwnerElement* ownerElement = this->ownerElement();
     if (!ownerElement)
@@ -5974,7 +5974,7 @@ bool Document::haveStylesheetsLoaded() const
 Locale& Document::getCachedLocale(const AtomicString& locale)
 {
     AtomicString localeKey = locale;
-    if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled())
+    if (locale.isEmpty() || !RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
         localeKey = defaultLanguage();
     LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey, nullptr);
     if (result.isNewEntry)
index 82c78659bb9f946c852ca3399f6ef65c65765e6c..36610b465bab42249ac4965a90a9b861a1e4e2bd 100644 (file)
@@ -1487,7 +1487,7 @@ PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionCode& ec)
         ensureUserAgentShadowRoot();
 
 #if ENABLE(SHADOW_DOM)
-    if (RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().authorShadowDOMForAnyElementEnabled()) {
         addShadowRoot(ShadowRoot::create(document(), ShadowRoot::AuthorShadowRoot));
         return shadowRoot();
     }
index b24e4a740b2dea5d980a8a1baf429597cc5d5f03..18402f096d49f5f1ade43e5bcaa98d977809c024 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -97,7 +97,7 @@ Position::Position(PassRefPtr<Node> anchorNode, LegacyEditingOffset offset)
     , m_isLegacyEditingPosition(true)
 {
 #if ENABLE(SHADOW_DOM)
-    ASSERT((m_anchorNode && RuntimeEnabledFeatures::shadowDOMEnabled()) || !m_anchorNode || !m_anchorNode->isShadowRoot() || m_anchorNode == containerNode());
+    ASSERT((m_anchorNode && RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled()) || !m_anchorNode || !m_anchorNode->isShadowRoot() || m_anchorNode == containerNode());
 #else
     ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot() || m_anchorNode == containerNode());
 #endif
@@ -111,7 +111,7 @@ Position::Position(PassRefPtr<Node> anchorNode, AnchorType anchorType)
     , m_isLegacyEditingPosition(false)
 {
 #if ENABLE(SHADOW_DOM)
-    ASSERT((m_anchorNode && RuntimeEnabledFeatures::shadowDOMEnabled()) || !m_anchorNode || !m_anchorNode->isShadowRoot() || m_anchorNode == containerNode());
+    ASSERT((m_anchorNode && RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled()) || !m_anchorNode || !m_anchorNode->isShadowRoot() || m_anchorNode == containerNode());
 #else
     ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot() || m_anchorNode == containerNode());
 #endif
@@ -130,7 +130,7 @@ Position::Position(PassRefPtr<Node> anchorNode, int offset, AnchorType anchorTyp
     , m_isLegacyEditingPosition(false)
 {
 #if ENABLE(SHADOW_DOM)
-    ASSERT((m_anchorNode && RuntimeEnabledFeatures::shadowDOMEnabled())
+    ASSERT((m_anchorNode && RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled())
            || !m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot());
 #else
     ASSERT(!m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot());
@@ -875,7 +875,7 @@ ContainerNode* Position::findParent(const Node* node)
     // FIXME: See http://web.ug/82697
 
 #if ENABLE(SHADOW_DOM)
-    if (RuntimeEnabledFeatures::shadowDOMEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled())
         return node->parentNode();
 #endif
 
index 550a347f180755bf2166c483f67712e60cda0ab9..e1e1b0e6a90f510c2173a134545428b3baa85a45 100644 (file)
@@ -322,7 +322,7 @@ DOMSelection* TreeScope::getSelection() const
     // as a container. It is now enabled only if runtime Shadow DOM feature is enabled.
     // See https://bugs.webkit.org/show_bug.cgi?id=82697
 #if ENABLE(SHADOW_DOM)
-    if (RuntimeEnabledFeatures::shadowDOMEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled()) {
         m_selection = DOMSelection::create(this);
         return m_selection.get();
     }
index 98345136956802ab413e6b57971b9763f0276487..15350b2cdee8632c1762476c26edcb961b1f6634 100755 (executable)
@@ -410,7 +410,7 @@ END
     my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional};
     if ($runtimeConditional) {
         print F <<END
-    if (!RuntimeEnabledFeatures::${runtimeConditional}Enabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().${runtimeConditional}Enabled())
         return 0;
 END
 ;
@@ -1096,7 +1096,7 @@ END
             print F <<END
 static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
 {
-    if (!RuntimeEnabledFeatures::${runtimeConditional}Enabled()) {
+    if (!RuntimeEnabledFeatures::sharedFeatures().${runtimeConditional}Enabled()) {
         ASSERT(!element || element->is$parameters{fallbackInterfaceName}());
         return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{fallbackJSInterfaceName}, element.get());
     }
index f67674364081465faec002898bcb8cdfadcf8e35..54d91f03afe4e93747cd1072a8a37ac4edb9c6d0 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2001 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Apple Inc. All rights reserved.
  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
  * Copyright (C) 2010 Google Inc. All rights reserved.
@@ -1646,7 +1646,7 @@ bool HTMLInputElement::isSteppable() const
 bool HTMLInputElement::isSpeechEnabled() const
 {
     // FIXME: Add support for RANGE, EMAIL, URL, COLOR and DATE/TIME input types.
-    return m_inputType->shouldRespectSpeechAttribute() && RuntimeEnabledFeatures::speechInputEnabled() && hasAttribute(webkitspeechAttr);
+    return m_inputType->shouldRespectSpeechAttribute() && RuntimeEnabledFeatures::sharedFeatures().speechInputEnabled() && hasAttribute(webkitspeechAttr);
 }
 
 #endif
@@ -1950,7 +1950,7 @@ bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters&
     parameters.minimum = minimum();
     parameters.maximum = maximum();
     parameters.required = isRequired();
-    if (!RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
         parameters.locale = defaultLanguage();
     else {
         AtomicString computedLocale = computeInheritedLanguage();
index f48799603aceef9d34c6d65dd26223bffca83b3c..b59a29e4efe47be941698cf3a5cf9d4d0cbeeb07 100644 (file)
@@ -535,7 +535,7 @@ void HTMLMediaElement::finishParsingChildren()
 #endif
     
 #if ENABLE(VIDEO_TRACK)
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     auto trackDescendants = descendantsOfType<HTMLTrackElement>(this);
@@ -669,7 +669,7 @@ void HTMLMediaElement::scheduleDelayedAction(DelayedActionType actionType)
     }
 
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled() && (actionType & ConfigureTextTracks))
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled() && (actionType & ConfigureTextTracks))
         setFlags(m_pendingActionFlags, ConfigureTextTracks);
 #endif
 
@@ -706,7 +706,7 @@ void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*)
     Ref<HTMLMediaElement> protect(*this); // loadNextSourceChild may fire 'beforeload', which can make arbitrary DOM mutations.
 
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled() && (m_pendingActionFlags & ConfigureTextTracks))
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled() && (m_pendingActionFlags & ConfigureTextTracks))
         configureTextTracks();
 #endif
 
@@ -718,7 +718,7 @@ void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*)
     }
 
 #if USE(PLATFORM_TEXT_TRACK_MENU)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled() && (m_pendingActionFlags & TextTrackChangesNotification))
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled() && (m_pendingActionFlags & TextTrackChangesNotification))
         notifyMediaPlayerOfTextTrackChanges();
 #endif
 
@@ -833,7 +833,7 @@ void HTMLMediaElement::prepareForLoad()
         scheduleEvent(eventNames().emptiedEvent);
         updateMediaController();
 #if ENABLE(VIDEO_TRACK)
-        if (RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+        if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
             updateActiveTextTrackCues(0);
 #endif
     }
@@ -898,7 +898,7 @@ void HTMLMediaElement::loadInternal()
 
     // HTMLMediaElement::textTracksAreReady will need "... the text tracks whose mode was not in the
     // disabled state when the element's resource selection algorithm last started".
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled()) {
         m_textTracksWhenResourceSelectionBegan.clear();
         if (m_textTracks) {
             for (unsigned i = 0; i < m_textTracks->length(); ++i) {
@@ -1822,7 +1822,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
     ReadyState newState = static_cast<ReadyState>(state);
 
 #if ENABLE(VIDEO_TRACK)
-    bool tracksAreReady = !RuntimeEnabledFeatures::webkitVideoTrackEnabled() || textTracksAreReady();
+    bool tracksAreReady = !RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled() || textTracksAreReady();
 
     if (newState == oldState && m_tracksAreReady == tracksAreReady)
         return;
@@ -1927,7 +1927,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
     updatePlayState();
     updateMediaController();
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         updateActiveTextTrackCues(currentTime());
 #endif
 }
@@ -2810,7 +2810,7 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
         mediaControls()->playbackProgressed();
 
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         updateActiveTextTrackCues(currentTime());
 #endif
 }
@@ -2862,7 +2862,7 @@ double HTMLMediaElement::percentLoaded() const
 
 void HTMLMediaElement::mediaPlayerDidAddAudioTrack(PassRefPtr<AudioTrackPrivate> prpTrack)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     addAudioTrack(AudioTrack::create(this, prpTrack));
@@ -2870,7 +2870,7 @@ void HTMLMediaElement::mediaPlayerDidAddAudioTrack(PassRefPtr<AudioTrackPrivate>
 
 void HTMLMediaElement::mediaPlayerDidAddTextTrack(PassRefPtr<InbandTextTrackPrivate> prpTrack)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
     
     // 4.8.10.12.2 Sourcing in-band text tracks
@@ -2905,7 +2905,7 @@ void HTMLMediaElement::mediaPlayerDidAddTextTrack(PassRefPtr<InbandTextTrackPriv
 
 void HTMLMediaElement::mediaPlayerDidAddVideoTrack(PassRefPtr<VideoTrackPrivate> prpTrack)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     addVideoTrack(VideoTrack::create(this, prpTrack));
@@ -3010,7 +3010,7 @@ void HTMLMediaElement::closeCaptionTracksChanged()
 
 void HTMLMediaElement::addAudioTrack(PassRefPtr<AudioTrack> track)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     audioTracks()->append(track);
@@ -3018,7 +3018,7 @@ void HTMLMediaElement::addAudioTrack(PassRefPtr<AudioTrack> track)
 
 void HTMLMediaElement::addTextTrack(PassRefPtr<TextTrack> track)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     textTracks()->append(track);
@@ -3028,7 +3028,7 @@ void HTMLMediaElement::addTextTrack(PassRefPtr<TextTrack> track)
 
 void HTMLMediaElement::addVideoTrack(PassRefPtr<VideoTrack> track)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     videoTracks()->append(track);
@@ -3036,7 +3036,7 @@ void HTMLMediaElement::addVideoTrack(PassRefPtr<VideoTrack> track)
 
 void HTMLMediaElement::removeAudioTrack(AudioTrack* track)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     m_audioTracks->remove(track);
@@ -3044,7 +3044,7 @@ void HTMLMediaElement::removeAudioTrack(AudioTrack* track)
 
 void HTMLMediaElement::removeTextTrack(TextTrack* track)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     TrackDisplayUpdateScope scope(this);
@@ -3059,7 +3059,7 @@ void HTMLMediaElement::removeTextTrack(TextTrack* track)
 
 void HTMLMediaElement::removeVideoTrack(VideoTrack* track)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     m_videoTracks->remove(track);
@@ -3086,7 +3086,7 @@ void HTMLMediaElement::removeAllInbandTracks()
 
 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const String& label, const String& language, ExceptionCode& ec)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return 0;
 
     // 4.8.10.12.4 Text track API
@@ -3123,7 +3123,7 @@ PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const S
 
 AudioTrackList* HTMLMediaElement::audioTracks()
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return 0;
 
     if (!m_audioTracks)
@@ -3134,7 +3134,7 @@ AudioTrackList* HTMLMediaElement::audioTracks()
 
 TextTrackList* HTMLMediaElement::textTracks() 
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return 0;
 
     if (!m_textTracks)
@@ -3145,7 +3145,7 @@ TextTrackList* HTMLMediaElement::textTracks()
 
 VideoTrackList* HTMLMediaElement::videoTracks()
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return 0;
 
     if (!m_videoTracks)
@@ -3158,7 +3158,7 @@ void HTMLMediaElement::didAddTextTrack(HTMLTrackElement* trackElement)
 {
     ASSERT(trackElement->hasTagName(trackTag));
 
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     // 4.8.10.12.3 Sourcing out-of-band text tracks
@@ -3184,7 +3184,7 @@ void HTMLMediaElement::didRemoveTextTrack(HTMLTrackElement* trackElement)
 {
     ASSERT(trackElement->hasTagName(trackTag));
 
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
 #if !LOG_DISABLED
@@ -3626,7 +3626,7 @@ void HTMLMediaElement::mediaPlayerTimeChanged(MediaPlayer*)
     LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged");
 
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         updateActiveTextTrackCues(currentTime());
 #endif
 
@@ -4115,7 +4115,7 @@ void HTMLMediaElement::userCancelledLoad()
     m_readyState = HAVE_NOTHING;
     updateMediaController();
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         updateActiveTextTrackCues(0);
 #endif
 }
@@ -4481,7 +4481,7 @@ bool HTMLMediaElement::hasClosedCaptions() const
         return true;
 
 #if ENABLE(VIDEO_TRACK)
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled() || !m_textTracks)
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled() || !m_textTracks)
         return false;
 
     for (unsigned i = 0; i < m_textTracks->length(); ++i) {
@@ -4525,7 +4525,7 @@ void HTMLMediaElement::setClosedCaptionsVisible(bool closedCaptionVisible)
     m_player->setClosedCaptionsVisible(closedCaptionVisible);
 
 #if ENABLE(VIDEO_TRACK)
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled()) {
         markCaptionAndSubtitleTracksAsUnconfigured(Immediately);
         updateTextTrackDisplay();
     }
@@ -4725,7 +4725,7 @@ void HTMLMediaElement::configureTextTrackDisplay(TextTrackVisibilityCheckType ch
 
     mediaControls()->changedClosedCaptionsVisibility();
     
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled()) {
         updateTextTrackDisplay();
         updateActiveTextTrackCues(currentTime());
     }
index 6b487198a2ff19389067aae1c03ee1cf42b6206e..18284c8fa708eaf63df6c932488c924015dd6bf6 100644 (file)
@@ -76,7 +76,7 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
     if (name == titleAttr && sheet())
         sheet()->setTitle(value);
 #if ENABLE(STYLE_SCOPED)
-    else if (name == scopedAttr && RuntimeEnabledFeatures::styleScopedEnabled())
+    else if (name == scopedAttr && RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled())
         scopedAttributeChanged(!value.isNull());
 #endif
     else if (name == mediaAttr) {
@@ -101,7 +101,7 @@ void HTMLStyleElement::finishParsingChildren()
 #if ENABLE(STYLE_SCOPED)
 void HTMLStyleElement::scopedAttributeChanged(bool scoped)
 {
-    ASSERT(RuntimeEnabledFeatures::styleScopedEnabled());
+    ASSERT(RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled());
 
     if (!inDocument())
         return;
@@ -159,7 +159,7 @@ void HTMLStyleElement::registerWithScopingNode(bool scoped)
 
 void HTMLStyleElement::unregisterWithScopingNode(ContainerNode* scope)
 {
-    ASSERT(m_scopedStyleRegistrationState != NotRegistered || !RuntimeEnabledFeatures::styleScopedEnabled());
+    ASSERT(m_scopedStyleRegistrationState != NotRegistered || !RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled());
     if (!isRegisteredAsScoped())
         return;
 
@@ -177,7 +177,7 @@ void HTMLStyleElement::unregisterWithScopingNode(ContainerNode* scope)
 
 bool HTMLStyleElement::scoped() const
 {
-    return RuntimeEnabledFeatures::styleScopedEnabled() && fastHasAttribute(scopedAttr);
+    return RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled() && fastHasAttribute(scopedAttr);
 }
 
 void HTMLStyleElement::setScoped(bool scopedValue)
index 4a15ffce8ad401105241d9f8ad66ae00f251b144..857e20f2730e377cb395ea8373e8fac117f50693 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -93,7 +93,7 @@ void HTMLTrackElement::removedFrom(ContainerNode* insertionPoint)
 
 void HTMLTrackElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
-    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled()) {
         if (name == srcAttr) {
             if (!value.isEmpty())
                 scheduleLoad();
@@ -196,7 +196,7 @@ void HTMLTrackElement::scheduleLoad()
     if (m_loadTimer.isActive())
         return;
 
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return;
 
     // 2. If the text track's text track mode is not set to one of hidden or showing, abort these steps.
@@ -234,7 +234,7 @@ void HTMLTrackElement::loadTimerFired(Timer<HTMLTrackElement>*)
 
 bool HTMLTrackElement::canLoadUrl(const KURL& url)
 {
-    if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
         return false;
 
     HTMLMediaElement* parent = mediaElement();
index 7a829d5667aec7834f4557aadef2c2c1705b49ea..fb84608ca95ba5adf28baf7924fee5b62ba7957e 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2001 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Apple Inc. All rights reserved.
  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
  * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
@@ -99,15 +99,15 @@ static OwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
     map->add(InputTypeNames::color(), &ColorInputType::create);
 #endif
 #if ENABLE(INPUT_TYPE_DATE)
-    if (RuntimeEnabledFeatures::inputTypeDateEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().inputTypeDateEnabled())
         map->add(InputTypeNames::date(), &DateInputType::create);
 #endif
 #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE)
-    if (RuntimeEnabledFeatures::inputTypeDateTimeEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().inputTypeDateTimeEnabled())
         map->add(InputTypeNames::datetime(), &DateTimeInputType::create);
 #endif
 #if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-    if (RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().inputTypeDateTimeLocalEnabled())
         map->add(InputTypeNames::datetimelocal(), &DateTimeLocalInputType::create);
 #endif
     map->add(InputTypeNames::email(), &EmailInputType::create);
@@ -115,7 +115,7 @@ static OwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
     map->add(InputTypeNames::hidden(), &HiddenInputType::create);
     map->add(InputTypeNames::image(), &ImageInputType::create);
 #if ENABLE(INPUT_TYPE_MONTH)
-    if (RuntimeEnabledFeatures::inputTypeMonthEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().inputTypeMonthEnabled())
         map->add(InputTypeNames::month(), &MonthInputType::create);
 #endif
     map->add(InputTypeNames::number(), &NumberInputType::create);
@@ -127,12 +127,12 @@ static OwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
     map->add(InputTypeNames::submit(), &SubmitInputType::create);
     map->add(InputTypeNames::telephone(), &TelephoneInputType::create);
 #if ENABLE(INPUT_TYPE_TIME)
-    if (RuntimeEnabledFeatures::inputTypeTimeEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().inputTypeTimeEnabled())
         map->add(InputTypeNames::time(), &TimeInputType::create);
 #endif
     map->add(InputTypeNames::url(), &URLInputType::create);
 #if ENABLE(INPUT_TYPE_WEEK)
-    if (RuntimeEnabledFeatures::inputTypeWeekEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().inputTypeWeekEnabled())
         map->add(InputTypeNames::week(), &WeekInputType::create);
 #endif
     // No need to register "text" because it is the default type.
index cd5115e74da466bc0a18dacee2bf71fde9c58a4b..151c9045b1787b07ca5a45a4c2f47e3fdbb8df19 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Google, Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1905,7 +1906,7 @@ void ContentSecurityPolicy::reportBlockedScriptExecutionToInspector(const String
 bool ContentSecurityPolicy::experimentalFeaturesEnabled() const
 {
 #if ENABLE(CSP_NEXT)
-    return RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled();
+    return RuntimeEnabledFeatures::sharedFeatures().experimentalContentSecurityPolicyFeaturesEnabled();
 #else
     return false;
 #endif
index ab0bf7055dda0312c9630631bd7d71a418932611..36bf2be0d005b782ae2b43a5e96d00b5eca56cc2 100644 (file)
@@ -1614,10 +1614,10 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
     else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
         addBeforeUnloadEventListener(this);
 #if ENABLE(DEVICE_ORIENTATION)
-    else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
+    else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::sharedFeatures().deviceMotionEnabled()) {
         if (DeviceMotionController* controller = DeviceMotionController::from(page()))
             controller->addDeviceEventListener(this);
-    } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
+    } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::sharedFeatures().deviceOrientationEnabled()) {
         if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
             controller->addDeviceEventListener(this);
     }
index d131f40e388606bc9bc93fdd0ae56c7973db4083..4fbf14206ebad1b76c2df6eaa325739536afb209 100644 (file)
@@ -3,7 +3,7 @@
  *                     1999 Lars Knoll <knoll@kde.org>
  *                     1999 Antti Koivisto <koivisto@kde.org>
  *                     2000 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
  *           (C) 2006 Graham Dennis (graham.dennis@gmail.com)
  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
  * Copyright (C) 2009 Google Inc. All rights reserved.
@@ -2766,7 +2766,7 @@ void FrameView::performPostLayoutTasks()
         frame().loader().didLayout(milestonesAchieved);
 
 #if ENABLE(FONT_LOAD_EVENTS)
-    if (RuntimeEnabledFeatures::fontLoadEventsEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
         frame().document()->fontloader()->didLayout();
 #endif
     
index 8a001c582b3307d657ae5743f99b11f72f19363a..2ab4f72c904007c1d19935f76b99b35fe72c9ade 100644 (file)
 namespace WebCore {
 
 InternalSettings::Backup::Backup(Settings& settings)
-    : m_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::cssExclusionsEnabled())
-    , m_originalCSSShapesEnabled(RuntimeEnabledFeatures::cssShapesEnabled())
+    : m_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::sharedFeatures().cssExclusionsEnabled())
+    , m_originalCSSShapesEnabled(RuntimeEnabledFeatures::sharedFeatures().cssShapesEnabled())
     , m_originalCSSVariablesEnabled(settings.cssVariablesEnabled())
 #if ENABLE(SHADOW_DOM)
-    , m_originalShadowDOMEnabled(RuntimeEnabledFeatures::shadowDOMEnabled())
-    , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled())
+    , m_originalShadowDOMEnabled(RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled())
+    , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::sharedFeatures().authorShadowDOMForAnyElementEnabled())
 #endif
 #if ENABLE(STYLE_SCOPED)
-    , m_originalStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled())
+    , m_originalStyleScoped(RuntimeEnabledFeatures::sharedFeatures().styleScopedEnabled())
 #endif
     , m_originalEditingBehavior(settings.editingBehaviorType())
 #if ENABLE(TEXT_AUTOSIZING)
@@ -85,7 +85,7 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_originalMediaTypeOverride(settings.mediaTypeOverride())
     , m_originalCanvasUsesAcceleratedDrawing(settings.canvasUsesAcceleratedDrawing())
     , m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
-    , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled())
+    , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
     , m_imagesEnabled(settings.areImagesEnabled())
     , m_minimumTimerInterval(settings.minDOMTimerInterval())
 #if ENABLE(VIDEO_TRACK)
@@ -102,15 +102,15 @@ InternalSettings::Backup::Backup(Settings& settings)
 
 void InternalSettings::Backup::restoreTo(Settings& settings)
 {
-    RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabled);
-    RuntimeEnabledFeatures::setCSSShapesEnabled(m_originalCSSShapesEnabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSExclusionsEnabled(m_originalCSSExclusionsEnabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(m_originalCSSShapesEnabled);
     settings.setCSSVariablesEnabled(m_originalCSSVariablesEnabled);
 #if ENABLE(SHADOW_DOM)
-    RuntimeEnabledFeatures::setShadowDOMEnabled(m_originalShadowDOMEnabled);
-    RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAuthorShadowDOMForAnyElementEnabled);
+    RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(m_originalShadowDOMEnabled);
+    RuntimeEnabledFeatures::sharedFeatures().setAuthorShadowDOMForAnyElementEnabled(m_originalAuthorShadowDOMForAnyElementEnabled);
 #endif
 #if ENABLE(STYLE_SCOPED)
-    RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped);
+    RuntimeEnabledFeatures::sharedFeatures().setStyleScopedEnabled(m_originalStyleScoped);
 #endif
     settings.setEditingBehaviorType(m_originalEditingBehavior);
 #if ENABLE(TEXT_AUTOSIZING)
@@ -121,7 +121,7 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setMediaTypeOverride(m_originalMediaTypeOverride);
     settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
     settings.setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
-    RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
+    RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
     settings.setImagesEnabled(m_imagesEnabled);
     settings.setMinDOMTimerInterval(m_minimumTimerInterval);
 #if ENABLE(VIDEO_TRACK)
@@ -215,7 +215,7 @@ void InternalSettings::setShadowDOMEnabled(bool enabled, ExceptionCode& ec)
     }
 
 #if ENABLE(SHADOW_DOM)
-    RuntimeEnabledFeatures::setShadowDOMEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(enabled);
 #else
     // Even SHADOW_DOM is off, InternalSettings allows setShadowDOMEnabled(false) to
     // have broader test coverage. But it cannot be setShadowDOMEnabled(true).
@@ -227,7 +227,7 @@ void InternalSettings::setShadowDOMEnabled(bool enabled, ExceptionCode& ec)
 void InternalSettings::setAuthorShadowDOMForAnyElementEnabled(bool isEnabled)
 {
 #if ENABLE(SHADOW_DOM)
-    RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(isEnabled);
+    RuntimeEnabledFeatures::sharedFeatures().setAuthorShadowDOMForAnyElementEnabled(isEnabled);
 #else
     UNUSED_PARAM(isEnabled);
 #endif
@@ -236,7 +236,7 @@ void InternalSettings::setAuthorShadowDOMForAnyElementEnabled(bool isEnabled)
 void InternalSettings::setStyleScopedEnabled(bool enabled)
 {
 #if ENABLE(STYLE_SCOPED)
-    RuntimeEnabledFeatures::setStyleScopedEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setStyleScopedEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
@@ -346,13 +346,13 @@ void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, E
 void InternalSettings::setCSSExclusionsEnabled(bool enabled, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    RuntimeEnabledFeatures::setCSSExclusionsEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSExclusionsEnabled(enabled);
 }
 
 void InternalSettings::setCSSShapesEnabled(bool enabled, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    RuntimeEnabledFeatures::setCSSShapesEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(enabled);
 }
 
 void InternalSettings::setCSSVariablesEnabled(bool enabled, ExceptionCode& ec)
@@ -449,7 +449,7 @@ void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCod
 
 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
 {
-    RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(enabled);
 }
 
 void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
index 468ec0f0f06da90e3a2589a21562accbfaeb66cb..f8649e27eafd73505a71db473f3ede30d2d5abd9 100644 (file)
@@ -1,3 +1,13 @@
+2013-09-24  Brent Fulgham  <bfulgham@apple.com>
+
+        [Windows] Refactor RuntimeEnabledFeatures as a Singleton 
+        https://bugs.webkit.org/show_bug.cgi?id=121883
+
+        Reviewed by Jer Noble.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+        Expose singleton accessor for DLL clients.
+
 2013-09-25  Brent Fulgham  <bfulgham@apple.com>
 
         [Windows] Unreviewed build fix after r156408.
index 938e49c46d97cbe833804cca68264326f8d7d323..eab18cc60feb8528759f7ef754d6c8c45532a105 100644 (file)
@@ -238,8 +238,6 @@ EXPORTS
         symbolWithPointer(?disconnectFrontend@InspectorController@WebCore@@QAEXXZ, ?disconnectFrontend@InspectorController@WebCore@@QEAAXXZ)
 #endif
         symbolWithPointer(?isActiveInsertionPoint@WebCore@@YA_NPBVNode@1@@Z, ?isActiveInsertionPoint@WebCore@@YA_NPEBVNode@1@@Z)
-        ?isCSSExclusionsEnabled@RuntimeEnabledFeatures@WebCore@@0_NA
-        ?isCSSShapesEnabled@RuntimeEnabledFeatures@WebCore@@0_NA
         symbolWithPointer(?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z, ?isPreloaded@CachedResourceLoader@WebCore@@QEBA_NAEBVString@WTF@@@Z)
         symbolWithPointer(?jsArray@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@V?$PassRefPtr@VDOMStringList@WebCore@@@WTF@@@Z, ?jsArray@WebCore@@YA?AVJSValue@JSC@@PEAVExecState@3@PEAVJSDOMGlobalObject@1@V?$PassRefPtr@VDOMStringList@WebCore@@@WTF@@@Z)
         symbolWithPointer(?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ, ?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QEBA_NXZ)
@@ -300,6 +298,7 @@ EXPORTS
         symbolWithPointer(?setPseudo@Element@WebCore@@QAEXABVAtomicString@WTF@@@Z, ?setPseudo@Element@WebCore@@QEAAXAEBVAtomicString@WTF@@@Z)
         symbolWithPointer(?setMediaTypeOverride@Settings@WebCore@@QAEXABVString@WTF@@@Z, ?setMediaTypeOverride@Settings@WebCore@@QEAAXAEBVString@WTF@@@Z)
         symbolWithPointer(?settings@Document@WebCore@@QBEPAVSettings@2@XZ, ?settings@Document@WebCore@@QEBAPEAVSettings@2@XZ)
+        ?sharedFeatures@RuntimeEnabledFeatures@WebCore@@SAAAV12@XZ
         symbolWithPointer(?substring@String@WTF@@QBE?AV12@II@Z, ?substring@String@WTF@@QEBA?AV12@II@Z)
         symbolWithPointer(?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ, ?suggestedValue@HTMLInputElement@WebCore@@QEBAAEBVString@WTF@@XZ)
         symbolWithPointer(?target@HistoryItem@WebCore@@QBEABVString@WTF@@XZ, ?target@HistoryItem@WebCore@@QEBAAEBVString@WTF@@XZ)
index e7d55ee28bc00f83cdd79cde7f9ffc8f093156b0..c86d0985ca09d9dee1d69130b4fc6a2284f7ab2e 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883.
+
+        Reviewed by Jer Noble.
+
+        * WebKitSupport/DumpRenderTreeSupport.cpp:
+        (DumpRenderTreeSupport::setStyleScopedEnabled): use
+        singleton accessor.
+
 2013-09-23  Jacky Jiang  <zhajiang@blackberry.com>
 
         [BlackBerry] Poor rendering opening a Google map short link
index 6a1176356243818bc3c2eb1128289096c38bc972..07de521f47d1d521a81666f10457efeb19248ce3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
- * Copyright (C) 2012 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All Rights Reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -125,7 +125,7 @@ void DumpRenderTreeSupport::scalePageBy(WebPage* webPage, float scaleFactor, flo
 #if ENABLE(STYLE_SCOPED)
 void DumpRenderTreeSupport::setStyleScopedEnabled(bool enabled)
 {
-    RuntimeEnabledFeatures::setStyleScopedEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setStyleScopedEnabled(enabled);
 }
 #endif
 
index 582f4ad48d4b2aa8d0d712cf2c29d099445de7f1..278344356146fe2a2ee1bced88586bb5a7fa4f96 100644 (file)
@@ -1,3 +1,19 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883.
+
+        Reviewed by Jer Noble.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::setCSSRegionsEnabled): Use singleton.
+        (DumpRenderTreeSupportEfl::setSeamlessIFramesEnabled): Ditto.
+        * ewk/ewk_settings.cpp:
+        (ewk_settings_shadow_dom_enable_get): Ditto.
+        (ewk_settings_shadow_dom_enable_set):
+        * ewk/ewk_view.cpp:
+        (_ewk_view_priv_new): Ditto.
+
 2013-09-20  Mario Sanchez Prada  <mario.prada@samsung.com>
 
         [ATK] Do not expose aria-help in ATK based platforms
index 899648dcebb9b61c94445250a1272ca22e4f4e7b..dc0c243350e96263983edd346f30fa06fc12f741 100644 (file)
@@ -2,6 +2,7 @@
     Copyright (C) 2011 ProFUSION embedded systems
     Copyright (C) 2011 Samsung Electronics
     Copyright (C) 2012 Intel Corporation. All rights reserved.
+    Copyright (C) 2013 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -320,13 +321,13 @@ void DumpRenderTreeSupportEfl::setCSSRegionsEnabled(const Evas_Object* ewkView,
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
 
-    WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled(enabled);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(enabled);
 }
 
 void DumpRenderTreeSupportEfl::setSeamlessIFramesEnabled(bool enabled)
 {
 #if ENABLE(IFRAME_SEAMLESS)
-    WebCore::RuntimeEnabledFeatures::setSeamlessIFramesEnabled(enabled);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
index ad0ecc71f619ca74962d4be4ec43b678cc819732..4ab0ae7701716444d21b5bf6073de11bde7f10f9 100644 (file)
@@ -2,6 +2,7 @@
     Copyright (C) 2009-2010 ProFUSION embedded systems
     Copyright (C) 2009-2010 Samsung Electronics
     Copyright (C) 2012 Intel Corporation
+    Copyright (C) 2013 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -255,7 +256,7 @@ void ewk_settings_object_cache_enable_set(Eina_Bool enable)
 Eina_Bool ewk_settings_shadow_dom_enable_get()
 {
 #if ENABLE(SHADOW_DOM)
-    return WebCore::RuntimeEnabledFeatures::shadowDOMEnabled();
+    return WebCore::RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled();
 #else
     return false;
 #endif
@@ -265,7 +266,7 @@ Eina_Bool ewk_settings_shadow_dom_enable_set(Eina_Bool enable)
 {
 #if ENABLE(SHADOW_DOM)
     enable = !!enable;
-    WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled(enable);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(enable);
     return true;
 #else
     UNUSED_PARAM(enable);
index 9e92858d4e0c8d9cf9dca7f0ea98cfc444c92739..a0ef9c51be8905ec8b2367080a7f0b3baeaaa683 100644 (file)
@@ -2,6 +2,7 @@
     Copyright (C) 2009-2010 ProFUSION embedded systems
     Copyright (C) 2009-2012 Samsung Electronics
     Copyright (C) 2012 Intel Corporation
+    Copyright (C) 2013 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -736,9 +737,9 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
     priv->pageSettings->setSansSerifFontFamily("sans");
     priv->pageSettings->setStandardFontFamily("sans");
     priv->pageSettings->setHyperlinkAuditingEnabled(false);
-    WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled(true);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(true);
 #if ENABLE(IFRAME_SEAMLESS)
-    WebCore::RuntimeEnabledFeatures::setSeamlessIFramesEnabled(true);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled(true);
 #endif
     priv->pageSettings->setScriptEnabled(true);
     priv->pageSettings->setPluginsEnabled(true);
index 7f530f63611d38dcde4691384926ac7d6cbdfb5b..a421b5e92c7799ee80b0432b37cc4413df56ba33 100644 (file)
@@ -1,3 +1,19 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883.
+
+        Reviewed by Jer Noble.
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::setCSSRegionsEnabled): Use singleton.
+        (DumpRenderTreeSupportGtk::setExperimentalContentSecurityPolicyFeaturesEnabled):
+        (DumpRenderTreeSupportGtk::setSeamlessIFramesEnabled):
+        (DumpRenderTreeSupportGtk::setShadowDOMEnabled):
+        (DumpRenderTreeSupportGtk::setStyleScopedEnabled):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_update_settings): Ditto.
+
 2013-09-24  Lorenzo Tilve  <ltilve@igalia.com>
 
         [GTK] Fix compilation problems when setting ENABLE_DRAG_SUPPORT = FALSE
index c6985592dda51b44d48f474ab400528a7033c4e7..dded8c467ffd9e69c08c0e51a98de115cbad3e96 100644 (file)
@@ -3,7 +3,7 @@
  *  Copyright (C) 2010 Joone Hur <joone@kldp.org>
  *  Copyright (C) 2009 Google Inc. All rights reserved.
  *  Copyright (C) 2011 Igalia S.L.
- *  Copyright (C) 2012 Apple Inc. All Rights Reserved.
+ *  Copyright (C) 2012, 2013 Apple Inc. All Rights Reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -575,7 +575,7 @@ void DumpRenderTreeSupportGtk::setCSSGridLayoutEnabled(WebKitWebView* webView, b
 
 void DumpRenderTreeSupportGtk::setCSSRegionsEnabled(WebKitWebView* webView, bool enabled)
 {
-    RuntimeEnabledFeatures::setCSSRegionsEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(enabled);
 }
 
 void DumpRenderTreeSupportGtk::setCSSCustomFilterEnabled(WebKitWebView* webView, bool enabled)
@@ -588,28 +588,28 @@ void DumpRenderTreeSupportGtk::setCSSCustomFilterEnabled(WebKitWebView* webView,
 void DumpRenderTreeSupportGtk::setExperimentalContentSecurityPolicyFeaturesEnabled(bool enabled)
 {
 #if ENABLE(CSP_NEXT)
-    RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setExperimentalContentSecurityPolicyFeaturesEnabled(enabled);
 #endif
 }
 
 void DumpRenderTreeSupportGtk::setSeamlessIFramesEnabled(bool enabled)
 {
 #if ENABLE(IFRAME_SEAMLESS)
-    RuntimeEnabledFeatures::setSeamlessIFramesEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled(enabled);
 #endif
 }
 
 void DumpRenderTreeSupportGtk::setShadowDOMEnabled(bool enabled)
 {
 #if ENABLE(SHADOW_DOM)
-    RuntimeEnabledFeatures::setShadowDOMEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(enabled);
 #endif
 }
 
 void DumpRenderTreeSupportGtk::setStyleScopedEnabled(bool enabled)
 {
 #if ENABLE(STYLE_SCOPED)
-    RuntimeEnabledFeatures::setStyleScopedEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setStyleScopedEnabled(enabled);
 #endif
 }
 
index 81e3f5de975a8df86f6b6a51a14e99c125a69b4c..c712c9adcb6103e0cdb0c2f8147a2f9350754c2f 100644 (file)
@@ -12,6 +12,7 @@
  *  Copyright (C) 2009 Bobby Powers
  *  Copyright (C) 2010 Joone Hur <joone@kldp.org>
  *  Copyright (C) 2012 Igalia S.L.
+ *  Copyright (C) 2013 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -3583,7 +3584,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-    WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled(settingsPrivate->enableMediaStream);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(settingsPrivate->enableMediaStream);
 #endif
 
 #if USE(ACCELERATED_COMPOSITING)
index b41efcd5a69fd7a6b3ba7f24168d06566a55b918..a3adcdd8576b02965f1481ac14e27f60d3693972 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883.
+
+        Reviewed by Jer Noble.
+
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Use singleton accessor.
+        (-[WebView _setDashboardBehavior:to:]): Ditto.
+
 2013-09-25  Brady Eidson  <beidson@apple.com>
 
         FeatureDefine.xcconfig cleanup (They should all be identical).
index 4249dd22059753169326faae7d241bf9031f0061..f23f6ae2ca30ead5a4d8bb0f50768f110cb637b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2013 Apple Inc. All rights reserved.
  * Copyright (C) 2006 David Smith (catfish.man@gmail.com)
  * Copyright (C) 2010 Igalia S.L
  *
@@ -1521,13 +1521,13 @@ static bool needsSelfRetainWhileLoadingQuirk()
 #if ENABLE(CSS_SHADERS)
     settings.setCSSCustomFilterEnabled([preferences cssCustomFilterEnabled]);
 #endif
-    RuntimeEnabledFeatures::setCSSRegionsEnabled([preferences cssRegionsEnabled]);
-    RuntimeEnabledFeatures::setCSSCompositingEnabled([preferences cssCompositingEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled([preferences cssRegionsEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSCompositingEnabled([preferences cssCompositingEnabled]);
 #if ENABLE(WEB_AUDIO)
     settings.setWebAudioEnabled([preferences webAudioEnabled]);
 #endif
 #if ENABLE(IFRAME_SEAMLESS)
-    RuntimeEnabledFeatures::setSeamlessIFramesEnabled([preferences seamlessIFramesEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled([preferences seamlessIFramesEnabled]);
 #endif
     settings.setCSSGridLayoutEnabled([preferences cssGridLayoutEnabled]);
 #if ENABLE(FULLSCREEN_API)
@@ -2186,7 +2186,7 @@ static inline IMP getMethod(id o, SEL s)
             if (_private->page)
                 _private->page->settings().setUsesDashboardBackwardCompatibilityMode(flag);
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
-            RuntimeEnabledFeatures::setLegacyCSSVendorPrefixesEnabled(flag);
+            RuntimeEnabledFeatures::sharedFeatures().setLegacyCSSVendorPrefixesEnabled(flag);
 #endif
             break;
         }
index 5e3cee7bbf080298e21413083df5c360ee5cd85d..e79633b1204011642e8a02b31d4be20f713aa9f1 100644 (file)
@@ -1,5 +1,6 @@
 /*
     Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+    Copyright (C) 2013 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -173,10 +174,10 @@ void QWebSettingsPrivate::apply()
 
         value = attributes.value(QWebSettings::CSSRegionsEnabled,
                                  global->attributes.value(QWebSettings::CSSRegionsEnabled));
-        WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled(value);
+        WebCore::RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(value);
         value = attributes.value(QWebSettings::CSSCompositingEnabled,
                                  global->attributes.value(QWebSettings::CSSCompositingEnabled));
-        WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled(value);
+        WebCore::RuntimeEnabledFeatures::sharedFeatures().setCSSCompositingEnabled(value);
         value = attributes.value(QWebSettings::CSSGridLayoutEnabled,
                                  global->attributes.value(QWebSettings::CSSGridLayoutEnabled));
         settings->setCSSGridLayoutEnabled(value);
index a379dbbaa1aa7ba2950e812ef85e694f61a3e214..9c9320cc0f5e675e582de5f2298ab52ceaeeedf0 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883.
+
+        Reviewed by Jer Noble.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply): Use singleton accessor.
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::setSeamlessIFramesEnabled): Ditto.
+
 2013-09-25  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt] Fix build with Qt 5.2 QtPosition module
index 2c81b02540c9f78229c0a23543680e77c9fb083a..9600922e5c4d22626f9f4f62283abf0dbf55b88b 100644 (file)
@@ -2,7 +2,7 @@
     Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
     Copyright (C) 2008,2009,2010 Nokia Corporation and/or its subsidiary(-ies)
     Copyright (C) 2007 Staikos Computing Services Inc.
-    Copyright (C) 2007, 2012 Apple Inc.
+    Copyright (C) 2007, 2012, 2013 Apple Inc.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -862,7 +862,7 @@ void DumpRenderTreeSupportQt::getTrackedRepaintRects(QWebFrameAdapter* adapter,
 void DumpRenderTreeSupportQt::setSeamlessIFramesEnabled(bool enabled)
 {
 #if ENABLE(IFRAME_SEAMLESS)
-    WebCore::RuntimeEnabledFeatures::setSeamlessIFramesEnabled(enabled);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
index f2718a1ca4e3051e9bd940983aede5d2044eb4e6..8cbb2092436e9f4411d25e2f1f319f8f724181d9 100644 (file)
@@ -1,3 +1,13 @@
+2013-09-24  Brent Fulgham  <bfulgham@apple.com>
+
+        [Windows] Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883
+
+        Reviewed by Jer Noble.
+
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged): Use singleton accessor
+
 2013-09-24  Roger Fong  <roger_fong@apple.com>
 
         [Windows] Overpanning occurs even when what is being panned isn't the main document.
index 36c2083572df2706797d553fe46c4bea6ed1a9fc..d8ce77e508443a624fa36bfbd266da9459b51c24 100644 (file)
@@ -4787,12 +4787,12 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     hr = preferences->isCSSRegionsEnabled(&enabled);
     if (FAILED(hr))
         return hr;
-    RuntimeEnabledFeatures::setCSSRegionsEnabled(!!enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(!!enabled);
 
     hr = preferences->areSeamlessIFramesEnabled(&enabled);
     if (FAILED(hr))
         return hr;
-    RuntimeEnabledFeatures::setSeamlessIFramesEnabled(!!enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled(!!enabled);
 
     hr = preferences->privateBrowsingEnabled(&enabled);
     if (FAILED(hr))
index eedbbf8b92fbfed1a8ded5c31d1d854c0fe0e567..8fcad63df2d109a25c880a0c6fc331f76c155e63 100644 (file)
@@ -1,3 +1,22 @@
+2013-09-25  Brent Fulgham  <bfulgham@apple.com>
+
+        Refactor RuntimeEnabledFeatures as a Singleton.
+        https://bugs.webkit.org/show_bug.cgi?id=121883.
+
+        Reviewed by Jer Noble.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Use
+        Singleton accessor.
+        (WebKit::InjectedBundle::setShadowDOMEnabled):
+        (WebKit::InjectedBundle::setCSSRegionsEnabled):
+        (WebKit::InjectedBundle::setCSSCompositingEnabled):
+        (WebKit::InjectedBundle::setSeamlessIFramesEnabled):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences): Ditto.
+        * WebProcess/qt/WebProcessQt.cpp:
+        (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
+
 2013-09-25  Brady Eidson  <beidson@apple.com>
 
         FeatureDefine.xcconfig cleanup (They should all be identical).
index d29d32ef105881a63f9b466c79c147f23ca2c820..c8c077e29a6e4218a79aa75b42b3fcbb264e04a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -191,12 +191,12 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
 
 #if ENABLE(CSS_REGIONS)
     if (preference == "WebKitCSSRegionsEnabled")
-        RuntimeEnabledFeatures::setCSSRegionsEnabled(enabled);
+        RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(enabled);
 #endif
 
 #if ENABLE(CSS_COMPOSITING)
     if (preference == "WebKitCSSCompositingEnabled")
-        RuntimeEnabledFeatures::setCSSCompositingEnabled(enabled);
+        RuntimeEnabledFeatures::sharedFeatures().setCSSCompositingEnabled(enabled);
 #endif
 
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
@@ -646,7 +646,7 @@ void InjectedBundle::setSerialLoadingEnabled(bool enabled)
 void InjectedBundle::setShadowDOMEnabled(bool enabled)
 {
 #if ENABLE(SHADOW_DOM)
-    RuntimeEnabledFeatures::setShadowDOMEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
@@ -655,7 +655,7 @@ void InjectedBundle::setShadowDOMEnabled(bool enabled)
 void InjectedBundle::setCSSRegionsEnabled(bool enabled)
 {
 #if ENABLE(CSS_REGIONS)
-    RuntimeEnabledFeatures::setCSSRegionsEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
@@ -664,7 +664,7 @@ void InjectedBundle::setCSSRegionsEnabled(bool enabled)
 void InjectedBundle::setCSSCompositingEnabled(bool enabled)
 {
 #if ENABLE(CSS_COMPOSITING)
-    RuntimeEnabledFeatures::setCSSCompositingEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSCompositingEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
@@ -673,7 +673,7 @@ void InjectedBundle::setCSSCompositingEnabled(bool enabled)
 void InjectedBundle::setSeamlessIFramesEnabled(bool enabled)
 {
 #if ENABLE(IFRAME_SEAMLESS)
-    RuntimeEnabledFeatures::setSeamlessIFramesEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setSeamlessIFramesEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
 #endif
index d264c87e644d828a1d7d0eb637962dbad3bf2a5d..6070aa3f1ad52fc1ee2379edaaadf3879965ee76 100644 (file)
@@ -2491,8 +2491,8 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings.setShowTiledScrollingIndicator(store.getBoolValueForKey(WebPreferencesKey::tiledScrollingIndicatorVisibleKey()));
     settings.setAggressiveTileRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::aggressiveTileRetentionEnabledKey()));
     settings.setCSSCustomFilterEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCustomFilterEnabledKey()));
-    RuntimeEnabledFeatures::setCSSRegionsEnabled(store.getBoolValueForKey(WebPreferencesKey::cssRegionsEnabledKey()));
-    RuntimeEnabledFeatures::setCSSCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCompositingEnabledKey()));
+    RuntimeEnabledFeatures::sharedFeatures().setCSSRegionsEnabled(store.getBoolValueForKey(WebPreferencesKey::cssRegionsEnabledKey()));
+    RuntimeEnabledFeatures::sharedFeatures().setCSSCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCompositingEnabledKey()));
     settings.setCSSGridLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::cssGridLayoutEnabledKey()));
     settings.setRegionBasedColumnsEnabled(store.getBoolValueForKey(WebPreferencesKey::regionBasedColumnsEnabledKey()));
     settings.setWebGLEnabled(store.getBoolValueForKey(WebPreferencesKey::webGLEnabledKey()));
index 0dcaf9d173cc875b281b740693b17040ee24e78a..4035f67346602fc1d88d5dc51cdddd45c451f764 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -138,7 +138,7 @@ void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters
     }
 #endif
 
-    WebCore::RuntimeEnabledFeatures::setSpeechInputEnabled(false);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setSpeechInputEnabled(false);
 
     // We'll only install the Qt builtin bundle if we don't have one given by the UI process.
     // Currently only WTR provides its own bundle.