Title: [281365] trunk/Source/WebKit
Revision
281365
Author
simon.fra...@apple.com
Date
2021-08-20 22:58:38 -0700 (Fri, 20 Aug 2021)

Log Message

Remove AsyncRequest, which is unused
https://bugs.webkit.org/show_bug.cgi?id=229358

Reviewed by Alex Christensen.

* Shared/AsyncRequest.cpp: Removed.
* Shared/AsyncRequest.h: Removed.
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (281364 => 281365)


--- trunk/Source/WebKit/ChangeLog	2021-08-21 05:53:25 UTC (rev 281364)
+++ trunk/Source/WebKit/ChangeLog	2021-08-21 05:58:38 UTC (rev 281365)
@@ -1,5 +1,17 @@
 2021-08-20  Simon Fraser  <simon.fra...@apple.com>
 
+        Remove AsyncRequest, which is unused
+        https://bugs.webkit.org/show_bug.cgi?id=229358
+
+        Reviewed by Alex Christensen.
+
+        * Shared/AsyncRequest.cpp: Removed.
+        * Shared/AsyncRequest.h: Removed.
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+
+2021-08-20  Simon Fraser  <simon.fra...@apple.com>
+
         Use UserMediaRequestIdentifier in WebKit rather than a mysterious uint64_t
         https://bugs.webkit.org/show_bug.cgi?id=229308
 

Deleted: trunk/Source/WebKit/Shared/AsyncRequest.cpp (281364 => 281365)


