Title: [206208] trunk
Revision
206208
Author
jer.no...@apple.com
Date
2016-09-21 09:12:33 -0700 (Wed, 21 Sep 2016)

Log Message

[media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
https://bugs.webkit.org/show_bug.cgi?id=162299

Reviewed by Eric Carlson.

Source/WebCore:

URL.createObjectURL() should not take an optional parameter (nor return an optional String).
(Ref: https://w3c.github.io/FileAPI/#dfn-createObjectURL)

* Modules/mediasource/DOMURLMediaSource.cpp:
(WebCore::DOMURLMediaSource::createObjectURL):
* Modules/mediasource/DOMURLMediaSource.h:
* Modules/mediasource/DOMURLMediaSource.idl:
* Modules/mediasource/MediaSourceRegistry.cpp:
(WebCore::MediaSourceRegistry::registerURL):
* Modules/mediasource/MediaSourceRegistry.h:
* Modules/mediastream/DOMURLMediaStream.cpp:
(WebCore::DOMURLMediaStream::createObjectURL):
* Modules/mediastream/DOMURLMediaStream.h:
* Modules/mediastream/DOMURLMediaStream.idl:
* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::registerURL):
* Modules/mediastream/MediaStreamRegistry.h:
* fileapi/Blob.cpp:
(WebCore::BlobURLRegistry::registerURL):
* html/DOMURL.cpp:
(WebCore::DOMURL::createObjectURL):
(WebCore::DOMURL::createPublicURL):
* html/DOMURL.h:
* html/DOMURL.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject):
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::registerURL):
* html/PublicURLManager.h:
* html/URLRegistry.h:

LayoutTests:

* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206207 => 206208)


