Reduce PassRefPtr use in WebKit2
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 May 2017 02:22:45 +0000 (02:22 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 May 2017 02:22:45 +0000 (02:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171831

Reviewed by Chris Dumez.

* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupCreateWithIdentifier):
* UIProcess/GenericCallback.h:
(WebKit::GenericCallback::create):
(WebKit::CallbackMap::put):
* UIProcess/StatisticsRequest.cpp:
(WebKit::StatisticsRequest::StatisticsRequest):
* UIProcess/StatisticsRequest.h:
(WebKit::StatisticsRequest::create):
* UIProcess/TextChecker.h:
* UIProcess/TextCheckerCompletion.cpp:
(WebKit::TextCheckerCompletion::create):
* UIProcess/TextCheckerCompletion.h:
* UIProcess/WebColorPicker.h:
(WebKit::WebColorPicker::create):
* UIProcess/WebConnectionToWebProcess.cpp:
(WebKit::WebConnectionToWebProcess::create):
* UIProcess/WebConnectionToWebProcess.h:
* UIProcess/WebContextInjectedBundleClient.cpp:
(WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
* UIProcess/WebContextInjectedBundleClient.h:
* UIProcess/WebContextMenuListenerProxy.h:
(WebKit::WebContextMenuListenerProxy::create):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::create):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebEditCommandProxy.h:
(WebKit::WebEditCommandProxy::create):
* UIProcess/WebFormSubmissionListenerProxy.h:
(WebKit::WebFormSubmissionListenerProxy::create):
* UIProcess/WebFrameListenerProxy.h:
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::create):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::create):
* UIProcess/WebFullScreenManagerProxy.h:
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::create):
* UIProcess/WebGeolocationManagerProxy.h:
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::create):
(WebKit::WebIconDatabase::iconDataForPageURL):
* UIProcess/WebIconDatabase.h:
* UIProcess/WebMediaSessionFocusManager.cpp:
(WebKit::WebMediaSessionFocusManager::create):
* UIProcess/WebMediaSessionFocusManager.h:
* UIProcess/WebOpenPanelResultListenerProxy.h:
(WebKit::WebOpenPanelResultListenerProxy::create):
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::create):
* UIProcess/WebPageGroup.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
(WebKit::WebPageProxy::drawPagesForPrinting):
(WebKit::WebPageProxy::callAfterNextPresentationUpdate):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/TextCheckerIOS.mm:
(WebKit::TextChecker::requestCheckingOfString):
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::requestCheckingOfString):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(-[WKPrintingView _drawPreview:]):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::loadURL):
(WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::NetscapePluginStream):
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
(WebKit::NetscapePluginStream::create):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):

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

43 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp
Source/WebKit2/UIProcess/GenericCallback.h
Source/WebKit2/UIProcess/StatisticsRequest.cpp
Source/WebKit2/UIProcess/StatisticsRequest.h
Source/WebKit2/UIProcess/TextChecker.h
Source/WebKit2/UIProcess/TextCheckerCompletion.cpp
Source/WebKit2/UIProcess/TextCheckerCompletion.h
Source/WebKit2/UIProcess/WebColorPicker.h
Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
Source/WebKit2/UIProcess/WebConnectionToWebProcess.h
Source/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h
Source/WebKit2/UIProcess/WebContextMenuListenerProxy.h
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebEditCommandProxy.h
Source/WebKit2/UIProcess/WebFormSubmissionListenerProxy.h
Source/WebKit2/UIProcess/WebFrameListenerProxy.h
Source/WebKit2/UIProcess/WebFrameProxy.h
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
Source/WebKit2/UIProcess/WebIconDatabase.cpp
Source/WebKit2/UIProcess/WebIconDatabase.h
Source/WebKit2/UIProcess/WebMediaSessionFocusManager.cpp
Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h
Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.h
Source/WebKit2/UIProcess/WebPageGroup.cpp
Source/WebKit2/UIProcess/WebPageGroup.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp
Source/WebKit2/UIProcess/ios/TextCheckerIOS.mm
Source/WebKit2/UIProcess/mac/TextCheckerMac.mm
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
Source/WebKit2/UIProcess/mac/WKPrintingView.mm
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h
Source/WebKit2/WebProcess/WebCoreSupport/SessionStateConversion.cpp