--- trunk/Source/WebKit/Shared/AsyncRequest.cpp	2021-08-21 05:53:25 UTC (rev 281364)
+++ trunk/Source/WebKit/Shared/AsyncRequest.cpp	2021-08-21 05:58:38 UTC (rev 281365)
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2013 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. ``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
- * 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 "AsyncRequest.h"
-
-#include <wtf/RunLoop.h>
-
-namespace WebKit {
-
-static uint64_t generateRequestID()
-{
-    ASSERT(RunLoop::isMain());
-    static uint64_t requestID = 0;
-    return ++requestID;
-}
-
-AsyncRequest::AsyncRequest(WTF::Function<void ()>&& abortHandler)
-    : m_abortHandler(WTFMove(abortHandler))
-    , m_requestID(generateRequestID())
-{
-}
-
-AsyncRequest::~AsyncRequest()
-{
-    ASSERT(!m_abortHandler);
-}
-
-void AsyncRequest::setAbortHandler(WTF::Function<void ()>&& handler)
-{
-    m_abortHandler = WTFMove(handler);
-}
-
-void AsyncRequest::requestAborted()
-{
-    if (m_abortHandler) {
-        m_abortHandler();
-        m_abortHandler = nullptr;
-    }
-
-    clearCompletionHandler();
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit/Shared/AsyncRequest.h (281364 => 281365)


--- trunk/Source/WebKit/Shared/AsyncRequest.h	2021-08-21 05:53:25 UTC (rev 281364)
+++ trunk/Source/WebKit/Shared/AsyncRequest.h	2021-08-21 05:58:38 UTC (rev 281365)
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2013 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. ``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
- * 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.
- *
- */
-
-#ifndef AsyncRequest_h
-#define AsyncRequest_h
-
-#include <wtf/Function.h>
-#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebKit {
-
-class AsyncRequest : public RefCounted<AsyncRequest> {
-public:
-    virtual ~AsyncRequest();
-
-    uint64_t requestID() { return m_requestID; }
-
-    void setAbortHandler(WTF::Function<void ()>&&);
-    void requestAborted();
-    template<typename... Arguments> void completeRequest(Arguments&&... arguments);
-
-protected:
-    explicit AsyncRequest(WTF::Function<void ()>&& abortHandler);
-
-    virtual void clearCompletionHandler() = 0;
-
-    WTF::Function<void ()> m_abortHandler;
-
-private:
-    uint64_t m_requestID;
-};
-
-template <typename... Arguments>
-class AsyncRequestImpl final : public AsyncRequest {
-public:
-    template<typename T> using ArgumentType = typename std::conditional<std::is_integral<T>::value, T, const T&>::type;
-
-    static Ref<AsyncRequest> create(WTF::Function<void(ArgumentType<Arguments>...)>&& completionHandler)
-    {
-        return adoptRef(*new AsyncRequestImpl<Arguments...>(WTFMove(completionHandler), nullptr));
-    }
-
-    static Ref<AsyncRequest> create(WTF::Function<void(ArgumentType<Arguments>...)>&& completionHandler, WTF::Function<void()>&& abortHandler)
-    {
-        return adoptRef(*new AsyncRequestImpl<Arguments...>(WTFMove(completionHandler), WTFMove(abortHandler)));
-    }
-
-    virtual ~AsyncRequestImpl()
-    {
-        ASSERT(!m_completionHandler);
-    }
-
-    template<typename... RequestArguments>
-    void completeRequest(RequestArguments&&... arguments)
-    {
-        m_completionHandler(std::forward<RequestArguments>(arguments)...);
-        m_completionHandler = nullptr;
-    }
-
-private:
-    AsyncRequestImpl(WTF::Function<void (ArgumentType<Arguments>...)>&& completionHandler, WTF::Function<void ()>&& abortHandler)
-        : AsyncRequest(WTFMove(abortHandler))
-        , m_completionHandler(WTFMove(completionHandler))
-    {
-        ASSERT(m_completionHandler);
-    }
-
-    void clearCompletionHandler() override
-    {
-        m_completionHandler = nullptr;
-    }
-
-    WTF::Function<void (ArgumentType<Arguments>...)> m_completionHandler;
-};
-
-template<typename... Arguments> void AsyncRequest::completeRequest(Arguments&&... arguments)
-{
-    auto* request = static_cast<AsyncRequestImpl<typename std::decay<Arguments>::type...>*>(this);
-    request->completeRequest(std::forward<Arguments>(arguments)...);
-    m_abortHandler = nullptr;
-}
-
-class AsyncRequestMap {
-public:
-    using RequestMap = HashMap<uint64_t, RefPtr<AsyncRequest>>;
-
-    AsyncRequestMap()
-#ifndef NDEBUG
-        : m_lastRequestIDTaken(std::numeric_limits<uint64_t>::max())
-#endif
-    { }
-
-    Ref<AsyncRequest> take(uint64_t requestID)
-    {
-#ifndef NDEBUG
-        ASSERT_WITH_MESSAGE(requestID != m_lastRequestIDTaken, "Attempt to take the same AsyncRequest twice in a row. A background queue might have dispatched both an error callback and a success callback?");
-        m_lastRequestIDTaken = requestID;
-#endif
-
-        RefPtr<AsyncRequest> request = m_requestMap.take(requestID);
-        RELEASE_ASSERT(request);
-
-        return adoptRef(*request.leakRef());
-    }
-
-    void add(uint64_t requestID, RefPtr<AsyncRequest>&& request)
-    {
-        m_requestMap.add(requestID, WTFMove(request));
-    }
-
-    void clear()
-    {
-        m_requestMap.clear();
-    }
-
-    typename RequestMap::ValuesIteratorRange values()
-    {
-        return m_requestMap.values();
-    }
-
-private:
-    RequestMap m_requestMap;
-#ifndef NDEBUG
-    uint64_t m_lastRequestIDTaken;
-#endif
-};
-
-} // namespace WebKit
-
-#endif // AsyncRequest_h

Modified: trunk/Source/WebKit/Sources.txt (281364 => 281365)


--- trunk/Source/WebKit/Sources.txt	2021-08-21 05:53:25 UTC (rev 281364)
+++ trunk/Source/WebKit/Sources.txt	2021-08-21 05:58:38 UTC (rev 281365)
@@ -166,7 +166,6 @@
 // TODO: The files here marked @no-unify should be unified once GTK's PluginProcess2 is removed.
 Shared/AccessibilityPreferences.cpp
 Shared/ActivityAssertion.cpp @no-unify
-Shared/AsyncRequest.cpp
 Shared/AuxiliaryProcess.cpp @no-unify
 Shared/BlobDataFileReferenceWithSandboxExtension.cpp @no-unify
 Shared/CacheModel.cpp

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (281364 => 281365)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2021-08-21 05:53:25 UTC (rev 281364)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2021-08-21 05:58:38 UTC (rev 281365)
@@ -1062,7 +1062,6 @@
 		515BE1AB1D555AA000DD7C68 /* WebGamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = 515BE1A01D550AB000DD7C68 /* WebGamepad.h */; };
 		515BE1B31D5902DD00DD7C68 /* GamepadData.h in Headers */ = {isa = PBXBuildFile; fileRef = 515BE1B01D59006900DD7C68 /* GamepadData.h */; };
 		515BE1B51D5917FF00DD7C68 /* UIGamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = 515BE1AD1D555C5100DD7C68 /* UIGamepad.h */; };
