Title: [94590] trunk/Source
Revision
94590
Author
commit-qu...@webkit.org
Date
2011-09-06 12:37:00 -0700 (Tue, 06 Sep 2011)

Log Message

Allow MediaSource API to be enabled at runtime.
https://bugs.webkit.org/show_bug.cgi?id=67306

Patch by Aaron Colwell <acolw...@chromium.org> on 2011-09-06
Reviewed by Eric Carlson.

Source/WebCore:

* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webkitMediaSourceEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitMediaSourceEnabled):
* html/HTMLMediaElement.idl:

Source/WebKit/chromium:

* public/WebRuntimeFeatures.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableMediaSource):
(WebKit::WebRuntimeFeatures::isMediaSourceEnabled):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94589 => 94590)


--- trunk/Source/WebCore/ChangeLog	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebCore/ChangeLog	2011-09-06 19:37:00 UTC (rev 94590)
@@ -1,3 +1,16 @@
+2011-09-06  Aaron Colwell  <acolw...@chromium.org>
+
+        Allow MediaSource API to be enabled at runtime.
+        https://bugs.webkit.org/show_bug.cgi?id=67306
+
+        Reviewed by Eric Carlson.
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::webkitMediaSourceEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitMediaSourceEnabled):
+        * html/HTMLMediaElement.idl:
+
 2011-09-06  Mike Reed  <r...@google.com>
 
         [skia] never draw with GDI, so that all text can be gpu-accelerated

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp (94589 => 94590)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2011-09-06 19:37:00 UTC (rev 94590)
@@ -155,4 +155,8 @@
 bool RuntimeEnabledFeatures::isFullScreenAPIEnabled = true;
 #endif
 
+#if ENABLE(MEDIA_SOURCE)
+bool RuntimeEnabledFeatures::isMediaSourceEnabled = false;
+#endif
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (94589 => 94590)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2011-09-06 19:37:00 UTC (rev 94590)
@@ -167,6 +167,11 @@
     static void setQuotaEnabled(bool isEnabled) { isQuotaEnabled = isEnabled; }
 #endif
 
+#if ENABLE(MEDIA_SOURCE)
+    static bool webkitMediaSourceEnabled() { return isMediaSourceEnabled; }
+    static void setWebkitMediaSourceEnabled(bool isEnabled) { isMediaSourceEnabled = isEnabled; }
+#endif
+
 private:
     // Never instantiate.
     RuntimeEnabledFeatures() { }
@@ -207,6 +212,10 @@
 #if ENABLE(FULLSCREEN_API)
     static bool isFullScreenAPIEnabled;
 #endif
+
+#if ENABLE(MEDIA_SOURCE)
+    static bool isMediaSourceEnabled;
+#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (94589 => 94590)


--- trunk/Source/WebCore/html/HTMLMediaElement.idl	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl	2011-09-06 19:37:00 UTC (rev 94590)
@@ -92,22 +92,22 @@
 
 #if defined(ENABLE_MEDIA_SOURCE) && ENABLE_MEDIA_SOURCE
     // URL passed to src attribute to enable the media source logic.
-    readonly attribute [URL] DOMString webkitMediaSourceURL;
+    readonly attribute [EnabledAtRuntime=webkitMediaSource, URL] DOMString webkitMediaSourceURL;
 
     // Appends media to to the source.
-    void webkitSourceAppend(in Uint8Array data) raises (DOMException);
+    [EnabledAtRuntime=webkitMediaSource] void webkitSourceAppend(in Uint8Array data) raises (DOMException);
 
     // Signals the end of stream.
-    const unsigned short EOS_NO_ERROR = 0; // End of stream reached w/o error.
-    const unsigned short EOS_NETWORK_ERR = 1; // A network error triggered end of stream.
-    const unsigned short EOS_DECODE_ERR = 2; // A decode error triggered end of stream.
-    void webkitSourceEndOfStream(in unsigned short status) raises (DOMException);
+    const [EnabledAtRuntime=webkitMediaSource] unsigned short EOS_NO_ERROR = 0; // End of stream reached w/o error.
+    const [EnabledAtRuntime=webkitMediaSource] unsigned short EOS_NETWORK_ERR = 1; // A network error triggered end of stream.
+    const [EnabledAtRuntime=webkitMediaSource] unsigned short EOS_DECODE_ERR = 2; // A decode error triggered end of stream.
+    [EnabledAtRuntime=webkitMediaSource] void webkitSourceEndOfStream(in unsigned short status) raises (DOMException);
 
     // Indicates the current state of the media source.
-    const unsigned short SOURCE_CLOSED = 0;
-    const unsigned short SOURCE_OPEN = 1;
-    const unsigned short SOURCE_ENDED = 2;
-    readonly attribute unsigned short webkitSourceState;
+    const [EnabledAtRuntime=webkitMediaSource] unsigned short SOURCE_CLOSED = 0;
+    const [EnabledAtRuntime=webkitMediaSource] unsigned short SOURCE_OPEN = 1;
+    const [EnabledAtRuntime=webkitMediaSource] unsigned short SOURCE_ENDED = 2;
+    readonly attribute [EnabledAtRuntime=webkitMediaSource] unsigned short webkitSourceState;
 #endif
 };
 }

Modified: trunk/Source/WebKit/chromium/ChangeLog (94589 => 94590)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-09-06 19:37:00 UTC (rev 94590)
@@ -1,3 +1,15 @@
+2011-09-06  Aaron Colwell  <acolw...@chromium.org>
+
+        Allow MediaSource API to be enabled at runtime.
+        https://bugs.webkit.org/show_bug.cgi?id=67306
+
+        Reviewed by Eric Carlson.
+
+        * public/WebRuntimeFeatures.h:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enableMediaSource):
+        (WebKit::WebRuntimeFeatures::isMediaSourceEnabled):
+
 2011-09-06  Ryosuke Niwa  <rn...@webkit.org>
 
         REGRESSION(r94274): FormManagerTest.PreviewForm and FillFormNonEmptyField fail on chromium

Modified: trunk/Source/WebKit/chromium/public/WebRuntimeFeatures.h (94589 => 94590)


--- trunk/Source/WebKit/chromium/public/WebRuntimeFeatures.h	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebKit/chromium/public/WebRuntimeFeatures.h	2011-09-06 19:37:00 UTC (rev 94590)
@@ -109,6 +109,9 @@
     WEBKIT_EXPORT static void enableFullScreenAPI(bool);
     WEBKIT_EXPORT static bool isFullScreenAPIEnabled();
 
+    WEBKIT_EXPORT static void enableMediaSource(bool);
+    WEBKIT_EXPORT static bool isMediaSourceEnabled();
+
 private:
     WebRuntimeFeatures();
 };

Modified: trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp (94589 => 94590)


--- trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp	2011-09-06 19:21:52 UTC (rev 94589)
+++ trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp	2011-09-06 19:37:00 UTC (rev 94590)
@@ -374,4 +374,22 @@
 #endif
 }
 
+void WebRuntimeFeatures::enableMediaSource(bool enable)
+{
+#if ENABLE(MEDIA_SOURCE)
+    RuntimeEnabledFeatures::setWebkitMediaSourceEnabled(enable);
+#else
+    UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isMediaSourceEnabled()
+{
+#if ENABLE(MEDIA_SOURCE)
+    return RuntimeEnabledFeatures::webkitMediaSourceEnabled();
+#else
+    return false;
+#endif
+}
+
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to