index 9f0b2b6..a6dc24a 100644 (file)
@@ -1,3 +1,89 @@
+2017-05-08  Alex Christensen  <achristensen@webkit.org>
+
+        Reduce PassRefPtr use in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=171831
+
+        Reviewed by Chris Dumez.
+
+        * UIProcess/API/C/WKPageGroup.cpp:
+        (WKPageGroupCreateWithIdentifier):
+        * UIProcess/GenericCallback.h:
+        (WebKit::GenericCallback::create):
+        (WebKit::CallbackMap::put):
+        * UIProcess/StatisticsRequest.cpp:
+        (WebKit::StatisticsRequest::StatisticsRequest):
+        * UIProcess/StatisticsRequest.h:
+        (WebKit::StatisticsRequest::create):
+        * UIProcess/TextChecker.h:
+        * UIProcess/TextCheckerCompletion.cpp:
+        (WebKit::TextCheckerCompletion::create):
+        * UIProcess/TextCheckerCompletion.h:
+        * UIProcess/WebColorPicker.h:
+        (WebKit::WebColorPicker::create):
+        * UIProcess/WebConnectionToWebProcess.cpp:
+        (WebKit::WebConnectionToWebProcess::create):
+        * UIProcess/WebConnectionToWebProcess.h:
+        * UIProcess/WebContextInjectedBundleClient.cpp:
+        (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
+        * UIProcess/WebContextInjectedBundleClient.h:
+        * UIProcess/WebContextMenuListenerProxy.h:
+        (WebKit::WebContextMenuListenerProxy::create):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::create):
+        * UIProcess/WebCookieManagerProxy.h:
+        * UIProcess/WebEditCommandProxy.h:
+        (WebKit::WebEditCommandProxy::create):
+        * UIProcess/WebFormSubmissionListenerProxy.h:
+        (WebKit::WebFormSubmissionListenerProxy::create):
+        * UIProcess/WebFrameListenerProxy.h:
+        * UIProcess/WebFrameProxy.h:
+        (WebKit::WebFrameProxy::create):
+        * UIProcess/WebFullScreenManagerProxy.cpp:
+        (WebKit::WebFullScreenManagerProxy::create):
+        * UIProcess/WebFullScreenManagerProxy.h:
+        * UIProcess/WebGeolocationManagerProxy.cpp:
+        (WebKit::WebGeolocationManagerProxy::create):
+        * UIProcess/WebGeolocationManagerProxy.h:
+        * UIProcess/WebIconDatabase.cpp:
+        (WebKit::WebIconDatabase::create):
+        (WebKit::WebIconDatabase::iconDataForPageURL):
+        * UIProcess/WebIconDatabase.h:
+        * UIProcess/WebMediaSessionFocusManager.cpp:
+        (WebKit::WebMediaSessionFocusManager::create):
+        * UIProcess/WebMediaSessionFocusManager.h:
+        * UIProcess/WebOpenPanelResultListenerProxy.h:
+        (WebKit::WebOpenPanelResultListenerProxy::create):
+        * UIProcess/WebPageGroup.cpp:
+        (WebKit::WebPageGroup::create):
+        * UIProcess/WebPageGroup.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::forceRepaint):
+        (WebKit::WebPageProxy::computePagesForPrinting):
+        (WebKit::WebPageProxy::drawRectToImage):
+        (WebKit::WebPageProxy::drawPagesToPDF):
+        (WebKit::WebPageProxy::drawPagesForPrinting):
+        (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/TextCheckerIOS.mm:
+        (WebKit::TextChecker::requestCheckingOfString):
+        * UIProcess/mac/TextCheckerMac.mm:
+        (WebKit::TextChecker::requestCheckingOfString):
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
+        * UIProcess/mac/WKPrintingView.mm:
+        (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
+        (-[WKPrintingView _drawPreview:]):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::loadURL):
+        (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
+        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
+        (WebKit::NetscapePluginStream::NetscapePluginStream):
+        * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
+        (WebKit::NetscapePluginStream::create):
+        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
+        (WebKit::toFormData):
+
 2017-05-08  Youenn Fablet  <youenn@apple.com>
 
         Add support for reading and writing settings from UIProcess audio capture
index 8c3227b..743154e 100644 (file)
@@ -45,7 +45,7 @@ WKTypeID WKPageGroupGetTypeID()
 WKPageGroupRef WKPageGroupCreateWithIdentifier(WKStringRef identifier)
 {
     auto pageGroup = WebPageGroup::create(toWTFString(identifier));
-    return toAPI(pageGroup.leakRef());
+    return toAPI(&pageGroup.leakRef());
 }
 
 void WKPageGroupSetPreferences(WKPageGroupRef pageGroupRef, WKPreferencesRef preferencesRef)
index d35d1a4..10f3427 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef GenericCallback_h
-#define GenericCallback_h
+#pragma once
 
 #include "APIError.h"
 #include "APISerializedScriptValue.h"
@@ -34,7 +33,6 @@
 #include <functional>
 #include <wtf/Function.h>
 #include <wtf/HashMap.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RunLoop.h>
 
@@ -95,9 +93,9 @@ class GenericCallback : public CallbackBase {
 public:
     typedef Function<void (T..., Error)> CallbackFunction;
 
-    static PassRefPtr<GenericCallback> create(CallbackFunction&& callback, const ProcessThrottler::BackgroundActivityToken& activityToken = nullptr)
+    static Ref<GenericCallback> create(CallbackFunction&& callback, const ProcessThrottler::BackgroundActivityToken& activityToken = nullptr)
     {
-        return adoptRef(new GenericCallback(WTFMove(callback), activityToken));
+        return adoptRef(*new GenericCallback(WTFMove(callback), activityToken));
     }
 
     virtual ~GenericCallback()
@@ -172,12 +170,12 @@ void invalidateCallbackMap(HashMap<uint64_t, T>& callbackMap, CallbackBase::Erro
 
 class CallbackMap {
 public:
-    uint64_t put(PassRefPtr<CallbackBase> callback)
+    uint64_t put(Ref<CallbackBase>&& callback)
     {
         ASSERT(!m_map.contains(callback->callbackID()));
 
         uint64_t callbackID = callback->callbackID();
-        m_map.set(callbackID, callback);
+        m_map.set(callbackID, WTFMove(callback));
         return callbackID;
     }
 
@@ -192,17 +190,17 @@ public:
     };
 
     template<typename... T>
-    uint64_t put(std::function<void (T...)> function, const ProcessThrottler::BackgroundActivityToken& activityToken)
+    uint64_t put(std::function<void(T...)>&& function, const ProcessThrottler::BackgroundActivityToken& activityToken)
     {
         auto callback = GenericCallbackType<sizeof...(T), T...>::type::create(WTFMove(function), activityToken);
-        return put(callback);
+        return put(WTFMove(callback));
     }
 
     template<typename... T>
-    uint64_t put(Function<void (T...)>&& function, const ProcessThrottler::BackgroundActivityToken& activityToken)
+    uint64_t put(Function<void(T...)>&& function, const ProcessThrottler::BackgroundActivityToken& activityToken)
     {
         auto callback = GenericCallbackType<sizeof...(T), T...>::type::create(WTFMove(function), activityToken);
-        return put(callback);
+        return put(WTFMove(callback));
     }
 
     template<class T>
@@ -225,5 +223,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // GenericCallback_h
index bf51d23..b1c2c52 100644 (file)
@@ -31,8 +31,8 @@
 
 namespace WebKit {
 
-StatisticsRequest::StatisticsRequest(PassRefPtr<DictionaryCallback> callback)
-    : m_callback(callback)
+StatisticsRequest::StatisticsRequest(Ref<DictionaryCallback>&& callback)
+    : m_callback(WTFMove(callback))
 {
 }
 
index c5f03c8..a99c051 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef StatisticsRequest_h
-#define StatisticsRequest_h
+#pragma once
 
 #include "GenericCallback.h"
 #include "StatisticsData.h"
@@ -44,9 +43,9 @@ enum StatisticsRequestType {
 
 class StatisticsRequest : public RefCounted<StatisticsRequest> {
 public:
-    static PassRefPtr<StatisticsRequest> create(PassRefPtr<DictionaryCallback> callback)
+    static Ref<StatisticsRequest> create(Ref<DictionaryCallback>&& callback)
     {
-        return adoptRef(new StatisticsRequest(callback));
+        return adoptRef(*new StatisticsRequest(WTFMove(callback)));
     }
 
     ~StatisticsRequest();
@@ -56,7 +55,7 @@ public:
     void completedRequest(uint64_t requestID, const StatisticsData&);
 
 private:
-    StatisticsRequest(PassRefPtr<DictionaryCallback>);
+    StatisticsRequest(Ref<DictionaryCallback>&&);
 
     HashSet<uint64_t> m_outstandingRequests;
     RefPtr<DictionaryCallback> m_callback;
@@ -65,5 +64,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // StatisticsRequest_h
index 41378c2..e7f3dd6 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TextChecker_h
-#define TextChecker_h
+#pragma once
 
 #include "TextCheckerCompletion.h"
 #include <WebCore/EditorClient.h>
@@ -86,9 +85,7 @@ public:
     static void getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled);
     static void learnWord(int64_t spellDocumentTag, const String& word);
     static void ignoreWord(int64_t spellDocumentTag, const String& word);
-    static void requestCheckingOfString(PassRefPtr<TextCheckerCompletion>, int32_t insertionPoint);
+    static void requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t insertionPoint);
 };
 
 } // namespace WebKit
-
-#endif // TextChecker_h
index 1dd42de..3babebb 100644 (file)
@@ -30,9 +30,9 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassRefPtr<TextCheckerCompletion> TextCheckerCompletion::create(uint64_t requestID, const TextCheckingRequestData& requestData, WebPageProxy* page)
+Ref<TextCheckerCompletion> TextCheckerCompletion::create(uint64_t requestID, const TextCheckingRequestData& requestData, WebPageProxy* page)
 {
-    return adoptRef(new TextCheckerCompletion(requestID, requestData, page));
+    return adoptRef(*new TextCheckerCompletion(requestID, requestData, page));
 }
 
 TextCheckerCompletion::TextCheckerCompletion(uint64_t requestID, const TextCheckingRequestData& requestData, WebPageProxy* page)
index 425e765..0523abe 100644 (file)
@@ -23,8 +23,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TextCheckerCompletion_h
-#define TextCheckerCompletion_h
+#pragma once
 
 #include "WebPageProxy.h"
 #include <WebCore/TextChecking.h>
@@ -34,7 +33,7 @@ namespace WebKit {
 
 class TextCheckerCompletion : public RefCounted<TextCheckerCompletion> {
 public:
-    static PassRefPtr<TextCheckerCompletion> create(uint64_t requestID, const WebCore::TextCheckingRequestData&, WebPageProxy*);
+    static Ref<TextCheckerCompletion> create(uint64_t requestID, const WebCore::TextCheckingRequestData&, WebPageProxy*);
 
     const WebCore::TextCheckingRequestData& textCheckingRequestData() const;
     int64_t spellDocumentTag();
@@ -50,5 +49,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // TextCheckerCompletion_h
index 5400ddc..1848d34 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebColorPicker_h
-#define WebColorPicker_h
+#pragma once
 
 #if ENABLE(INPUT_TYPE_COLOR)
 
@@ -50,9 +49,9 @@ public:
         virtual void didEndColorPicker() = 0;
     };
 
-    static PassRefPtr<WebColorPicker> create(Client* client)
+    static Ref<WebColorPicker> create(Client* client)
     {
-        return adoptRef(new WebColorPicker(client));
+        return adoptRef(*new WebColorPicker(client));
     }
 
     virtual ~WebColorPicker();
@@ -72,5 +71,3 @@ protected:
 } // namespace WebKit
 
 #endif // ENABLE(INPUT_TYPE_COLOR)
-
-#endif // WebColorPicker_h
index e8e0850..2065c84 100644 (file)
@@ -31,9 +31,9 @@
 
 namespace WebKit {
 
-PassRefPtr<WebConnectionToWebProcess> WebConnectionToWebProcess::create(WebProcessProxy* process)
+Ref<WebConnectionToWebProcess> WebConnectionToWebProcess::create(WebProcessProxy* process)
 {
-    return adoptRef(new WebConnectionToWebProcess(process));
+    return adoptRef(*new WebConnectionToWebProcess(process));
 }
 
 WebConnectionToWebProcess::WebConnectionToWebProcess(WebProcessProxy* process)
index a97ec2a..7be1f1d 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebConnectionToWebProcess_h
-#define WebConnectionToWebProcess_h
+#pragma once
 
 #include "WebConnection.h"
 
@@ -34,7 +33,7 @@ class WebProcessProxy;
 
 class WebConnectionToWebProcess : public WebConnection {
 public:
-    static PassRefPtr<WebConnectionToWebProcess> create(WebProcessProxy*);
+    static Ref<WebConnectionToWebProcess> create(WebProcessProxy*);
 
     WebProcessProxy* webProcessProxy() const { return m_process; }
 
@@ -56,5 +55,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // WebConnectionToWebProcess_h
index c68a163..90ac19b 100644 (file)
@@ -52,10 +52,10 @@ void WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBun
     returnData = adoptRef(toImpl(returnDataRef));
 }
 
-PassRefPtr<API::Object> WebContextInjectedBundleClient::getInjectedBundleInitializationUserData(WebProcessPool* processPool)
+RefPtr<API::Object> WebContextInjectedBundleClient::getInjectedBundleInitializationUserData(WebProcessPool* processPool)
 {
     if (!m_client.getInjectedBundleInitializationUserData)
-        return 0;
+        return nullptr;
 
     return adoptRef(toImpl(m_client.getInjectedBundleInitializationUserData(toAPI(processPool), m_client.base.clientInfo)));
 }
index c934fe8..2de63ce 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebContextInjectedBundleClient_h
-#define WebContextInjectedBundleClient_h
+#pragma once
 
 #include "APIClient.h"
 #include "WKContext.h"
@@ -46,9 +45,7 @@ class WebContextInjectedBundleClient : public API::Client<WKContextInjectedBundl
 public:
     void didReceiveMessageFromInjectedBundle(WebProcessPool*, const String&, API::Object*);
     void didReceiveSynchronousMessageFromInjectedBundle(WebProcessPool*, const String&, API::Object*, RefPtr<API::Object>& returnData);
-    PassRefPtr<API::Object> getInjectedBundleInitializationUserData(WebProcessPool*);
+    RefPtr<API::Object> getInjectedBundleInitializationUserData(WebProcessPool*);
 };
 
 } // namespace WebKit
-
-#endif // WebContextInjectedBundleClient_h
index a358470..3a0afe4 100644 (file)
@@ -38,9 +38,9 @@ class WebContextMenuProxyMac;
 
 class WebContextMenuListenerProxy : public API::ObjectImpl<API::Object::Type::ContextMenuListener> {
 public:
-    static PassRefPtr<WebContextMenuListenerProxy> create(WebContextMenuProxy* contextMenuMac)
+    static Ref<WebContextMenuListenerProxy> create(WebContextMenuProxy* contextMenuMac)
     {
-        return adoptRef(new WebContextMenuListenerProxy(contextMenuMac));
+        return adoptRef(*new WebContextMenuListenerProxy(contextMenuMac));
     }
 
     virtual ~WebContextMenuListenerProxy();
index fe3842f..df801f4 100644 (file)
@@ -44,9 +44,9 @@ const char* WebCookieManagerProxy::supplementName()
     return "WebCookieManagerProxy";
 }
 
-PassRefPtr<WebCookieManagerProxy> WebCookieManagerProxy::create(WebProcessPool* processPool)
+Ref<WebCookieManagerProxy> WebCookieManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebCookieManagerProxy(processPool));
+    return adoptRef(*new WebCookieManagerProxy(processPool));
 }
 
 WebCookieManagerProxy::WebCookieManagerProxy(WebProcessPool* processPool)