--- trunk/LayoutTests/ChangeLog	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/LayoutTests/ChangeLog	2016-09-21 16:12:33 UTC (rev 206208)
@@ -1,3 +1,12 @@
+2016-09-20  Jer Noble  <jer.no...@apple.com>
+
+        [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
+        https://bugs.webkit.org/show_bug.cgi?id=162299
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/TestExpectations:
+
 2016-09-21  Youenn Fablet  <you...@apple.com>
 
         [Fetch] Align Accept header default values with fetch spec

Modified: trunk/LayoutTests/platform/mac/TestExpectations (206207 => 206208)


--- trunk/LayoutTests/platform/mac/TestExpectations	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2016-09-21 16:12:33 UTC (rev 206208)
@@ -1043,6 +1043,7 @@
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/SourceBuffer-abort-updating.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/SourceBuffer-abort.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/URL-createObjectURL.html [ Pass ]
+[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-mode.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-appendwindow.html [ Pass ]

Modified: trunk/Source/WebCore/ChangeLog (206207 => 206208)


--- trunk/Source/WebCore/ChangeLog	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/ChangeLog	2016-09-21 16:12:33 UTC (rev 206208)
@@ -1,3 +1,41 @@
+2016-09-20  Jer Noble  <jer.no...@apple.com>
+
+        [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
+        https://bugs.webkit.org/show_bug.cgi?id=162299
+
+        Reviewed by Eric Carlson.
+
+        URL.createObjectURL() should not take an optional parameter (nor return an optional String). 
+        (Ref: https://w3c.github.io/FileAPI/#dfn-createObjectURL)
+
+        * Modules/mediasource/DOMURLMediaSource.cpp:
+        (WebCore::DOMURLMediaSource::createObjectURL):
+        * Modules/mediasource/DOMURLMediaSource.h:
+        * Modules/mediasource/DOMURLMediaSource.idl:
+        * Modules/mediasource/MediaSourceRegistry.cpp:
+        (WebCore::MediaSourceRegistry::registerURL):
+        * Modules/mediasource/MediaSourceRegistry.h:
+        * Modules/mediastream/DOMURLMediaStream.cpp:
+        (WebCore::DOMURLMediaStream::createObjectURL):
+        * Modules/mediastream/DOMURLMediaStream.h:
+        * Modules/mediastream/DOMURLMediaStream.idl:
+        * Modules/mediastream/MediaStreamRegistry.cpp:
+        (WebCore::MediaStreamRegistry::registerURL):
+        * Modules/mediastream/MediaStreamRegistry.h:
+        * fileapi/Blob.cpp:
+        (WebCore::BlobURLRegistry::registerURL):
+        * html/DOMURL.cpp:
+        (WebCore::DOMURL::createObjectURL):
+        (WebCore::DOMURL::createPublicURL):
+        * html/DOMURL.h:
+        * html/DOMURL.idl:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setSrcObject):
+        * html/PublicURLManager.cpp:
+        (WebCore::PublicURLManager::registerURL):
+        * html/PublicURLManager.h:
+        * html/URLRegistry.h:
+
 2016-09-21  Youenn Fablet  <you...@apple.com>
 
         [Fetch] Align Accept header default values with fetch spec

Modified: trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.cpp (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -39,13 +39,10 @@
 
 namespace WebCore {
 
-String DOMURLMediaSource::createObjectURL(ScriptExecutionContext& scriptExecutionContext, MediaSource* source)
+String DOMURLMediaSource::createObjectURL(ScriptExecutionContext& scriptExecutionContext, MediaSource& source)
 {
     // Since WebWorkers cannot obtain MediaSource objects, we should be on the main thread.
     ASSERT(isMainThread());
-
-    if (!source)
-        return String();
     return DOMURL::createPublicURL(scriptExecutionContext, source);
 }
 

Modified: trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.h (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -42,7 +42,7 @@
 
 class DOMURLMediaSource {
 public:
-    static String createObjectURL(ScriptExecutionContext&, MediaSource*);
+    static String createObjectURL(ScriptExecutionContext&, MediaSource&);
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.idl (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.idl	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediasource/DOMURLMediaSource.idl	2016-09-21 16:12:33 UTC (rev 206208)
@@ -31,5 +31,5 @@
     Conditional=MEDIA_SOURCE
 ]
 partial interface DOMURL {
-    [CallWith=ScriptExecutionContext] static DOMString? createObjectURL(MediaSource? source);
+    [CallWith=ScriptExecutionContext] static DOMString createObjectURL(MediaSource source);
 };

Modified: trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -46,14 +46,14 @@
     return instance;
 }
 
-void MediaSourceRegistry::registerURL(SecurityOrigin*, const URL& url, URLRegistrable* registrable)
+void MediaSourceRegistry::registerURL(SecurityOrigin*, const URL& url, URLRegistrable& registrable)
 {
-    ASSERT(&registrable->registry() == this);
+    ASSERT(&registrable.registry() == this);
     ASSERT(isMainThread());
 
-    MediaSource* source = static_cast<MediaSource*>(registrable);
-    source->addedToRegistry();
-    m_mediaSources.set(url.string(), source);
+    MediaSource& source = static_cast<MediaSource&>(registrable);
+    source.addedToRegistry();
+    m_mediaSources.set(url.string(), &source);
 }
 
 void MediaSourceRegistry::unregisterURL(const URL& url)

Modified: trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -50,7 +50,7 @@
     static MediaSourceRegistry& registry();
 
     // Registers a blob URL referring to the specified media source.
-    void registerURL(SecurityOrigin*, const URL&, URLRegistrable*) override;
+    void registerURL(SecurityOrigin*, const URL&, URLRegistrable&) override;
     void unregisterURL(const URL&) override;
     URLRegistrable* lookup(const String&) const override;
 

Modified: trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.cpp (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -40,13 +40,10 @@
 
 namespace WebCore {
 
-String DOMURLMediaStream::createObjectURL(ScriptExecutionContext& scriptExecutionContext, MediaStream* stream)
+String DOMURLMediaStream::createObjectURL(ScriptExecutionContext& scriptExecutionContext, MediaStream& stream)
 {
     // Since WebWorkers cannot obtain Stream objects, we should be on the main thread.
     ASSERT(isMainThread());
-
-    if (!stream)
-        return String();
     return DOMURL::createPublicURL(scriptExecutionContext, stream);
 }
 

Modified: trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.h (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -42,7 +42,7 @@
 
 class DOMURLMediaStream {
 public:
-    static String createObjectURL(ScriptExecutionContext&, MediaStream*);
+    static String createObjectURL(ScriptExecutionContext&, MediaStream&);
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.idl (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.idl	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediastream/DOMURLMediaStream.idl	2016-09-21 16:12:33 UTC (rev 206208)
@@ -31,5 +31,5 @@
     Conditional=MEDIA_STREAM
 ]
 partial interface DOMURL {
-    [CallWith=ScriptExecutionContext] static DOMString? createObjectURL(MediaStream? stream);
+    [CallWith=ScriptExecutionContext] static DOMString createObjectURL(MediaStream stream);
 };

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -43,11 +43,11 @@
     return instance;
 }
 
-void MediaStreamRegistry::registerURL(SecurityOrigin*, const URL& url, URLRegistrable* stream)
+void MediaStreamRegistry::registerURL(SecurityOrigin*, const URL& url, URLRegistrable& stream)
 {
-    ASSERT(&stream->registry() == this);
+    ASSERT(&stream.registry() == this);
     ASSERT(isMainThread());
-    m_mediaStreams.set(url.string(), static_cast<MediaStream*>(stream));
+    m_mediaStreams.set(url.string(), static_cast<MediaStream*>(&stream));
 }
 
 void MediaStreamRegistry::unregisterURL(const URL& url)

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h (206207 => 206208)


--- trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -46,7 +46,7 @@
     static MediaStreamRegistry& shared();
 
     // Registers a blob URL referring to the specified stream data.
-    void registerURL(SecurityOrigin*, const URL&, URLRegistrable*) override;
+    void registerURL(SecurityOrigin*, const URL&, URLRegistrable&) override;
     void unregisterURL(const URL&) override;
 
     URLRegistrable* lookup(const String&) const override;

Modified: trunk/Source/WebCore/fileapi/Blob.cpp (206207 => 206208)


--- trunk/Source/WebCore/fileapi/Blob.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/fileapi/Blob.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -42,7 +42,7 @@
 
 class BlobURLRegistry final : public URLRegistry {
 public:
-    void registerURL(SecurityOrigin*, const URL&, URLRegistrable*) override;
+    void registerURL(SecurityOrigin*, const URL&, URLRegistrable&) override;
     void unregisterURL(const URL&) override;
 
     static URLRegistry& registry();
@@ -49,10 +49,10 @@
 };
 
 
-void BlobURLRegistry::registerURL(SecurityOrigin* origin, const URL& publicURL, URLRegistrable* blob)
+void BlobURLRegistry::registerURL(SecurityOrigin* origin, const URL& publicURL, URLRegistrable& blob)
 {
-    ASSERT(&blob->registry() == this);
-    ThreadableBlobRegistry::registerBlobURL(origin, publicURL, static_cast<Blob*>(blob)->url());
+    ASSERT(&blob.registry() == this);
+    ThreadableBlobRegistry::registerBlobURL(origin, publicURL, static_cast<Blob&>(blob).url());
 }
 
 void BlobURLRegistry::unregisterURL(const URL& url)

Modified: trunk/Source/WebCore/html/DOMURL.cpp (206207 => 206208)


--- trunk/Source/WebCore/html/DOMURL.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/DOMURL.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -103,14 +103,12 @@
         ec = TypeError;
 }
 
-String DOMURL::createObjectURL(ScriptExecutionContext& scriptExecutionContext, Blob* blob)
+String DOMURL::createObjectURL(ScriptExecutionContext& scriptExecutionContext, Blob& blob)
 {
-    if (!blob)
-        return String();
     return createPublicURL(scriptExecutionContext, blob);
 }
 
-String DOMURL::createPublicURL(ScriptExecutionContext& scriptExecutionContext, URLRegistrable* registrable)
+String DOMURL::createPublicURL(ScriptExecutionContext& scriptExecutionContext, URLRegistrable& registrable)
 {
     URL publicURL = BlobURL::createPublicURL(scriptExecutionContext.securityOrigin());
     if (publicURL.isEmpty())

Modified: trunk/Source/WebCore/html/DOMURL.h (206207 => 206208)


--- trunk/Source/WebCore/html/DOMURL.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/DOMURL.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -54,10 +54,10 @@
 
     URLSearchParams& searchParams();
 
-    static String createObjectURL(ScriptExecutionContext&, Blob*);
+    static String createObjectURL(ScriptExecutionContext&, Blob&);
     static void revokeObjectURL(ScriptExecutionContext&, const String&);
 
-    static String createPublicURL(ScriptExecutionContext&, URLRegistrable*);
+    static String createPublicURL(ScriptExecutionContext&, URLRegistrable&);
 private:
     DOMURL(const String& url, const String& base, ExceptionCode&);
     DOMURL(const String& url, const DOMURL& base, ExceptionCode&);

Modified: trunk/Source/WebCore/html/DOMURL.idl (206207 => 206208)


--- trunk/Source/WebCore/html/DOMURL.idl	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/DOMURL.idl	2016-09-21 16:12:33 UTC (rev 206208)
@@ -36,7 +36,7 @@
     ImplementationLacksVTable,
     ExportMacro=WEBCORE_EXPORT,
 ] interface DOMURL {
-    [CallWith=ScriptExecutionContext] static DOMString? createObjectURL(Blob? blob); // FIXME: The return value and the parameter should not be nullable.
+    [CallWith=ScriptExecutionContext] static DOMString createObjectURL(Blob blob);
     [CallWith=ScriptExecutionContext] static void revokeObjectURL(DOMString url);
 };
 

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (206207 => 206208)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -1095,7 +1095,7 @@
 
     m_mediaStreamSrcObject = mediaStream;
     if (mediaStream)
-        setSrc(DOMURL::createPublicURL(context, mediaStream));
+        setSrc(DOMURL::createPublicURL(context, *mediaStream));
 }
 #endif
 

Modified: trunk/Source/WebCore/html/PublicURLManager.cpp (206207 => 206208)


--- trunk/Source/WebCore/html/PublicURLManager.cpp	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/PublicURLManager.cpp	2016-09-21 16:12:33 UTC (rev 206208)
@@ -45,12 +45,12 @@
 {
 }
 
-void PublicURLManager::registerURL(SecurityOrigin* origin, const URL& url, URLRegistrable* registrable)
+void PublicURLManager::registerURL(SecurityOrigin* origin, const URL& url, URLRegistrable& registrable)
 {
     if (m_isStopped)
         return;
 
-    RegistryURLMap::iterator found = m_registryToURL.add(&registrable->registry(), URLSet()).iterator;
+    RegistryURLMap::iterator found = m_registryToURL.add(&registrable.registry(), URLSet()).iterator;
     found->key->registerURL(origin, url, registrable);
     found->value.add(url.string());
 }

Modified: trunk/Source/WebCore/html/PublicURLManager.h (206207 => 206208)


--- trunk/Source/WebCore/html/PublicURLManager.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/PublicURLManager.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -47,7 +47,7 @@
 
     static std::unique_ptr<PublicURLManager> create(ScriptExecutionContext*);
 
-    void registerURL(SecurityOrigin*, const URL&, URLRegistrable*);
+    void registerURL(SecurityOrigin*, const URL&, URLRegistrable&);
     void revoke(const URL&);
 
 private:

Modified: trunk/Source/WebCore/html/URLRegistry.h (206207 => 206208)


--- trunk/Source/WebCore/html/URLRegistry.h	2016-09-21 12:39:10 UTC (rev 206207)
+++ trunk/Source/WebCore/html/URLRegistry.h	2016-09-21 16:12:33 UTC (rev 206208)
@@ -49,7 +49,7 @@
     WTF_MAKE_FAST_ALLOCATED;
 public:
     virtual ~URLRegistry() { }
-    virtual void registerURL(SecurityOrigin*, const URL&, URLRegistrable*) = 0;
+    virtual void registerURL(SecurityOrigin*, const URL&, URLRegistrable&) = 0;
     virtual void unregisterURL(const URL&) = 0;
 
     // This is an optional API
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to