Title: [197706] trunk/Source
Revision
197706
Author
[email protected]
Date
2016-03-07 14:17:58 -0800 (Mon, 07 Mar 2016)

Log Message

Cleanup: Add convenience function URL::procotolIsBlob()
https://bugs.webkit.org/show_bug.cgi?id=155127
<rdar://problem/25016829>

Reviewed by Brent Fulgham.

Source/WebCore:

Similar to the class member function URL::protocolIsData(), add a class member function to
class URL to determine if a URL is a blob URL.

No functionality was changed. So, no new tests.

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::shouldUseInnerURL): Modified to use URL::protocolIsBlob().
(WebCore::getCachedOrigin): Ditto.
* platform/URL.h:
(WebCore::URL::protocolIsBlob): Added.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart): Modified to use URL::protocolIsBlob().
(urlHasSupportedProtocol): Ditto.
* workers/Worker.cpp:
(WebCore::Worker::didReceiveResponse): Ditto.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest): Ditto.

Source/WebKit2:

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad): Modified to use URL::protocolIsBlob().
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canHandleRequest): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (197705 => 197706)


--- trunk/Source/WebCore/ChangeLog	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebCore/ChangeLog	2016-03-07 22:17:58 UTC (rev 197706)
@@ -1,3 +1,29 @@
+2016-03-07  Daniel Bates  <[email protected]>
+
+        Cleanup: Add convenience function URL::procotolIsBlob()
+        https://bugs.webkit.org/show_bug.cgi?id=155127
+        <rdar://problem/25016829>
+
+        Reviewed by Brent Fulgham.
+
+        Similar to the class member function URL::protocolIsData(), add a class member function to
+        class URL to determine if a URL is a blob URL.
+
+        No functionality was changed. So, no new tests.
+
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::shouldUseInnerURL): Modified to use URL::protocolIsBlob().
+        (WebCore::getCachedOrigin): Ditto.
+        * platform/URL.h:
+        (WebCore::URL::protocolIsBlob): Added.
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcStart): Modified to use URL::protocolIsBlob().
+        (urlHasSupportedProtocol): Ditto.
+        * workers/Worker.cpp:
+        (WebCore::Worker::didReceiveResponse): Ditto.
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::createRequest): Ditto.
+
 2016-03-07  Adam Bergkvist  <[email protected]>
 
         WebRTC: Implement MediaEndpointPeerConnection::createOffer()

Modified: trunk/Source/WebCore/page/SecurityOrigin.cpp (197705 => 197706)


