[GStreamer][Soup] Remove dead getCreateOrReadBuffer code path
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jan 2018 13:53:10 +0000 (13:53 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jan 2018 13:53:10 +0000 (13:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181376

Reviewed by Carlos Garcia Campos.

This code path is no longer used now that the GStreamer HTTP
source element uses data coming directly from the network process.

* SourcesGTK.txt:
* SourcesWPE.txt:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::getOrCreateReadBuffer): Deleted.
* loader/MediaResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cache/CachedRawResource.h:
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
(WebCore::CachedRawResourceClient::getOrCreateReadBuffer): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::getOrCreateReadBuffer): Deleted.
* loader/soup/CachedRawResourceSoup.cpp: Removed.
* loader/soup/SubresourceLoaderSoup.cpp: Removed.
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::loadFinished):
(WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Deleted.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::getOrCreateReadBuffer): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::getOrCreateReadBuffer): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::ensureReadBuffer):

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

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/SourcesGTK.txt
Source/WebCore/SourcesWPE.txt
Source/WebCore/loader/MediaResourceLoader.cpp
Source/WebCore/loader/MediaResourceLoader.h
Source/WebCore/loader/SubresourceLoader.h
Source/WebCore/loader/cache/CachedRawResource.h
Source/WebCore/loader/cache/CachedRawResourceClient.h
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/soup/CachedRawResourceSoup.cpp [deleted file]
Source/WebCore/loader/soup/SubresourceLoaderSoup.cpp [deleted file]
Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
Source/WebCore/platform/network/ResourceHandleClient.h
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

index 5c34a11..9003f7b 100644 (file)
@@ -1,3 +1,37 @@
+2018-01-08  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer][Soup] Remove dead getCreateOrReadBuffer code path
+        https://bugs.webkit.org/show_bug.cgi?id=181376
+
+        Reviewed by Carlos Garcia Campos.
+
+        This code path is no longer used now that the GStreamer HTTP
+        source element uses data coming directly from the network process.
+
+        * SourcesGTK.txt:
+        * SourcesWPE.txt:
+        * loader/MediaResourceLoader.cpp:
+        (WebCore::MediaResource::getOrCreateReadBuffer): Deleted.
+        * loader/MediaResourceLoader.h:
+        * loader/SubresourceLoader.h:
+        * loader/cache/CachedRawResource.h:
+        * loader/cache/CachedRawResourceClient.h:
+        (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
+        (WebCore::CachedRawResourceClient::getOrCreateReadBuffer): Deleted.
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::getOrCreateReadBuffer): Deleted.
+        * loader/soup/CachedRawResourceSoup.cpp: Removed.
+        * loader/soup/SubresourceLoaderSoup.cpp: Removed.
+        * platform/graphics/PlatformMediaResourceLoader.h:
+        (WebCore::PlatformMediaResourceClient::loadFinished):
+        (WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Deleted.
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (CachedResourceStreamingClient::getOrCreateReadBuffer): Deleted.
+        * platform/network/ResourceHandleClient.h:
+        (WebCore::ResourceHandleClient::getOrCreateReadBuffer): Deleted.
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::ensureReadBuffer):
+
 2018-01-08  Zan Dobersek  <zdobersek@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GStreamer] use FastMalloc-based GstAllocator
index 0806db2..2fdb6c4 100644 (file)
@@ -41,9 +41,6 @@ accessibility/atk/WebKitAccessibleWrapperAtk.cpp
 
 editing/atk/FrameSelectionAtk.cpp
 
-loader/soup/CachedRawResourceSoup.cpp
-loader/soup/SubresourceLoaderSoup.cpp
-
 page/linux/ResourceUsageOverlayLinux.cpp
 page/linux/ResourceUsageThreadLinux.cpp
 
index f77e05b..604675c 100644 (file)
@@ -26,9 +26,6 @@ accessibility/wpe/AccessibilityObjectWPE.cpp
 
 editing/wpe/EditorWPE.cpp
 
-loader/soup/CachedRawResourceSoup.cpp
-loader/soup/SubresourceLoaderSoup.cpp
-
 page/linux/ResourceUsageOverlayLinux.cpp
 page/linux/ResourceUsageThreadLinux.cpp
 
index 467456d..3812b82 100644 (file)
@@ -217,14 +217,6 @@ void MediaResource::notifyFinished(CachedResource& resource)
     stop();
 }
 
