LayoutTests/imported/w3c:
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2018 19:27:10 +0000 (19:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2018 19:27:10 +0000 (19:27 +0000)
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-10-04
Reviewed by Youenn Fablet and Chris Dumez.

* web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt:
* web-platform-tests/mediacapture-record/MediaRecorder-constructor-expected.txt: Added.
* web-platform-tests/mediacapture-record/MediaRecorder-constructor.html: Added.

Source/WebCore:
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018

Patch by Yuhan Wu <yuhan_wu@apple.com> on 2018-10-04
Reviewed by Youenn Fablet and Chris Dumez.

Covered by tests:
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html

Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediarecorder/BlobEvent.h:
(WebCore::BlobEvent::create):
(WebCore::BlobEvent:::Event):
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::activeDOMObjectName const):
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
* Modules/mediarecorder/MediaRecorder.h: Added.
(WebCore::MediaRecorder::state const):
(WebCore::MediaRecorder::~MediaRecorder):
* Modules/mediarecorder/MediaRecorder.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
(WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):

Source/WebKit:
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018

Patch by Yuhan Wu <yuhan_wu@apple.com> on 2018-10-04
Reviewed by Youenn Fablet and Chris Dumez.

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:
Runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-10-04
Reviewed by Youenn Fablet and Chris Dumez.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaRecorderEnabled]):
(-[WebPreferences setMediaRecorderEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:
Runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-10-04
Reviewed by Youenn Fablet and Chris Dumez.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):

LayoutTests:
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-10-04
Reviewed by Youenn Fablet and Chris Dumez.

* platform/win/TestExpectations:
* fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element-expected.txt:
* fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0-expected.txt:
* fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext-expected.txt:

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

31 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element-expected.txt
LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0-expected.txt
LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediarecorder/BlobEvent.h [new file with mode: 0644]
Source/WebCore/Modules/mediarecorder/BlobEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediarecorder/MediaRecorder.h [new file with mode: 0644]
Source/WebCore/Modules/mediarecorder/MediaRecorder.idl [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index d69e661..227cf07 100644 (file)
@@ -1,3 +1,15 @@
+2018-10-04  YUHAN WU  <yuhan_wu@apple.com>
+
+        runtime flag and IDL for MediaRecorder
+        https://bugs.webkit.org/show_bug.cgi?id=190018
+
+        Reviewed by Youenn Fablet and Chris Dumez.
+
+        * platform/win/TestExpectations:
+        * fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element-expected.txt:
+        * fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0-expected.txt:
+        * fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext-expected.txt:
+
 2018-10-04  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r236803.
index 16632cd..eb8bcaf 100644 (file)
@@ -1,4 +1,4 @@
 
-FAIL Verify that drawing to a 2D canvas that is not attached to the DOM dispatches frames to an attached MediaRecorder. Can't find variable: MediaRecorder
-FAIL Verify that drawing to a webgl canvas that is not attached to the DOM dispatches frames to an attached MediaRecorder. Can't find variable: MediaRecorder
+FAIL Verify that drawing to a 2D canvas that is not attached to the DOM dispatches frames to an attached MediaRecorder. recorder.start is not a function. (In 'recorder.start(0)', 'recorder.start' is undefined)
+FAIL Verify that drawing to a webgl canvas that is not attached to the DOM dispatches frames to an attached MediaRecorder. recorder.start is not a function. (In 'recorder.start(0)', 'recorder.start' is undefined)
 
index 98f588b..c85b53e 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 45: ReferenceError: Can't find variable: MediaRecorder
+CONSOLE MESSAGE: line 48: TypeError: recorder.start is not a function. (In 'recorder.start(0)', 'recorder.start' is undefined)
 Exercises that at least one frame passes on captureStream(0).
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -8,7 +8,7 @@ PASS Drawing to canvas.
 PASS Got a stream from canvas.
 PASS stream.getVideoTracks().length is 1
 PASS track.readyState is "live"
-FAIL Unexpected error: ReferenceError: Can't find variable: MediaRecorder
+FAIL Unexpected error: TypeError: recorder.start is not a function. (In 'recorder.start(0)', 'recorder.start' is undefined)
 FAIL successfullyParsed should be true. Was false.
 Some tests failed.
 
index 2b0fae9..1671b60 100644 (file)
@@ -1,4 +1,4 @@
 
-FAIL Untitled Can't find variable: MediaRecorder
-FAIL Untitled 1 Can't find variable: MediaRecorder
+FAIL Untitled recorder.start is not a function. (In 'recorder.start(0)', 'recorder.start' is undefined)
+FAIL Untitled 1 recorder.start is not a function. (In 'recorder.start(0)', 'recorder.start' is undefined)
 
index fc7d308..8402178 100644 (file)
@@ -1,3 +1,14 @@
+2018-10-04  YUHAN WU  <yuhan_wu@apple.com>
+
+        runtime flag and IDL for MediaRecorder
+        https://bugs.webkit.org/show_bug.cgi?id=190018
+
+        Reviewed by Youenn Fablet and Chris Dumez.
+
+        * web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt:
+        * web-platform-tests/mediacapture-record/MediaRecorder-constructor-expected.txt: Added.
+        * web-platform-tests/mediacapture-record/MediaRecorder-constructor.html: Added.
+
 2018-10-03  Justin Michaud  <justin_michaud@apple.com>
 
         Registered custom properties should allow inheritance to be controlled
index 45fc930..4d0187b 100644 (file)
@@ -1,7 +1,5 @@
 
-FAIL The BlobEventInit dictionary is required Can't find variable: BlobEvent
-FAIL The BlobEventInit dictionary's data member is required. assert_throws: function "function () {
-    new BlobEvent("type", {});
-  }" threw object "ReferenceError: Can't find variable: BlobEvent" ("ReferenceError") expected object "TypeError" ("TypeError")
-FAIL The BlobEvent instance's data attribute is set. Can't find variable: BlobEvent
+PASS The BlobEventInit dictionary is required 
+PASS The BlobEventInit dictionary's data member is required. 
+FAIL The BlobEvent instance's data attribute is set. assert_equals: expected (object) object "[object Blob]" but got (undefined) undefined
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor-expected.txt
new file mode 100644 (file)
index 0000000..be33acc
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS The MediaStream argument is required 
+PASS The MediaStream instance's state attribute is set. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html b/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
new file mode 100644 (file)
index 0000000..353cfbe
--- /dev/null
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>MediaRecorder constructor</title>
+<link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#mediarecorder">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+    test(function() {
+        assert_equals(MediaRecorder.length, 1);
+        assert_throws(new TypeError, function() {
+            new MediaRecorder();
+        });
+        assert_throws(new TypeError, function() {
+            new MediaRecorder(null);
+        });
+        assert_throws(new TypeError, function() {
+            new MediaRecorder(undefined);
+        });
+    }, "The MediaStream argument is required");
+
+    test(function() {
+        var context = new AudioContext();
+        var dest = context.createMediaStreamDestination();
+        var recorder = new MediaRecorder(dest.stream);
+        assert_equals(recorder.state, "inactive");
+    }, "The MediaStream instance's state attribute is set.");
+</script>
index cce6dc5..7fb95d6 100644 (file)
@@ -4212,3 +4212,9 @@ webkit.org/b/190032 legacy-animation-engine/transitions/transition-hit-test.html
 webkit.org/b/190032 css3/filters/composited-during-animation-layertree.html [ Pass Failure ]
 webkit.org/b/190032 transitions/clip-path-transitions.html [ Pass Failure ]
 webkit.org/b/190032 legacy-animation-engine/animations/stacking-context-unchanged-while-running.html [ Pass ImageOnlyFailure ]