index f662700..5b0f757 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebCookieManagerProxy_h
-#define WebCookieManagerProxy_h
+#pragma once
 
 #include "APIObject.h"
 #include "GenericCallback.h"
@@ -61,7 +60,7 @@ class WebCookieManagerProxy : public API::ObjectImpl<API::Object::Type::CookieMa
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebCookieManagerProxy> create(WebProcessPool*);
+    static Ref<WebCookieManagerProxy> create(WebProcessPool*);
     virtual ~WebCookieManagerProxy();
 
     void initializeClient(const WKCookieManagerClientBase*);
@@ -150,5 +149,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // WebCookieManagerProxy_h
index 154d954..c375000 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebEditCommandProxy_h
-#define WebEditCommandProxy_h
+#pragma once
 
 #include "APIObject.h"
 #include <WebCore/EditAction.h>
@@ -38,9 +37,9 @@ class WebPageProxy;
 
 class WebEditCommandProxy : public API::ObjectImpl<API::Object::Type::EditCommandProxy> {
 public:
-    static PassRefPtr<WebEditCommandProxy> create(uint64_t commandID, WebCore::EditAction editAction, WebPageProxy* page)
+    static Ref<WebEditCommandProxy> create(uint64_t commandID, WebCore::EditAction editAction, WebPageProxy* page)
     {
-        return adoptRef(new WebEditCommandProxy(commandID, editAction, page));
+        return adoptRef(*new WebEditCommandProxy(commandID, editAction, page));
     }
     ~WebEditCommandProxy();
 
@@ -63,5 +62,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // WebEditCommandProxy_h
index f6f6ec3..100c831 100644 (file)
@@ -42,9 +42,9 @@ class WebFormSubmissionListenerProxy : public WebFrameListenerProxy {
 public:
     static const Type APIType = Type::FormSubmissionListener;
 
-    static PassRefPtr<WebFormSubmissionListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID)
+    static Ref<WebFormSubmissionListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID)
     {
-        return adoptRef(new WebFormSubmissionListenerProxy(frame, listenerID));
+        return adoptRef(*new WebFormSubmissionListenerProxy(frame, listenerID));
     }
 
     void continueSubmission();