-#if USE(SOUP)
-char* MediaResource::getOrCreateReadBuffer(CachedResource& resource, size_t requestedSize, size_t& actualSize)
-{
-    ASSERT_UNUSED(resource, &resource == m_resource);
-    return m_client ? m_client->getOrCreateReadBuffer(*this, requestedSize, actualSize) : nullptr;
-}
-#endif
-
 } // namespace WebCore
 
 #endif
index ea0e428..a31df18 100644 (file)
@@ -88,9 +88,6 @@ public:
     void dataSent(CachedResource&, unsigned long long, unsigned long long) override;
     void dataReceived(CachedResource&, const char*, int) override;
     void notifyFinished(CachedResource&) override;
-#if USE(SOUP)
-    char* getOrCreateReadBuffer(CachedResource&, size_t /*requestedSize*/, size_t& /*actualSize*/) override;
-#endif
 
 private:
     MediaResource(MediaResourceLoader&, CachedResourceHandle<CachedRawResource>);
index bb59114..084739d 100644 (file)
@@ -82,10 +82,6 @@ private:
 
     void releaseResources() override;
 
-#if USE(SOUP)
-    char* getOrCreateReadBuffer(size_t requestedSize, size_t& actualSize) override;
-#endif
-
     bool checkForHTTPStatusCodeError();
     bool checkResponseCrossOriginAccessControl(const ResourceResponse&, String&);
     bool checkRedirectionCrossOriginAccessControl(const ResourceRequest& previousRequest, const ResourceResponse&, ResourceRequest& newRequest, String&);
index e4583ed..9d0b08a 100644 (file)
@@ -73,10 +73,6 @@ private:
     std::optional<SharedBufferDataView> calculateIncrementalDataChunk(const SharedBuffer*) const;
     void notifyClientsDataWasReceived(const char* data, unsigned length);
 
-#if USE(SOUP)
-    char* getOrCreateReadBuffer(size_t requestedSize, size_t& actualSize) override;
-#endif
-
     unsigned long m_identifier;
     bool m_allowEncodedDataReplacement;
 
index ca8dfbe..758b7ad 100644 (file)
@@ -44,9 +44,6 @@ public:
     virtual void dataReceived(CachedResource&, const char* /* data */, int /* length */) { }
     virtual void redirectReceived(CachedResource&, ResourceRequest&& request, const ResourceResponse&, CompletionHandler<void(ResourceRequest&&)>&& completionHandler) { completionHandler(WTFMove(request)); }
     virtual void finishedTimingForWorkerLoad(CachedResource&, const ResourceTiming&) { }
-#if USE(SOUP)
-    virtual char* getOrCreateReadBuffer(CachedResource&, size_t /* requestedSize */, size_t& /* actualSize */) { return nullptr; }
-#endif
 };
 
 }
index c4aebf1..a863b77 100644 (file)
@@ -279,10 +279,6 @@ public:
     WEBCORE_EXPORT void tryReplaceEncodedData(SharedBuffer&);
 #endif
 
-#if USE(SOUP)
-    virtual char* getOrCreateReadBuffer(size_t /* requestedSize */, size_t& /* actualSize */) { return nullptr; }
-#endif
-
     unsigned long identifierForLoadWithoutResourceLoader() const { return m_identifierForLoadWithoutResourceLoader; }
     static ResourceLoadPriority defaultPriorityForResourceType(Type);
 