-		515E7728183DD6F60007203F /* AsyncRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 515E7726183DD6F60007203F /* AsyncRequest.h */; };
 		5163199416289A6000E22F00 /* NetworkProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ACC9341628064800342550 /* NetworkProcessMessageReceiver.cpp */; };
 		5163199516289A6300E22F00 /* NetworkProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACC9351628064800342550 /* NetworkProcessMessages.h */; };
 		516A4A5D120A2CCD00C05B7F /* APIError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* APIError.h */; };
@@ -4095,8 +4094,6 @@
 		515BE1B61D5A94F900DD7C68 /* UIGamepadProviderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIGamepadProviderMac.mm; sourceTree = "<group>"; };
 		515C415A207D74E000726E02 /* SuspendedPageProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SuspendedPageProxy.cpp; sourceTree = "<group>"; };
 		515C415B207D74E100726E02 /* SuspendedPageProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuspendedPageProxy.h; sourceTree = "<group>"; };
-		515E7725183DD6F60007203F /* AsyncRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncRequest.cpp; sourceTree = "<group>"; };
-		515E7726183DD6F60007203F /* AsyncRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncRequest.h; sourceTree = "<group>"; };
 		5160BFE013381DF900918999 /* LoggingFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingFoundation.mm; sourceTree = "<group>"; };
 		5164C0941B05B757004F102A /* AuxiliaryProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AuxiliaryProcess.messages.in; sourceTree = "<group>"; };
 		516A4A5B120A2CCD00C05B7F /* APIError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIError.h; sourceTree = "<group>"; };
@@ -6771,8 +6768,6 @@
 				BC329D9F16ACD47800316DE2 /* APIWebArchiveResource.h */,
 				BC329D9E16ACD47800316DE2 /* APIWebArchiveResource.mm */,
 				493102BC2683F3A5002BB885 /* AppPrivacyReport.h */,
-				515E7725183DD6F60007203F /* AsyncRequest.cpp */,
-				515E7726183DD6F60007203F /* AsyncRequest.h */,
 				1A2D956E12848564001EB962 /* AuxiliaryProcess.cpp */,
 				1A2D956D12848564001EB962 /* AuxiliaryProcess.h */,
 				5164C0941B05B757004F102A /* AuxiliaryProcess.messages.in */,
@@ -11975,7 +11970,6 @@
 				1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */,
 				A175C44A21AA3171000037D0 /* ArgumentCodersCocoa.h in Headers */,
 				7B1DB26625668CE1000E26BC /* ArrayReference.h in Headers */,
-				515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
 				AAFA634F234F7C6400FFA864 /* AsyncRevalidation.h in Headers */,
 				BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */,
 				512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to