index 70380d6..fa56321 100644 (file)
@@ -28,7 +28,6 @@
 #include "APINavigation.h"
 #include "APIObject.h"
 #include <WebCore/FrameLoaderTypes.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/Ref.h>
 #include <wtf/RefPtr.h>
 
index 55b5b67..6a6da2e 100644 (file)
@@ -32,7 +32,6 @@
 #include <WebCore/FrameLoaderTypes.h>
 #include <wtf/Forward.h>
 #include <wtf/Function.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 #if ENABLE(CONTENT_FILTERING)
@@ -59,9 +58,9 @@ typedef GenericCallback<API::Data*> DataCallback;
 
 class WebFrameProxy : public API::ObjectImpl<API::Object::Type::Frame> {
 public:
-    static PassRefPtr<WebFrameProxy> create(WebPageProxy* page, uint64_t frameID)
+    static Ref<WebFrameProxy> create(WebPageProxy* page, uint64_t frameID)
     {
-        return adoptRef(new WebFrameProxy(page, frameID));
+        return adoptRef(*new WebFrameProxy(page, frameID));
     }
 
     virtual ~WebFrameProxy();
index 352d6a0..b5588a5 100644 (file)
@@ -39,9 +39,9 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
+Ref<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
 {
-    return adoptRef(new WebFullScreenManagerProxy(page, client));
+    return adoptRef(*new WebFullScreenManagerProxy(page, client));
 }
 
 WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
index 107b5c0..cf4af17 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebFullScreenManagerProxy_h
-#define WebFullScreenManagerProxy_h
+#pragma once
 
 #if ENABLE(FULLSCREEN_API)
 
 #include "MessageReceiver.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
@@ -55,7 +53,7 @@ public:
 
 class WebFullScreenManagerProxy : public RefCounted<WebFullScreenManagerProxy>, public IPC::MessageReceiver {
 public:
-    static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy&, WebFullScreenManagerProxyClient&);
+    static Ref<WebFullScreenManagerProxy> create(WebPageProxy&, WebFullScreenManagerProxyClient&);
     virtual ~WebFullScreenManagerProxy();
 
     void invalidate();
@@ -91,5 +89,3 @@ private:
 } // namespace WebKit
 
 #endif // ENABLE(FULLSCREEN_API)