--- trunk/Source/WebCore/page/SecurityOrigin.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebCore/page/SecurityOrigin.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -56,7 +56,7 @@
 bool SecurityOrigin::shouldUseInnerURL(const URL& url)
 {
     // FIXME: Blob URLs don't have inner URLs. Their form is "blob:<inner-origin>/<UUID>", so treating the part after "blob:" as a URL is incorrect.
-    if (url.protocolIs("blob"))
+    if (url.protocolIsBlob())
         return true;
     UNUSED_PARAM(url);
     return false;
@@ -76,7 +76,7 @@
 
 static RefPtr<SecurityOrigin> getCachedOrigin(const URL& url)
 {
-    if (url.protocolIs("blob"))
+    if (url.protocolIsBlob())
         return ThreadableBlobRegistry::getCachedOrigin(url);
     return nullptr;
 }

Modified: trunk/Source/WebCore/platform/URL.h (197705 => 197706)


--- trunk/Source/WebCore/platform/URL.h	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebCore/platform/URL.h	2016-03-07 22:17:58 UTC (rev 197706)
@@ -126,6 +126,7 @@
     // Returns true if the current URL's protocol is the same as the null-
     // terminated ASCII argument. The argument must be lower-case.
     WEBCORE_EXPORT bool protocolIs(const char*) const;
+    bool protocolIsBlob() const { return protocolIs("blob"); }
     bool protocolIsData() const { return protocolIs("data"); }
     bool protocolIsInHTTPFamily() const;
     WEBCORE_EXPORT bool isLocalFile() const;

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (197705 => 197706)


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -584,7 +584,7 @@
 
     if (priv->loader) {
         PlatformMediaResourceLoader::LoadOptions loadOptions = 0;
-        if (request.url().protocolIs("blob"))
+        if (request.url().protocolIsBlob())
             loadOptions |= PlatformMediaResourceLoader::LoadOption::BufferData;
         priv->resource = priv->loader->requestResource(request, loadOptions);
         loadFailed = !priv->resource;
@@ -710,7 +710,7 @@
 
 static bool urlHasSupportedProtocol(const URL& url)
 {
-    return url.isValid() && (url.protocolIsInHTTPFamily() || url.protocolIs("blob"));
+    return url.isValid() && (url.protocolIsInHTTPFamily() || url.protocolIsBlob());
 }
 
 // uri handler interface

Modified: trunk/Source/WebCore/workers/Worker.cpp (197705 => 197706)


--- trunk/Source/WebCore/workers/Worker.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebCore/workers/Worker.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -158,7 +158,7 @@
 void Worker::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
 {
     const URL& responseURL = response.url();
-    if (!responseURL.protocolIs("blob") && !responseURL.protocolIs("file") && !SecurityOrigin::create(responseURL)->isUnique())
+    if (!responseURL.protocolIsBlob() && !responseURL.protocolIs("file") && !SecurityOrigin::create(responseURL)->isUnique())
         m_contentSecurityPolicyResponseHeaders = ContentSecurityPolicyResponseHeaders(response);
     InspectorInstrumentation::didReceiveScriptResponse(scriptExecutionContext(), identifier);
 }

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (197705 => 197706)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -709,7 +709,7 @@
 void XMLHttpRequest::createRequest(ExceptionCode& ec)
 {
     // Only GET request is supported for blob URL.
-    if (m_url.protocolIs("blob") && m_method != "GET") {
+    if (m_url.protocolIsBlob() && m_method != "GET") {
         ec = NETWORK_ERR;
         return;
     }

Modified: trunk/Source/WebKit2/ChangeLog (197705 => 197706)


--- trunk/Source/WebKit2/ChangeLog	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-07 22:17:58 UTC (rev 197706)
@@ -1,3 +1,18 @@
+2016-03-07  Daniel Bates  <[email protected]>
+
+        Cleanup: Add convenience function URL::procotolIsBlob()
+        https://bugs.webkit.org/show_bug.cgi?id=155127
+        <rdar://problem/25016829>
+
+        Reviewed by Brent Fulgham.
+
+        * NetworkProcess/NetworkLoad.cpp:
+        (WebKit::NetworkLoad::NetworkLoad): Modified to use URL::protocolIsBlob().
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::NetworkResourceLoader): Ditto.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::canHandleRequest): Ditto.
+
 2016-03-07  Simon Fraser  <[email protected]>
 
         Use CGColorSpaceCopyICCData instead of CGColorSpaceCopyICCProfile

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp (197705 => 197706)


--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -49,7 +49,7 @@
     , m_currentRequest(parameters.request)
 {
 #if USE(NETWORK_SESSION)
-    if (parameters.request.url().protocolIs("blob")) {
+    if (parameters.request.url().protocolIsBlob()) {
         m_handle = ResourceHandle::create(nullptr, parameters.request, this, parameters.defersLoading, parameters.contentSniffingPolicy == SniffContent);
         return;
     }

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (197705 => 197706)


--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -91,7 +91,7 @@
         }
     }
 
-    if (originalRequest().url().protocolIs("blob")) {
+    if (originalRequest().url().protocolIsBlob()) {
         ASSERT(!m_parameters.resourceSandboxExtension);
         m_fileReferences.appendVector(NetworkBlobRegistry::singleton().filesInBlob(connection, originalRequest().url()));
     }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197705 => 197706)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-07 21:53:48 UTC (rev 197705)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-07 22:17:58 UTC (rev 197706)
@@ -4235,7 +4235,7 @@
     if (SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(request.url().protocol()))
         return true;
 
-    if (request.url().protocolIs("blob"))
+    if (request.url().protocolIsBlob())
         return true;
 
     return platformCanHandleRequest(request);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to