diff --git a/Source/WebCore/loader/soup/CachedRawResourceSoup.cpp b/Source/WebCore/loader/soup/CachedRawResourceSoup.cpp
deleted file mode 100644 (file)
index 5492d21..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *  Copyright (C) 2013 Igalia S.L.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-
-#if USE(SOUP)
-
-#include "CachedRawResource.h"
-
-#include "CachedRawResourceClient.h"
-#include "CachedResourceClientWalker.h"
-
-namespace WebCore {
-
-char* CachedRawResource::getOrCreateReadBuffer(size_t requestedSize, size_t& actualSize)
-{
-    CachedResourceClientWalker<CachedRawResourceClient> w(m_clients);
-    while (CachedRawResourceClient* c = w.next()) {
-        if (char* bufferPtr = c->getOrCreateReadBuffer(*this, requestedSize, actualSize))
-            return bufferPtr;
-    }
-
-    return nullptr;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/loader/soup/SubresourceLoaderSoup.cpp b/Source/WebCore/loader/soup/SubresourceLoaderSoup.cpp
deleted file mode 100644 (file)
index f86bd55..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Copyright (C) 2013 Igalia S.L.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-
-#if USE(SOUP)
-
-#include "SubresourceLoader.h"
-
-#include "CachedResource.h"
-
-namespace WebCore {
-
-char* SubresourceLoader::getOrCreateReadBuffer(size_t requestedLength, size_t& actualLength)
-{
-    return m_resource->getOrCreateReadBuffer(requestedLength, actualLength);
-}
-
-} // namespace WebCore
-
-#endif
index a8b09c7..b0eba67 100644 (file)
@@ -51,9 +51,6 @@ public:
     virtual void accessControlCheckFailed(PlatformMediaResource&, const ResourceError&) { }
     virtual void loadFailed(PlatformMediaResource&, const ResourceError&) { }
     virtual void loadFinished(PlatformMediaResource&) { }
-#if USE(SOUP)
-    virtual char* getOrCreateReadBuffer(PlatformMediaResource&, size_t /*requestedSize*/, size_t& /*actualSize*/) { return nullptr; };
-#endif
 };
 
 class PlatformMediaResourceLoader : public ThreadSafeRefCounted<PlatformMediaResourceLoader> {
index 2d62829..3a36aa6 100644 (file)
@@ -57,9 +57,6 @@ public:
     CachedResourceStreamingClient(WebKitWebSrc*, ResourceRequest&&);
     virtual ~CachedResourceStreamingClient();
 private:
-#if USE(SOUP)
-    char* getOrCreateReadBuffer(PlatformMediaResource&, size_t requestedSize, size_t& actualSize) override;
-#endif
     // PlatformMediaResourceClient virtual methods.
     void responseReceived(PlatformMediaResource&, const ResourceResponse&) override;
     void dataReceived(PlatformMediaResource&, const char*, int) override;
@@ -765,25 +762,6 @@ CachedResourceStreamingClient::CachedResourceStreamingClient(WebKitWebSrc* src,
 
 CachedResourceStreamingClient::~CachedResourceStreamingClient() = default;
 
-#if USE(SOUP)
-char* CachedResourceStreamingClient::getOrCreateReadBuffer(PlatformMediaResource&, size_t requestedSize, size_t& actualSize)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(m_src.get());
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    ASSERT(!priv->buffer);
-
-    GstBuffer* buffer = gst_buffer_new_and_alloc(requestedSize);
-
-    mapGstBuffer(buffer, GST_MAP_WRITE);
-
-    priv->buffer = adoptGRef(buffer);
-
-    actualSize = gst_buffer_get_size(buffer);
-    return getGstBufferDataPointer(buffer);
-}
-#endif
-
 void CachedResourceStreamingClient::responseReceived(PlatformMediaResource&, const ResourceResponse& response)
 {
     WebKitWebSrc* src = WEBKIT_WEB_SRC(m_src.get());
index d2b851a..f32c9bb 100644 (file)
@@ -91,10 +91,6 @@ public:
     WEBCORE_EXPORT virtual void willCacheResponseAsync(ResourceHandle*, NSCachedURLResponse *);
 #endif
 
-#if USE(SOUP)
-    virtual char* getOrCreateReadBuffer(size_t /*requestedLength*/, size_t& /*actualLength*/) { return 0; }
-#endif
-
     virtual bool shouldUseCredentialStorage(ResourceHandle*) { return false; }
     virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&) { }
     virtual void receivedCancellation(ResourceHandle*, const AuthenticationChallenge&) { }
index 732c5b1..b253dc5 100644 (file)
@@ -135,17 +135,9 @@ void ResourceHandle::ensureReadBuffer()
     if (d->m_soupBuffer)
         return;
 
-    // Non-NetworkProcess clients are able to give a buffer to the ResourceHandle to avoid expensive copies. If
-    // we do get a buffer from the client, we want the client to free it, so we create the soup buffer with
-    // SOUP_MEMORY_TEMPORARY.
-    size_t bufferSize;
-    char* bufferFromClient = client()->getOrCreateReadBuffer(gDefaultReadBufferSize, bufferSize);
-    if (bufferFromClient)
-        d->m_soupBuffer.reset(soup_buffer_new(SOUP_MEMORY_TEMPORARY, bufferFromClient, bufferSize));
-    else {
-        auto* buffer = static_cast<uint8_t*>(fastMalloc(gDefaultReadBufferSize));
-        d->m_soupBuffer.reset(soup_buffer_new_with_owner(buffer, gDefaultReadBufferSize, buffer, fastFree));
-    }
+
+    auto* buffer = static_cast<uint8_t*>(fastMalloc(gDefaultReadBufferSize));
+    d->m_soupBuffer.reset(soup_buffer_new_with_owner(buffer, gDefaultReadBufferSize, buffer, fastFree));
 
     ASSERT(d->m_soupBuffer);
 }