-
-#endif // WebFullScreenManagerProxy_h
index 7e18ac5..031af74 100644 (file)
@@ -37,9 +37,9 @@ const char* WebGeolocationManagerProxy::supplementName()
     return "WebGeolocationManagerProxy";
 }
 
-PassRefPtr<WebGeolocationManagerProxy> WebGeolocationManagerProxy::create(WebProcessPool* processPool)
+Ref<WebGeolocationManagerProxy> WebGeolocationManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebGeolocationManagerProxy(processPool));
+    return adoptRef(*new WebGeolocationManagerProxy(processPool));
 }
 
 WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebProcessPool* processPool)
index a4cb122..5636ec2 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebGeolocationManagerProxy_h
-#define WebGeolocationManagerProxy_h
+#pragma once
 
 #include "APIObject.h"
 #include "Connection.h"
@@ -43,7 +42,7 @@ class WebGeolocationManagerProxy : public API::ObjectImpl<API::Object::Type::Geo
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebGeolocationManagerProxy> create(WebProcessPool*);
+    static Ref<WebGeolocationManagerProxy> create(WebProcessPool*);
 
     void initializeProvider(const WKGeolocationProviderBase*);
 
@@ -83,5 +82,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // WebGeolocationManagerProxy_h
index 892c05f..c65e373 100644 (file)
@@ -39,9 +39,9 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassRefPtr<WebIconDatabase> WebIconDatabase::create(WebProcessPool* processPool)
+Ref<WebIconDatabase> WebIconDatabase::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebIconDatabase(*processPool));
+    return adoptRef(*new WebIconDatabase(*processPool));
 }
 
 WebIconDatabase::~WebIconDatabase()
@@ -315,7 +315,7 @@ void WebIconDatabase::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
         m_iconDatabaseImpl->setPrivateBrowsingEnabled(privateBrowsingEnabled);
 }
 
-PassRefPtr<API::Data> WebIconDatabase::iconDataForPageURL(const String& pageURL)
+RefPtr<API::Data> WebIconDatabase::iconDataForPageURL(const String& pageURL)
 {
     auto* image = imageForPageURL(pageURL);
     if (!image)
index 8b70fe8..ab1197f 100644 (file)
@@ -48,7 +48,7 @@ class WebProcessPool;
 
 class WebIconDatabase : public API::ObjectImpl<API::Object::Type::IconDatabase>, private WebCore::IconDatabaseClient, private IPC::MessageReceiver {
 public:
-    static PassRefPtr<WebIconDatabase> create(WebProcessPool*);
+    static Ref<WebIconDatabase> create(WebProcessPool*);
     virtual ~WebIconDatabase();
 
     void invalidate();
@@ -71,7 +71,7 @@ public:
 
     WebCore::Image* imageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32));
     WebCore::NativeImagePtr nativeImageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32));
-    PassRefPtr<API::Data> iconDataForPageURL(const String& pageURL);
+    RefPtr<API::Data> iconDataForPageURL(const String& pageURL);
 
     bool isOpen();
     bool isUrlImportCompleted();
index 4bf626e..2cdcd17 100644 (file)
@@ -37,9 +37,9 @@ const char* WebMediaSessionFocusManager::supplementName()
     return "WebMediaSessionFocusManager";
 }
 
-PassRefPtr<WebMediaSessionFocusManager> WebMediaSessionFocusManager::create(WebProcessPool* processPool)
+Ref<WebMediaSessionFocusManager> WebMediaSessionFocusManager::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebMediaSessionFocusManager(processPool));
+    return adoptRef(*new WebMediaSessionFocusManager(processPool));
 }
 
 WebMediaSessionFocusManager::WebMediaSessionFocusManager(WebProcessPool* processPool)
index cb7623f..24c7037 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebMediaSessionFocusManager_h
-#define WebMediaSessionFocusManager_h
+#pragma once
 
 #if ENABLE(MEDIA_SESSION)
 
@@ -41,7 +40,7 @@ class WebMediaSessionFocusManager : public API::ObjectImpl<API::Object::Type::Me
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebMediaSessionFocusManager> create(WebProcessPool*);
+    static Ref<WebMediaSessionFocusManager> create(WebProcessPool*);
 
     void initializeClient(const WKMediaSessionFocusManagerClientBase*);
 