+
+# MediaRecorder is not enabled on Windows
+imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html [ Skip ]
+imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html [ Skip ]
+fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext.html [ Skip ]
+
index a2b7946..9cd99af 100644 (file)
@@ -38,6 +38,7 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/Modules/mediasession"
     "${WEBCORE_DIR}/Modules/mediasource"
     "${WEBCORE_DIR}/Modules/mediastream"
+    "${WEBCORE_DIR}/Modules/mediarecorder"
     "${WEBCORE_DIR}/Modules/navigatorcontentutils"
     "${WEBCORE_DIR}/Modules/notifications"
     "${WEBCORE_DIR}/Modules/paymentrequest"
@@ -175,6 +176,7 @@ set(WebCore_IDL_INCLUDES
     Modules/geolocation
     Modules/indexeddb
     Modules/mediacapabilities
+    Modules/mediarecorder
     Modules/mediasession
     Modules/mediastream
     Modules/notifications
@@ -277,6 +279,9 @@ set(WebCore_NON_SVG_IDL_FILES
 
     Modules/mediacontrols/MediaControlsHost.idl
 
+    Modules/mediarecorder/BlobEvent.idl
+    Modules/mediarecorder/MediaRecorder.idl
+
     Modules/mediasession/HTMLMediaElementMediaSession.idl
     Modules/mediasession/MediaRemoteControls.idl
     Modules/mediasession/MediaSession.idl
index 4d385e7..cf92228 100644 (file)
@@ -1,3 +1,39 @@
+2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
+
+        runtime flag and IDL for MediaRecorder
+        https://bugs.webkit.org/show_bug.cgi?id=190018
+
+        Reviewed by Youenn Fablet and Chris Dumez.
+
+        Covered by tests:
+        imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
+        imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
+
+        Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Modules/mediarecorder/BlobEvent.h:
+        (WebCore::BlobEvent::create):
+        (WebCore::BlobEvent:::Event):
+        * Modules/mediarecorder/BlobEvent.idl:
+        * Modules/mediarecorder/MediaRecorder.cpp:
+        (WebCore::MediaRecorder::create):
+        (WebCore::MediaRecorder::MediaRecorder):
+        (WebCore::MediaRecorder::activeDOMObjectName const):
+        (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
+        * Modules/mediarecorder/MediaRecorder.h: Added.
+        (WebCore::MediaRecorder::state const):
+        (WebCore::MediaRecorder::~MediaRecorder):
+        * Modules/mediarecorder/MediaRecorder.idl:
+        * Modules/mediastream/RTCRtpReceiver.cpp:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
+        (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
+
 2018-10-04  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r236803.
index 360fde7..82f6458 100644 (file)
@@ -47,6 +47,7 @@ VPATH = \
     $(WebCore)/Modules/mediasession \
     $(WebCore)/Modules/mediasource \
     $(WebCore)/Modules/mediastream \
+       $(WebCore)/Modules/mediarecorder \
     $(WebCore)/Modules/notifications \
     $(WebCore)/Modules/paymentrequest \
     $(WebCore)/Modules/plugins \
@@ -202,6 +203,8 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/mediacapabilities/ScreenLuminance.idl \
     $(WebCore)/Modules/mediacapabilities/VideoConfiguration.idl \
     $(WebCore)/Modules/mediacontrols/MediaControlsHost.idl \
+       $(WebCore)/Modules/mediarecorder/BlobEvent.idl \
+       $(WebCore)/Modules/mediarecorder/MediaRecorder.idl \
     $(WebCore)/Modules/mediasession/HTMLMediaElementMediaSession.idl \
     $(WebCore)/Modules/mediasession/MediaRemoteControls.idl \
     $(WebCore)/Modules/mediasession/MediaSession.idl \
diff --git a/Source/WebCore/Modules/mediarecorder/BlobEvent.h b/Source/WebCore/Modules/mediarecorder/BlobEvent.h
new file mode 100644 (file)
index 0000000..09d049f
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2018 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 met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Event.h"
+
+namespace WebCore {
+    
+class Blob;
+    
+class BlobEvent final : public Event {
+public:
+    struct Init : EventInit {
+        RefPtr<Blob> data;
+        double timecode;
+    };
+    
+    static Ref<BlobEvent> create(const AtomicString& type, Init&& init, IsTrusted isTrusted = IsTrusted::No)
+    {
+        return adoptRef(*new BlobEvent(type, WTFMove(init), isTrusted));
+    }
+
+private:
+    BlobEvent(const AtomicString& type, Init&& init, IsTrusted isTrusted)
+        : Event(type, WTFMove(init), isTrusted)
+    {
+    }
+};
+    
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/Modules/mediarecorder/BlobEvent.idl b/Source/WebCore/Modules/mediarecorder/BlobEvent.idl
new file mode 100644 (file)
index 0000000..22c73c5
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 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 met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef double DOMHighResTimeStamp;
+
+[
+    Conditional=MEDIA_STREAM,
+    Constructor(DOMString type, BlobEventInit eventInitDict),
+    EnabledAtRuntime=MediaRecorder,
+    Exposed=Window
+]  interface BlobEvent : Event {
+    // FIXME: Implement these:
+    // [SameObject] readonly attribute Blob data;
+    // readonly attribute DOMHighResTimeStamp timecode;
+};
+
+dictionary BlobEventInit : EventInit {
+    required Blob data;
+    DOMHighResTimeStamp timecode;
+};
diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
new file mode 100644 (file)
index 0000000..627c9e4
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2018 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 met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+#include "MediaRecorder.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Document.h"
+#include "MediaStream.h"
+
+namespace WebCore {
+
+Ref<MediaRecorder> MediaRecorder::create(Document& document, Ref<MediaStream>&& stream, Options&& options)
+{
+    auto recorder = adoptRef(*new MediaRecorder(document, WTFMove(stream), WTFMove(options)));
+    recorder->suspendIfNeeded();
+    return recorder;
+}
+
+MediaRecorder::MediaRecorder(Document& document, Ref<MediaStream>&& stream, Options&& option)
+    : ActiveDOMObject(&document)
+    , m_options(WTFMove(option))
+    , m_stream(WTFMove(stream))
+{
+}
+
+const char* MediaRecorder::activeDOMObjectName() const
+{
+    return "MediaRecorder";
+}
+
+bool MediaRecorder::canSuspendForDocumentSuspension() const
+{
+    return false; // FIXME: We should do better here as this prevents entering PageCache.
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h
new file mode 100644 (file)
index 0000000..4f88cc4
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2018 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 met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(MEDIA_STREAM)
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+
+namespace WebCore {
+
+class Document;
+class MediaStream;
+
+class MediaRecorder final : public ActiveDOMObject, public RefCounted<MediaRecorder>, public EventTargetWithInlineData {
+public:
+    enum class RecordingState { Inactive, Recording, Paused };
+    
+    struct Options {
+        String mimeType;
+        unsigned audioBitsPerSecond;
+        unsigned videoBitsPerSecond;
+        unsigned bitsPerSecond;
+    };
+    
+    static Ref<MediaRecorder> create(Document&, Ref<MediaStream>&&, Options&& = { });
+    
+    RecordingState state() const { return m_state; }
+    
+    using RefCounted::ref;
+    using RefCounted::deref;
+    
+private:
+    MediaRecorder(Document&, Ref<MediaStream>&&, Options&& = { });
+    
+    // EventTarget
+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
+    EventTargetInterface eventTargetInterface() const final { return MediaStreamEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
+
+    // ActiveDOMObject API.
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+    
+    Options m_options;
+    Ref<MediaStream> m_stream;
+    RecordingState m_state { RecordingState::Inactive };
+};
+    
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.idl b/Source/WebCore/Modules/mediarecorder/MediaRecorder.idl
new file mode 100644 (file)
index 0000000..a3bcdae
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2018 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 met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+enum RecordingState { "inactive", "recording", "paused" };
+
+[
+    ActiveDOMObject,
+    Conditional=MEDIA_STREAM,
+    Constructor(MediaStream stream, optional MediaRecorderOptions options),
+    ConstructorCallWith=Document,
+    EnabledAtRuntime=MediaRecorder,
+    Exposed=Window
+] interface MediaRecorder : EventTarget {
+    readonly attribute RecordingState state;
+    // FIXME: Implement these:
+    // readonly attribute MediaStream stream;
+    // readonly attribute DOMString mimeType;
+    // attribute EventHandler onstart;
+    // attribute EventHandler onstop;
+    // attribute EventHandler ondataavailable;
+    // attribute EventHandler onpause;
+    // attribute EventHandler onresume;
+    // attribute EventHandler onerror;
+    // readonly attribute unsigned long videoBitsPerSecond;
+    // readonly attribute unsigned long audioBitsPerSecond;
+
+    // void start(optional long timeslice);
+    // void stop();
+    // void pause();
+    // void resume();
+    // void requestData();
+
+    // static boolean isTypeSupported(DOMString type);
+};
+
+dictionary MediaRecorderOptions {
+    DOMString mimeType;
+    unsigned long audioBitsPerSecond;
+    unsigned long videoBitsPerSecond;
+    unsigned long bitsPerSecond;
+};
index fb01e9c..2e6ddc4 100644 (file)
@@ -32,6 +32,7 @@
 #include "RTCRtpReceiver.h"
 
 #if ENABLE(WEB_RTC)
+#include "PeerConnectionBackend.h"
 
 namespace WebCore {
 
index 6f67e57..339fd0d 100644 (file)
@@ -140,6 +140,8 @@ Modules/mediacapabilities/NavigatorMediaCapabilities.cpp
 
 Modules/mediacontrols/MediaControlsHost.cpp
 
+Modules/mediarecorder/MediaRecorder.cpp
+
 Modules/mediasession/HTMLMediaElementMediaSession.cpp
 Modules/mediasession/MediaRemoteControls.cpp
 Modules/mediasession/MediaSession.cpp
@@ -2438,6 +2440,7 @@ JSBeforeUnloadEvent.cpp
 JSBiquadFilterNode.cpp
 JSBlob.cpp
 JSBlobCallback.cpp
+JSBlobEvent.cpp
 JSBlobLineEndings.cpp
 JSBlobPropertyBag.cpp
 JSByteLengthQueuingStrategy.cpp
@@ -2762,6 +2765,7 @@ JSMediaError.cpp
 JSMediaList.cpp
 JSMediaQueryList.cpp
 JSMediaQueryListListener.cpp
+JSMediaRecorder.cpp
 JSMediaRemoteControls.cpp
 JSMediaSession.cpp
 JSMediaSource.cpp
index 51a23c5..f50ec65 100644 (file)
                4BDA3FFE2151B6F500FD6604 /* DOMCSSCustomPropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */; };
                4BDA3FFF2151B6F500FD6604 /* DOMCSSRegisterCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */; };
                4BDA40012151B6F500FD6604 /* CSSRegisteredCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               4D3B00AB215D69A70076B983 /* MediaRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B00A9215D69A70076B983 /* MediaRecorder.h */; };
+               4D3B00AF215D6A690076B983 /* BlobEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B00AD215D6A690076B983 /* BlobEvent.h */; };
                4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959200A39DABA00220FE5 /* MediaFeatureNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959240A39DACC00220FE5 /* MediaQuery.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959260A39DACC00220FE5 /* MediaQueryEvaluator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSRegisterCustomProperty.h; sourceTree = "<group>"; };
                4BDA3FFA2151B6F300FD6604 /* DOMCSSCustomPropertyDescriptor.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSCustomPropertyDescriptor.idl; sourceTree = "<group>"; };
                4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSRegisteredCustomProperty.h; sourceTree = "<group>"; };
+               4D3B00A4215D61040076B983 /* MediaRecorder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaRecorder.idl; sourceTree = "<group>"; };
+               4D3B00A6215D645B0076B983 /* BlobEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobEvent.idl; sourceTree = "<group>"; };
+               4D3B00A8215D69A60076B983 /* MediaRecorder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRecorder.cpp; sourceTree = "<group>"; };
+               4D3B00A9215D69A70076B983 /* MediaRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRecorder.h; sourceTree = "<group>"; };
+               4D3B00AD215D6A690076B983 /* BlobEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobEvent.h; sourceTree = "<group>"; };
                4E19591F0A39DABA00220FE5 /* MediaFeatureNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaFeatureNames.cpp; sourceTree = "<group>"; };
                4E1959200A39DABA00220FE5 /* MediaFeatureNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaFeatureNames.h; sourceTree = "<group>"; };
                4E1959230A39DACC00220FE5 /* MediaQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQuery.cpp; sourceTree = "<group>"; };
                        path = animation;
                        sourceTree = "<group>";
                };
+               4D3B00A0215D5C0F0076B983 /* mediarecorder */ = {
+                       isa = PBXGroup;
+                       children = (
+                               4D3B00AD215D6A690076B983 /* BlobEvent.h */,
+                               4D3B00A6215D645B0076B983 /* BlobEvent.idl */,
+                               4D3B00A8215D69A60076B983 /* MediaRecorder.cpp */,
+                               4D3B00A9215D69A70076B983 /* MediaRecorder.h */,
+                               4D3B00A4215D61040076B983 /* MediaRecorder.idl */,
+                       );
+                       path = mediarecorder;
+                       sourceTree = "<group>";
+               };
                510310421BA8C64C003329C0 /* client */ = {
                        isa = PBXGroup;
                        children = (
                                9712A55315004E3C0048AF10 /* indexeddb */,
                                CDBD3D271FE85C920012C545 /* mediacapabilities */,
                                CD9A37F517C7D93600C5FA7A /* mediacontrols */,
+                               4D3B00A0215D5C0F0076B983 /* mediarecorder */,
                                0709D78B1AE5552E004E42F8 /* mediasession */,
                                B1A942DD15B5CE2200D525D1 /* mediasource */,
                                07221B4617CEC32700848E51 /* mediastream */,
                                A15D75161E68F7C800A35FBC /* BlobCallback.h in Headers */,
                                2EDEF1F4121B0EFC00726DB2 /* BlobData.h in Headers */,
                                E1D31CDD19196020001005A3 /* BlobDataFileReference.h in Headers */,
+                               4D3B00AF215D6A690076B983 /* BlobEvent.h in Headers */,
                                7C77C3D71DEF850A00A50BFA /* BlobLineEndings.h in Headers */,
                                E1C94AF9191303F000D5A893 /* BlobPart.h in Headers */,
                                7C77C3D11DEE472400A50BFA /* BlobPropertyBag.h in Headers */,
                                D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
                                9493B6C11D74B4120088E780 /* MediaQueryParser.h in Headers */,
                                4471710E205AF945000A116E /* MediaQueryParserContext.h in Headers */,
+                               4D3B00AB215D69A70076B983 /* MediaRecorder.h in Headers */,
                                C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
                                CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
                                CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
index a035b33..c852414 100644 (file)
@@ -43,6 +43,7 @@ namespace WebCore {
     macro(AuthenticatorAssertionResponse) \
     macro(AuthenticatorAttestationResponse) \
     macro(AuthenticatorResponse) \
+    macro(BlobEvent) \
     macro(Cache) \
     macro(CacheStorage) \
     macro(Client) \
@@ -97,6 +98,7 @@ namespace WebCore {
     macro(MediaKeyStatusMap) \
     macro(MediaKeySystemAccess) \
     macro(MediaKeys) \
+    macro(MediaRecorder) \
     macro(MediaSource) \
     macro(MediaStream) \
     macro(MediaStreamTrack) \
index e5a9ac3..71e62e5 100644 (file)
@@ -181,6 +181,8 @@ public:
 #endif
 
 #if ENABLE(MEDIA_STREAM)
+    bool mediaRecorderEnabled() const { return m_isMediaRecorderEnabled; }
+    void setMediaRecorderEnabled(bool isEnabled) { m_isMediaRecorderEnabled = isEnabled; }
     bool mediaDevicesEnabled() const { return m_isMediaDevicesEnabled; }
     void setMediaDevicesEnabled(bool isEnabled) { m_isMediaDevicesEnabled = isEnabled; }
     bool mediaStreamEnabled() const { return m_isMediaStreamEnabled; }
@@ -344,6 +346,7 @@ private:
 #endif
 
 #if ENABLE(MEDIA_STREAM)
+    bool m_isMediaRecorderEnabled { false };
     bool m_isMediaDevicesEnabled { false };
     bool m_isMediaStreamEnabled { true };
     bool m_isScreenCaptureEnabled { false };
index 563dbbd..d5a12ba 100644 (file)
@@ -1,3 +1,12 @@
+2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
+
+        runtime flag and IDL for MediaRecorder
+        https://bugs.webkit.org/show_bug.cgi?id=190018
+
+        Reviewed by Youenn Fablet and Chris Dumez.
+
+        * Shared/WebPreferences.yaml:
+
 2018-10-03  Dan Bernstein  <mitz@apple.com>
 
         Tried to fix non-Cocoa, ENABLE(ATTACHMENT_ELEMENT) builds after r236822.
index 169f922..9c99b65 100644 (file)
@@ -459,6 +459,15 @@ UseGiantTiles:
   type: bool
   defaultValue: false
 
+MediaRecorderEnabled:
+    type: bool
+    defaultValue: false
+    webcoreBinding: RuntimeEnabledFeatures
+    condition: ENABLE(MEDIA_STREAM)
+    humanReadableName: "MediaRecorder"
+    humanReadableDescription: "MediaRecorder"
+    category: experimental
+
 MediaDevicesEnabled:
   type: bool
   defaultValue: false
index d3b6c92..3cf3160 100644 (file)
@@ -1,3 +1,19 @@
+2018-10-04  YUHAN WU  <yuhan_wu@apple.com>
+
+        Runtime flag and IDL for MediaRecorder
+        https://bugs.webkit.org/show_bug.cgi?id=190018
+
+        Reviewed by Youenn Fablet and Chris Dumez.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences mediaRecorderEnabled]):
+        (-[WebPreferences setMediaRecorderEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
 
         Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
index 76bd412..b89fff6 100644 (file)
 #define WebKitAccessibilityObjectModelEnabledPreferenceKey @"WebKitAccessibilityObjectModelEnabled"
 #define WebKitAriaReflectionEnabledPreferenceKey @"WebKitAriaReflectionEnabled"
 #define WebKitMediaCapabilitiesEnabledPreferenceKey @"WebKitMediaCapabilitiesEnabled"
+#define WebKitMediaRecorderEnabledPreferenceKey @"WebKitMediaRecorderEnabled"
 #define WebKitServerTimingEnabledPreferenceKey @"WebKitServerTimingEnabled"
 #define WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey @"WebKitSelectionAcrossShadowBoundariesEnabled"
index cf2b91b..c66fa95 100644 (file)
@@ -659,6 +659,7 @@ public:
 #if ENABLE(MEDIA_STREAM)
         [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitMediaStreamEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES], WebKitMediaRecorderEnabledPreferenceKey,
 #endif
 #if ENABLE(WEB_RTC)
         [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
@@ -3345,6 +3346,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
 }
 
+- (BOOL)mediaRecorderEnabled
+{
+    return [self _boolValueForKey:WebKitMediaRecorderEnabledPreferenceKey];
+}
+
+- (void)setMediaRecorderEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitMediaRecorderEnabledPreferenceKey];
+}
+
 - (BOOL)serverTimingEnabled
 {
     return [self _boolValueForKey:WebKitServerTimingEnabledPreferenceKey];
index 94e79c7..470a6fd 100644 (file)
@@ -611,6 +611,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 @property (nonatomic) BOOL accessibilityObjectModelEnabled;
 @property (nonatomic) BOOL ariaReflectionEnabled;
 @property (nonatomic) BOOL mediaCapabilitiesEnabled;
+@property (nonatomic) BOOL mediaRecorderEnabled;
 @property (nonatomic) BOOL allowCrossOriginSubresourcesToAskForCredentials;
 @property (nonatomic) BOOL sourceBufferChangeTypeEnabled;
 
index a530a08..72d9c0d 100644 (file)
@@ -3048,6 +3048,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(true);
     RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(false);
     RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled(false);
+    RuntimeEnabledFeatures::sharedFeatures().setMediaRecorderEnabled(preferences.mediaRecorderEnabled);
 #endif
 
 #if ENABLE(WEB_RTC)
index 1b887fd..aabf6e9 100644 (file)
@@ -1,3 +1,13 @@
+2018-10-04  YUHAN WU  <yuhan_wu@apple.com>
+
+        Runtime flag and IDL for MediaRecorder
+        https://bugs.webkit.org/show_bug.cgi?id=190018
+
+        Reviewed by Youenn Fablet and Chris Dumez.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+
 2018-10-04  Basuke Suzuki  <Basuke.Suzuki@sony.com>
 
         [LayoutTests][Win] Stop wpt server correctly.
index bd3df04..0bbad3c 100644 (file)
@@ -869,6 +869,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setIntersectionObserverEnabled:YES];
     preferences.sourceBufferChangeTypeEnabled = YES;
     [preferences setCSSOMViewScrollingAPIEnabled:YES];
+    [preferences setMediaRecorderEnabled:YES];
 }
 
 // Called before each test.