@@ -72,5 +71,3 @@ private:
 } // namespace WebKit
 
 #endif // ENABLE(MEDIA_SESSION)
-
-#endif /* WebMediaSessionFocusManager_h */
index ef50023..0449f58 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebOpenPanelResultListenerProxy_h
-#define WebOpenPanelResultListenerProxy_h
+#pragma once
 
 #include "APIObject.h"
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
@@ -44,9 +42,9 @@ class WebPageProxy;
 
 class WebOpenPanelResultListenerProxy : public API::ObjectImpl<API::Object::Type::FramePolicyListener> {
 public:
-    static PassRefPtr<WebOpenPanelResultListenerProxy> create(WebPageProxy* page)
+    static Ref<WebOpenPanelResultListenerProxy> create(WebPageProxy* page)
     {
-        return adoptRef(new WebOpenPanelResultListenerProxy(page));
+        return adoptRef(*new WebOpenPanelResultListenerProxy(page));
     }
 
     virtual ~WebOpenPanelResultListenerProxy();
@@ -66,5 +64,3 @@ private:
 };
 
 } // namespace WebKit
-
-#endif // WebOpenPanelResultListenerProxy_h
index 3be8af7..61259f5 100644 (file)
@@ -54,9 +54,9 @@ static WebPageGroupMap& webPageGroupMap()
     return map;
 }
 
-PassRefPtr<WebPageGroup> WebPageGroup::create(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
+Ref<WebPageGroup> WebPageGroup::create(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
 {
-    return adoptRef(new WebPageGroup(identifier, visibleToInjectedBundle, visibleToHistoryClient));
+    return adoptRef(*new WebPageGroup(identifier, visibleToInjectedBundle, visibleToHistoryClient));
 }
 
 Ref<WebPageGroup> WebPageGroup::createNonNull(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
index 82777ed..44a9e77 100644 (file)
@@ -43,7 +43,7 @@ class WebUserContentControllerProxy;
 class WebPageGroup : public API::ObjectImpl<API::Object::Type::PageGroup> {
 public:
     WebPageGroup(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
-    static PassRefPtr<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
+    static Ref<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
     static Ref<WebPageGroup> createNonNull(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
     static WebPageGroup* get(uint64_t pageGroupID);
 
index d386f88..625307e 100644 (file)
@@ -3034,16 +3034,15 @@ void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, Function<void (API
     m_process->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
 }
 
-void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
+void WebPageProxy::forceRepaint(RefPtr<VoidCallback>&& callback)
 {
-    RefPtr<VoidCallback> callback = prpCallback;
     if (!isValid()) {
         // FIXME: If the page is invalid we should not call the callback. It'd be better to just return false from forceRepaint.
         callback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
         return;
     }
 
-    std::function<void (CallbackBase::Error)> didForceRepaintCallback = [this, callback](CallbackBase::Error error) {
+    Function<void(CallbackBase::Error)> didForceRepaintCallback = [this, callback = WTFMove(callback)](CallbackBase::Error error) mutable {
         if (error != CallbackBase::Error::None) {
             callback->invalidate(error);
             return;
@@ -3054,7 +3053,7 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
             return;
         }
     
-        callAfterNextPresentationUpdate([callback](CallbackBase::Error error) {
+        callAfterNextPresentationUpdate([callback = WTFMove(callback)](CallbackBase::Error error) {
             if (error != CallbackBase::Error::None) {
                 callback->invalidate(error);
                 return;
@@ -3064,7 +3063,7 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
         });
     };
 
-    uint64_t callbackID = m_callbacks.put(didForceRepaintCallback, m_process->throttler().backgroundActivityToken());
+    uint64_t callbackID = m_callbacks.put(WTFMove(didForceRepaintCallback), m_process->throttler().backgroundActivityToken());
     m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
     m_process->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID); 
 }
@@ -5992,57 +5991,53 @@ void WebPageProxy::endPrinting()
     m_process->send(Messages::WebPage::EndPrinting(), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
 }
 
-void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
+void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, Ref<ComputedPagesCallback>&& callback)
 {
-    RefPtr<ComputedPagesCallback> callback = prpCallback;
     if (!isValid()) {
         callback->invalidate();
         return;
     }
 
     uint64_t callbackID = callback->callbackID();
-    m_callbacks.put(callback);
+    m_callbacks.put(WTFMove(callback));
     m_isInPrintingMode = true;
     m_process->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
 }
 
 #if PLATFORM(COCOA)
-void WebPageProxy::drawRectToImage(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, const WebCore::IntSize& imageSize, PassRefPtr<ImageCallback> prpCallback)
+void WebPageProxy::drawRectToImage(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, const WebCore::IntSize& imageSize, Ref<ImageCallback>&& callback)
 {
-    RefPtr<ImageCallback> callback = prpCallback;
     if (!isValid()) {
         callback->invalidate();
         return;
     }
     
     uint64_t callbackID = callback->callbackID();
-    m_callbacks.put(callback);
+    m_callbacks.put(WTFMove(callback));
     m_process->send(Messages::WebPage::DrawRectToImage(frame->frameID(), printInfo, rect, imageSize, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
 }
 
-void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
+void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, Ref<DataCallback>&& callback)
 {
-    RefPtr<DataCallback> callback = prpCallback;
     if (!isValid()) {
         callback->invalidate();
         return;
     }
     
     uint64_t callbackID = callback->callbackID();
-    m_callbacks.put(callback);
+    m_callbacks.put(WTFMove(callback));
     m_process->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
 }
 #elif PLATFORM(GTK)
-void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
+void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, Ref<PrintFinishedCallback>&& callback)
 {
-    RefPtr<PrintFinishedCallback> callback = didPrintCallback;
     if (!isValid()) {
         callback->invalidate();
         return;
     }
 
     uint64_t callbackID = callback->callbackID();
-    m_callbacks.put(callback);
+    m_callbacks.put(WTFMove(callback));
     m_isInPrintingMode = true;
     m_process->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
 }
@@ -6744,7 +6739,7 @@ void WebPageProxy::callAfterNextPresentationUpdate(std::function<void (CallbackB
         return;
     }
 
-    m_drawingArea->dispatchAfterEnsuringDrawing(callback);
+    m_drawingArea->dispatchAfterEnsuringDrawing(WTFMove(callback));
 }
 
 void WebPageProxy::setShouldScaleViewToFitDocument(bool shouldScaleViewToFitDocument)
index 455ee6c..ef1f7ca 100644 (file)
@@ -807,7 +807,7 @@ public:
     void getSourceForFrame(WebFrameProxy*, std::function<void (const String&, CallbackBase::Error)>);
     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
     void runJavaScriptInMainFrame(const String&, std::function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)> callbackFunction);
-    void forceRepaint(PassRefPtr<VoidCallback>);
+    void forceRepaint(RefPtr<VoidCallback>&&);
 
     float headerHeight(WebFrameProxy*);
     float footerHeight(WebFrameProxy*);
@@ -936,16 +936,16 @@ public:
 
     void beginPrinting(WebFrameProxy*, const PrintInfo&);
     void endPrinting();
-    void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
+    void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
 #if PLATFORM(COCOA)
-    void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
-    void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
+    void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
+    void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
 #if PLATFORM(IOS)
     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
     void drawToPDFCallback(const IPC::DataReference& pdfData, uint64_t callbackID);
 #endif
 #elif PLATFORM(GTK)
-    void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
+    void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
 #endif
 
     PageLoadState& pageLoadState() { return m_pageLoadState; }
index 2513cbd..7e32d76 100644 (file)
@@ -207,12 +207,9 @@ void TextChecker::ignoreWord(int64_t /* spellDocumentTag */, const String& word)
 #endif
 }
 
-void TextChecker::requestCheckingOfString(PassRefPtr<TextCheckerCompletion> completion, int32_t insertionPoint)
+void TextChecker::requestCheckingOfString(Ref<TextCheckerCompletion>&& completion, int32_t insertionPoint)
 {
 #if ENABLE(SPELLCHECK)
-    if (!completion)
-        return;
-
     TextCheckingRequestData request = completion->textCheckingRequestData();
     ASSERT(request.sequence() != unrequestedTextCheckingSequence);
     ASSERT(request.mask() != TextCheckingTypeNone);
index d7871b2..26e352d 100644 (file)
@@ -199,7 +199,7 @@ void TextChecker::ignoreWord(int64_t, const String&)
     notImplemented();
 }
 
-void TextChecker::requestCheckingOfString(PassRefPtr<TextCheckerCompletion>, int32_t)
+void TextChecker::requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t)
 {
     notImplemented();
 }
index f4dd017..c4a4f9f 100644 (file)
@@ -500,7 +500,7 @@ void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
     [[NSSpellChecker sharedSpellChecker] ignoreWord:word inSpellDocumentWithTag:spellDocumentTag];
 }
 
-void TextChecker::requestCheckingOfString(PassRefPtr<TextCheckerCompletion>, int32_t)
+void TextChecker::requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t)
 {
     notImplemented();
 }
index b3bab20..f18253f 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TiledCoreAnimationDrawingAreaProxy_h
-#define TiledCoreAnimationDrawingAreaProxy_h
+#pragma once
 
 #if !PLATFORM(IOS)
 
@@ -80,5 +79,3 @@ private:
 SPECIALIZE_TYPE_TRAITS_DRAWING_AREA_PROXY(TiledCoreAnimationDrawingAreaProxy, DrawingAreaTypeTiledCoreAnimation)
 
 #endif // !PLATFORM(IOS)
-
-#endif // TiledCoreAnimationDrawingAreaProxy_h
index 9c1244e..f3765b5 100644 (file)
@@ -426,7 +426,7 @@ static const float minVideoWidth = 480 + 20 + 20; // Note: Keep in sync with med
     _repaintCallback = VoidCallback::create([self](WebKit::CallbackBase::Error) {
         [self completeFinishExitFullScreenAnimationAfterRepaint];
     });
-    _page->forceRepaint(_repaintCallback);
+    _page->forceRepaint(_repaintCallback.copyRef());
 }
 
 - (void)completeFinishExitFullScreenAnimationAfterRepaint
index b7aab3c..dc8da5a 100644 (file)
@@ -265,7 +265,7 @@ static void pageDidDrawToImage(const ShareableBitmap::Handle& imageHandle, IPCCa
     _webFrame->page()->beginPrinting(_webFrame.get(), printInfo);
 
     IPCCallbackContext* context = new IPCCallbackContext;
-    RefPtr<DataCallback> callback = DataCallback::create([context](API::Data* data, WebKit::CallbackBase::Error) {
+    auto callback = DataCallback::create([context](API::Data* data, WebKit::CallbackBase::Error) {
         ASSERT(RunLoop::isMain());
 
         std::unique_ptr<IPCCallbackContext> contextDeleter(context);
@@ -286,7 +286,7 @@ static void pageDidDrawToImage(const ShareableBitmap::Handle& imageHandle, IPCCa
     context->view = self;
     context->callbackID = callback->callbackID();
 
-    _webFrame->page()->drawPagesToPDF(_webFrame.get(), printInfo, firstPage - 1, lastPage - firstPage + 1, callback.get());
+    _webFrame->page()->drawPagesToPDF(_webFrame.get(), printInfo, firstPage - 1, lastPage - firstPage + 1, WTFMove(callback));
 }
 
 static void pageDidComputePageRects(const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, IPCCallbackContext* context)
@@ -517,7 +517,7 @@ static CFStringRef linkDestinationName(PDFDocument *document, PDFDestination *de
                 _webFrame->page()->beginPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]));
 
                 IPCCallbackContext* context = new IPCCallbackContext;
-                RefPtr<ImageCallback> callback = ImageCallback::create([context](const ShareableBitmap::Handle& imageHandle, WebKit::CallbackBase::Error) {
+                auto callback = ImageCallback::create([context](const ShareableBitmap::Handle& imageHandle, WebKit::CallbackBase::Error) {
                     std::unique_ptr<IPCCallbackContext> contextDeleter(context);
                     pageDidDrawToImage(imageHandle, context);
                 });
@@ -527,7 +527,7 @@ static CFStringRef linkDestinationName(PDFDocument *document, PDFDestination *de
                 context->view = self;
                 context->callbackID = callback->callbackID();
 
-                _webFrame->page()->drawRectToImage(_webFrame.get(), PrintInfo([_printOperation printInfo]), scaledPrintingRect, imageSize, callback.get());
+                _webFrame->page()->drawRectToImage(_webFrame.get(), PrintInfo([_printOperation printInfo]), scaledPrintingRect, imageSize, WTFMove(callback));
                 return;
             }
         }
index fd36b41..17d35c9 100644 (file)
@@ -169,7 +169,7 @@ void NetscapePlugin::loadURL(const String& method, const String& urlString, cons
 
     if (target.isNull()) {
         // The browser is going to send the data in a stream, create a plug-in stream.
-        auto pluginStream = NetscapePluginStream::create(this, requestID, urlString, sendNotification, notificationData);
+        auto pluginStream = NetscapePluginStream::create(*this, requestID, urlString, sendNotification, notificationData);
         ASSERT(!m_streams.contains(requestID));
 
         m_streams.set(requestID, WTFMove(pluginStream));
@@ -897,7 +897,7 @@ void NetscapePlugin::manualStreamDidReceiveResponse(const URL& responseURL, uint
     ASSERT(m_shouldUseManualLoader);
     ASSERT(!m_manualStream);
     
-    m_manualStream = NetscapePluginStream::create(this, 0, responseURL.string(), false, 0);
+    m_manualStream = NetscapePluginStream::create(*this, 0, responseURL.string(), false, 0);
     m_manualStream->didReceiveResponse(responseURL, streamLength, lastModifiedTime, mimeType, headers);
 }
 
index 2349913..03718a2 100644 (file)
@@ -36,8 +36,8 @@ using namespace WebCore;
 
 namespace WebKit {
 
-NetscapePluginStream::NetscapePluginStream(PassRefPtr<NetscapePlugin> plugin, uint64_t streamID, const String& requestURLString, bool sendNotification, void* notificationData)
-    : m_plugin(plugin)
+NetscapePluginStream::NetscapePluginStream(Ref<NetscapePlugin>&& plugin, uint64_t streamID, const String& requestURLString, bool sendNotification, void* notificationData)
+    : m_plugin(WTFMove(plugin))
     , m_streamID(streamID)
     , m_requestURLString(requestURLString)
     , m_sendNotification(sendNotification)
index 7c7045f..3678097 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef NetscapePluginStream_h
-#define NetscapePluginStream_h
+#pragma once
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
 
@@ -32,7 +31,6 @@
 #include <WebCore/npruntime_internal.h>
 #include <memory>
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/RunLoop.h>
@@ -48,9 +46,9 @@ class NetscapePlugin;
 
 class NetscapePluginStream : public RefCounted<NetscapePluginStream> {
 public:
-    static Ref<NetscapePluginStream> create(PassRefPtr<NetscapePlugin> plugin, uint64_t streamID, const String& requestURLString, bool sendNotification, void* notificationData)
+    static Ref<NetscapePluginStream> create(Ref<NetscapePlugin>&& plugin, uint64_t streamID, const String& requestURLString, bool sendNotification, void* notificationData)
     {
-        return adoptRef(*new NetscapePluginStream(plugin, streamID, requestURLString, sendNotification, notificationData));
+        return adoptRef(*new NetscapePluginStream(WTFMove(plugin), streamID, requestURLString, sendNotification, notificationData));
     }
     ~NetscapePluginStream();
 
@@ -71,7 +69,7 @@ public:
     void setURL(const String& newURLString);
 
 private:
-    NetscapePluginStream(PassRefPtr<NetscapePlugin>, uint64_t streamID, const String& requestURLString, bool sendNotification, void* notificationData);
+    NetscapePluginStream(Ref<NetscapePlugin>&&, uint64_t streamID, const String& requestURLString, bool sendNotification, void* notificationData);
 
     bool start(const String& responseURLString, uint32_t streamLength, 
                uint32_t lastModifiedTime, const String& mimeType, const String& headers);
@@ -83,7 +81,7 @@ private:
     void deliverDataToPlugin();
     void deliverDataToFile(const char* bytes, int length);
 
-    RefPtr<NetscapePlugin> m_plugin;
+    Ref<NetscapePlugin> m_plugin;
     uint64_t m_streamID;
 
     String m_requestURLString;
@@ -116,5 +114,3 @@ private:
 } // namespace WebKit
 
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
-
-#endif // NetscapePluginStream_h
index f0e0e43..befac18 100644 (file)
@@ -122,7 +122,7 @@ PageState toPageState(const WebCore::HistoryItem& historyItem)
     return pageState;
 }
 
-static PassRefPtr<FormData> toFormData(const HTTPBody& httpBody)
+static Ref<FormData> toFormData(const HTTPBody& httpBody)
 {
     auto formData = FormData::create();
 
@@ -142,7 +142,7 @@ static PassRefPtr<FormData> toFormData(const HTTPBody& httpBody)
         }
     }
 
-    return WTFMove(formData);
+    return formData;
 }
 
 static void applyFrameState(HistoryItem& historyItem, const FrameState& frameState)