Stop using PassRefPtr under WebKit2/UIProcess
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2017 22:00:00 +0000 (22:00 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2017 22:00:00 +0000 (22:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172029

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::registerEditCommand):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(getIconSurfaceSynchronously):
* UIProcess/API/gtk/WebKitWebContext.cpp:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::registerEditCommand):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::registerEditCommand):
* UIProcess/DefaultUndoController.cpp:
(WebKit::DefaultUndoController::registerEditCommand):
* UIProcess/DefaultUndoController.h:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::create):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
* UIProcess/GeolocationPermissionRequestManagerProxy.h:
* UIProcess/InspectorServer/HTTPRequest.cpp:
(WebKit::HTTPRequest::parseHTTPRequestFromBuffer):
* UIProcess/InspectorServer/HTTPRequest.h:
* UIProcess/InspectorServer/WebInspectorServer.cpp:
(WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest):
(WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
(WebKit::WebInspectorServer::didEstablishWebSocketConnection):
* UIProcess/InspectorServer/WebInspectorServer.h:
* UIProcess/InspectorServer/WebSocketServerClient.h:
(WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
(WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
(WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::readHTTPMessage):
(WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection):
* UIProcess/InspectorServer/WebSocketServerConnection.h:
* UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
(WebKit::NotificationPermissionRequestManagerProxy::createRequest):
* UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
* UIProcess/Notifications/WebNotificationProvider.cpp:
(WebKit::WebNotificationProvider::notificationPermissions):
* UIProcess/Notifications/WebNotificationProvider.h:
* UIProcess/PageClient.h:
* UIProcess/Storage/LocalStorageDatabase.cpp:
* UIProcess/WebContextMenuListenerProxy.h:
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::unapply):
(WebKit::WebEditCommandProxy::reapply):
* UIProcess/WebEditCommandProxy.h:
* UIProcess/WebGrammarDetail.cpp:
(WebKit::WebGrammarDetail::create):
* UIProcess/WebGrammarDetail.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::ExceededDatabaseQuotaRecords::createRecord):
(WebKit::WebPageProxy::registerEditCommand):
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
(WebKit::WebPageProxy::takeViewSnapshot):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::plugInAutoStartOriginHashes):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(-[WKEditCommandObjC initWithWebEditCommandProxy:]):
(WebKit::PageClientImpl::registerEditCommand):
(WebKit::PageClientImpl::saveImageToLibrary):
(WebKit::PageClientImpl::setDragImage):
(WebKit::PageClientImpl::takeViewSnapshot):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::saveImageToLibrary):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::registerEditCommand):
(WebKit::PageClientImpl::setDragImage):
(WebKit::PageClientImpl::setPromisedDataForImage):
(WebKit::PageClientImpl::takeViewSnapshot):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _webHitTestResult]):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setDragImage):
(WebKit::WebPageProxy::setPromisedDataForImage):
* WebProcess/IconDatabase/WebIconDatabaseProxy.h:

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

52 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/wpe/PageClientImpl.h
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit2/UIProcess/DefaultUndoController.cpp
Source/WebKit2/UIProcess/DefaultUndoController.h
Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
Source/WebKit2/UIProcess/Downloads/DownloadProxy.h
Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp
Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.h
Source/WebKit2/UIProcess/InspectorServer/HTTPRequest.cpp
Source/WebKit2/UIProcess/InspectorServer/HTTPRequest.h
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.cpp
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.h
Source/WebKit2/UIProcess/InspectorServer/WebSocketServerClient.h
Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.cpp
Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.h
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h
Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp
Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp
Source/WebKit2/UIProcess/WebContextMenuListenerProxy.h
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebEditCommandProxy.cpp
Source/WebKit2/UIProcess/WebEditCommandProxy.h
Source/WebKit2/UIProcess/WebGrammarDetail.cpp
Source/WebKit2/UIProcess/WebGrammarDetail.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessPool.h
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/WKGeolocationProviderIOS.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h

index 7a12aca..60959de 100644 (file)
@@ -1,3 +1,103 @@
+2017-05-12  Chris Dumez  <cdumez@apple.com>
+
+        Stop using PassRefPtr under WebKit2/UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=172029
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _takeViewSnapshot]):
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::registerEditCommand):
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
+        (getIconSurfaceSynchronously):
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        * UIProcess/API/wpe/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::registerEditCommand):
+        * UIProcess/API/wpe/PageClientImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::registerEditCommand):
+        * UIProcess/DefaultUndoController.cpp:
+        (WebKit::DefaultUndoController::registerEditCommand):
+        * UIProcess/DefaultUndoController.h:
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::create):
+        * UIProcess/Downloads/DownloadProxy.h:
+        * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
+        (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
+        * UIProcess/GeolocationPermissionRequestManagerProxy.h:
+        * UIProcess/InspectorServer/HTTPRequest.cpp:
+        (WebKit::HTTPRequest::parseHTTPRequestFromBuffer):
+        * UIProcess/InspectorServer/HTTPRequest.h:
+        * UIProcess/InspectorServer/WebInspectorServer.cpp:
+        (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest):
+        (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
+        (WebKit::WebInspectorServer::didEstablishWebSocketConnection):
+        * UIProcess/InspectorServer/WebInspectorServer.h:
+        * UIProcess/InspectorServer/WebSocketServerClient.h:
+        (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
+        (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
+        (WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
+        * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
+        (WebKit::WebSocketServerConnection::readHTTPMessage):
+        (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection):
+        * UIProcess/InspectorServer/WebSocketServerConnection.h:
+        * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
+        (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
+        * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
+        * UIProcess/Notifications/WebNotificationProvider.cpp:
+        (WebKit::WebNotificationProvider::notificationPermissions):
+        * UIProcess/Notifications/WebNotificationProvider.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/Storage/LocalStorageDatabase.cpp:
+        * UIProcess/WebContextMenuListenerProxy.h:
+        * UIProcess/WebCookieManagerProxy.h:
+        * UIProcess/WebEditCommandProxy.cpp:
+        (WebKit::WebEditCommandProxy::unapply):
+        (WebKit::WebEditCommandProxy::reapply):
+        * UIProcess/WebEditCommandProxy.h:
+        * UIProcess/WebGrammarDetail.cpp:
+        (WebKit::WebGrammarDetail::create):
+        * UIProcess/WebGrammarDetail.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::ExceededDatabaseQuotaRecords::createRecord):
+        (WebKit::WebPageProxy::registerEditCommand):
+        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
+        (WebKit::WebPageProxy::exceededDatabaseQuota):
+        (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
+        (WebKit::WebPageProxy::takeViewSnapshot):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::plugInAutoStartOriginHashes):
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/WebProcessProxy.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
+        (WebKit::PageClientImpl::registerEditCommand):
+        (WebKit::PageClientImpl::saveImageToLibrary):
+        (WebKit::PageClientImpl::setDragImage):
+        (WebKit::PageClientImpl::takeViewSnapshot):
+        * UIProcess/ios/WKGeolocationProviderIOS.mm:
+        (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::saveImageToLibrary):
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::registerEditCommand):
+        (WebKit::PageClientImpl::setDragImage):
+        (WebKit::PageClientImpl::setPromisedDataForImage):
+        (WebKit::PageClientImpl::takeViewSnapshot):
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController _webHitTestResult]):
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::setDragImage):
+        (WebKit::WebPageProxy::setPromisedDataForImage):
+        * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
+
 2017-05-12  Jeremy Jones  <jeremyj@apple.com>
 
         Add UIClient callback for when picture-in-picture is activated.
index 1d22593..e4f04d4 100644 (file)
@@ -539,7 +539,7 @@ void WKContextClearCachedCredentials(WKContextRef context)
 
 WKDictionaryRef WKContextCopyPlugInAutoStartOriginHashes(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->plugInAutoStartOriginHashes().leakRef());
+    return toAPI(&toImpl(contextRef)->plugInAutoStartOriginHashes().leakRef());
 }
 
 void WKContextSetPlugInAutoStartOriginHashes(WKContextRef contextRef, WKDictionaryRef dictionaryRef)
index afd9895..e2f39cd 100644 (file)
@@ -41,7 +41,7 @@ WKTypeID WKGrammarDetailGetTypeID()
 WKGrammarDetailRef WKGrammarDetailCreate(int location, int length, WKArrayRef guesses, WKStringRef userDescription)
 {
     auto detail = WebGrammarDetail::create(location, length, toImpl(guesses), toWTFString(userDescription));
-    return toAPI(detail.leakRef());
+    return toAPI(&detail.leakRef());
 }
 
 int WKGrammarDetailGetLocation(WKGrammarDetailRef grammarDetailRef)
index 8ebce08..4821e3a 100644 (file)
@@ -1632,7 +1632,7 @@ static inline bool areEssentiallyEqualAsFloat(float a, float b)
     _scaleToRestore = scale;
 }
 
-- (PassRefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot
+- (RefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot
 {
     float deviceScale = WebCore::screenScaleFactor();
     WebCore::FloatSize snapshotSize(self.bounds.size);
index 3d6066e..5293807 100644 (file)
@@ -85,7 +85,7 @@ struct PrintInfo;
 - (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)insets scale:(double)scale;
 - (void)_restorePageStateToUnobscuredCenter:(std::optional<WebCore::FloatPoint>)center scale:(double)scale; // FIXME: needs scroll origin?
 
-- (PassRefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot;
+- (RefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot;
 
 - (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin;
 - (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance;
index fb7c85e..98e0673 100644 (file)
@@ -147,9 +147,9 @@ void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttribut
     notImplemented();
 }
 
-void PageClientImpl::registerEditCommand(PassRefPtr<WebEditCommandProxy> command, WebPageProxy::UndoOrRedo undoOrRedo)
+void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, WebPageProxy::UndoOrRedo undoOrRedo)
 {
-    m_undoController.registerEditCommand(command, undoOrRedo);
+    m_undoController.registerEditCommand(WTFMove(command), undoOrRedo);
 }
 
 void PageClientImpl::clearAllEditCommands()
index 1c618e1..a01bf07 100644 (file)
@@ -71,7 +71,7 @@ private:
     void setCursor(const WebCore::Cursor&) override;
     void setCursorHiddenUntilMouseMoves(bool) override;
     void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) override;
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo) override;
     void clearAllEditCommands() override;
     bool canUndoRedo(WebPageProxy::UndoOrRedo) override;
     void executeUndoRedo(WebPageProxy::UndoOrRedo) override;
index 74654bb..f388209 100644 (file)
@@ -131,7 +131,7 @@ struct GetFaviconSurfaceAsyncData {
 };
 WEBKIT_DEFINE_ASYNC_DATA_STRUCT(GetFaviconSurfaceAsyncData)
 
-static PassRefPtr<cairo_surface_t> getIconSurfaceSynchronously(WebKitFaviconDatabase* database, const String& pageURL, GError** error)
+static RefPtr<cairo_surface_t> getIconSurfaceSynchronously(WebKitFaviconDatabase* database, const String& pageURL, GError** error)
 {
     ASSERT(RunLoop::isMain());
 
@@ -140,16 +140,16 @@ static PassRefPtr<cairo_surface_t> getIconSurfaceSynchronously(WebKitFaviconData
     WebCore::Image* iconImage = database->priv->iconDatabase->imageForPageURL(pageURL, WebCore::IntSize(1, 1));
     if (!iconImage) {
         g_set_error(error, WEBKIT_FAVICON_DATABASE_ERROR, WEBKIT_FAVICON_DATABASE_ERROR_FAVICON_UNKNOWN, _("Unknown favicon for page %s"), pageURL.utf8().data());
-        return 0;
+        return nullptr;
     }
 
     RefPtr<cairo_surface_t> surface = iconImage->nativeImageForCurrentFrame();
     if (!surface) {
         g_set_error(error, WEBKIT_FAVICON_DATABASE_ERROR, WEBKIT_FAVICON_DATABASE_ERROR_FAVICON_NOT_FOUND, _("Page %s does not have a favicon"), pageURL.utf8().data());
-        return 0;
+        return nullptr;
     }
 
-    return surface.release();
+    return surface;
 }
 
 static void deletePendingIconRequests(WebKitFaviconDatabase* database, PendingIconRequestVector* requests, const String& pageURL)
index 9629314..d17d276 100644 (file)
@@ -63,8 +63,8 @@
 #include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 #include <wtf/glib/GRefPtr.h>
 #include <wtf/glib/GUniquePtr.h>
 #include <wtf/text/CString.h>
index d165309..3163949 100644 (file)
@@ -132,7 +132,7 @@ void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttribut
 {
 }
 
-void PageClientImpl::registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo)
+void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo)
 {
 }
 
index e79ace1..d1456be 100644 (file)
@@ -67,7 +67,7 @@ private:
     void setCursorHiddenUntilMouseMoves(bool) override;
     void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;
 
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) override;
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo) override;
     void clearAllEditCommands() override;
     bool canUndoRedo(WebPageProxy::UndoOrRedo) override;
     void executeUndoRedo(WebPageProxy::UndoOrRedo) override;
index 6a838e1..722c31e 100644 (file)
@@ -280,7 +280,7 @@ public:
     bool isEditable() const;
     bool executeSavedCommandBySelector(SEL);
     void executeEditCommandForSelector(SEL, const String& argument = String());
-    void registerEditCommand(RefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo);
     void clearAllEditCommands();
     bool writeSelectionToPasteboard(NSPasteboard *, NSArray *types);
     bool readSelectionFromPasteboard(NSPasteboard *);
index 28ea7ae..c225164 100644 (file)
@@ -2531,11 +2531,9 @@ void WebViewImpl::executeEditCommandForSelector(SEL selector, const String& argu
     m_page->executeEditCommand(commandNameForSelector(selector), argument);
 }
 
-void WebViewImpl::registerEditCommand(RefPtr<WebEditCommandProxy> prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
+void WebViewImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, WebPageProxy::UndoOrRedo undoOrRedo)
 {
-    RefPtr<WebEditCommandProxy> command = prpCommand;
-
-    RetainPtr<WKEditCommandObjC> commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command]);
+    RetainPtr<WKEditCommandObjC> commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command.ptr()]);
     String actionName = WebEditCommandProxy::nameForEditAction(command->editAction());
 
     NSUndoManager *undoManager = [m_view undoManager];
index a2df76c..9426b1e 100644 (file)
 
 namespace WebKit {
 
-void DefaultUndoController::registerEditCommand(PassRefPtr<WebEditCommandProxy> command, WebPageProxy::UndoOrRedo undoOrRedo)
+void DefaultUndoController::registerEditCommand(Ref<WebEditCommandProxy>&& command, WebPageProxy::UndoOrRedo undoOrRedo)
 {
     if (undoOrRedo == WebPageProxy::Undo)
-        m_undoStack.append(command);
+        m_undoStack.append(WTFMove(command));
     else
-        m_redoStack.append(command);
+        m_redoStack.append(WTFMove(command));
 }
 
 void DefaultUndoController::clearAllEditCommands()
index 31617a0..8002dc9 100644 (file)
@@ -29,7 +29,7 @@ namespace WebKit {
 
 class DefaultUndoController {
 public:
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo);
     void clearAllEditCommands();
     bool canUndoRedo(WebPageProxy::UndoOrRedo);
     void executeUndoRedo(WebPageProxy::UndoOrRedo);
index 10925e4..a535ac2 100644 (file)
@@ -51,9 +51,9 @@ static uint64_t generateDownloadID()
     return ++uniqueDownloadID;
 }
     
-PassRefPtr<DownloadProxy> DownloadProxy::create(DownloadProxyMap& downloadProxyMap, WebProcessPool& processPool, const ResourceRequest& resourceRequest)
+Ref<DownloadProxy> DownloadProxy::create(DownloadProxyMap& downloadProxyMap, WebProcessPool& processPool, const ResourceRequest& resourceRequest)
 {
-    return adoptRef(new DownloadProxy(downloadProxyMap, processPool, resourceRequest));
+    return adoptRef(*new DownloadProxy(downloadProxyMap, processPool, resourceRequest));
 }
 
 DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebProcessPool& processPool, const ResourceRequest& resourceRequest)
index 1cada8e..e2ae56e 100644 (file)
@@ -32,7 +32,7 @@
 #include "SandboxExtension.h"
 #include <WebCore/ResourceRequest.h>
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 
 namespace API {
 class Data;
@@ -54,7 +54,7 @@ class WebProcessPool;
 
 class DownloadProxy : public API::ObjectImpl<API::Object::Type::Download>, public IPC::MessageReceiver {
 public:
-    static PassRefPtr<DownloadProxy> create(DownloadProxyMap&, WebProcessPool&, const WebCore::ResourceRequest&);
+    static Ref<DownloadProxy> create(DownloadProxyMap&, WebProcessPool&, const WebCore::ResourceRequest&);
     ~DownloadProxy();
 
     DownloadID downloadID() const { return m_downloadID; }
index 0cf7045..2920137 100644 (file)
@@ -45,11 +45,11 @@ void GeolocationPermissionRequestManagerProxy::invalidateRequests()
     m_pendingRequests.clear();
 }
 
-PassRefPtr<GeolocationPermissionRequestProxy> GeolocationPermissionRequestManagerProxy::createRequest(uint64_t geolocationID)
+Ref<GeolocationPermissionRequestProxy> GeolocationPermissionRequestManagerProxy::createRequest(uint64_t geolocationID)
 {
     auto request = GeolocationPermissionRequestProxy::create(this, geolocationID);
     m_pendingRequests.add(geolocationID, request.ptr());
-    return WTFMove(request);
+    return request;
 }
 
 void GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
index 2f16927..83050f2 100644 (file)
@@ -40,7 +40,7 @@ public:
     void invalidateRequests();
 
     // Create a request to be presented to the user.
-    PassRefPtr<GeolocationPermissionRequestProxy> createRequest(uint64_t geolocationID);
+    Ref<GeolocationPermissionRequestProxy> createRequest(uint64_t geolocationID);
     
     // Called by GeolocationPermissionRequestProxy when a decision is made by the user.
     void didReceiveGeolocationPermissionDecision(uint64_t, bool allow);
index a38f272..846a5c8 100644 (file)
@@ -35,15 +35,15 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassRefPtr<HTTPRequest> HTTPRequest::parseHTTPRequestFromBuffer(const char* data, size_t length, String& failureReason)
+RefPtr<HTTPRequest> HTTPRequest::parseHTTPRequestFromBuffer(const char* data, size_t length, String& failureReason)
 {
     if (!length) {
         failureReason = "No data to parse.";
-        return 0;
+        return nullptr;
     }
 
     // Request we will be building.
-    RefPtr<HTTPRequest> request = HTTPRequest::create();
+    auto request = HTTPRequest::create();
 
     // Advance a pointer through the data as needed.
     const char* pos = data;
@@ -52,14 +52,14 @@ PassRefPtr<HTTPRequest> HTTPRequest::parseHTTPRequestFromBuffer(const char* data
     // 1. Parse Method + URL.
     size_t requestLineLength = request->parseRequestLine(pos, remainingLength, failureReason);
     if (!requestLineLength)
-        return 0;
+        return nullptr;
     pos += requestLineLength;
     remainingLength -= requestLineLength;
 
     // 2. Parse HTTP Headers.
     size_t headersLength = request->parseHeaders(pos, remainingLength, failureReason);
     if (!headersLength)
-        return 0;
+        return nullptr;
     pos += headersLength;
     remainingLength -= headersLength;
 
@@ -70,7 +70,7 @@ PassRefPtr<HTTPRequest> HTTPRequest::parseHTTPRequestFromBuffer(const char* data
 
     // We should have processed the entire input.
     ASSERT(!remainingLength);
-    return request.release();
+    return WTFMove(request);
 }
 
 size_t HTTPRequest::parseRequestLine(const char* data, size_t length, String& failureReason)
index 590295c..29155f0 100644 (file)
@@ -37,8 +37,8 @@
 #include <WebCore/HTTPHeaderMap.h>
 #include <WebCore/HTTPParsers.h>
 #include <WebCore/URL.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebKit {
@@ -47,7 +47,7 @@ class HTTPRequest : public RefCounted<HTTPRequest> {
 public:
     static Ref<HTTPRequest> create() { return adoptRef(*new HTTPRequest()); }
     static Ref<HTTPRequest> create(const String& requestMethod, const WebCore::URL& url, WebCore::HTTPVersion version) { return adoptRef(*new HTTPRequest(requestMethod, url, version)); }
-    static PassRefPtr<HTTPRequest> parseHTTPRequestFromBuffer(const char* data, size_t length, String& failureReason);
+    static RefPtr<HTTPRequest> parseHTTPRequestFromBuffer(const char* data, size_t length, String& failureReason);
     virtual ~HTTPRequest();
 
     String requestMethod() const { return m_requestMethod; }
index 6638774..4909a1b 100644 (file)
@@ -107,7 +107,7 @@ void WebInspectorServer::sendMessageOverConnection(unsigned pageIdForConnection,
         connection->sendWebSocketMessage(message);
 }
 
-void WebInspectorServer::didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection* connection, PassRefPtr<HTTPRequest> request)
+void WebInspectorServer::didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection* connection, Ref<HTTPRequest>&& request)
 {
     // request->url() contains only the path extracted from the HTTP request line
     // and URL is poor at parsing incomplete URLs, so extract the interesting parts manually.
@@ -136,7 +136,7 @@ void WebInspectorServer::didReceiveUnrecognizedHTTPRequest(WebSocketServerConnec
     connection->shutdownAfterSendOrNow();
 }
 
-bool WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest> request)
+bool WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, Ref<HTTPRequest>&& request)
 {
     String path = request->url();
 
@@ -160,7 +160,7 @@ bool WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerCo
     return true;
 }
 
-void WebInspectorServer::didEstablishWebSocketConnection(WebSocketServerConnection* connection, PassRefPtr<HTTPRequest> request)
+void WebInspectorServer::didEstablishWebSocketConnection(WebSocketServerConnection* connection, Ref<HTTPRequest>&& request)
 {
     String path = request->url();
     unsigned pageId = pageIdFromRequestPath(path);
index 9281aa5..14ba522 100644 (file)
@@ -53,9 +53,9 @@ private:
     ~WebInspectorServer();
 
     // WebSocketServerClient implementation. Events coming from remote connections.
-    void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) final;
-    bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) final;
-    void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) final;
+    void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, Ref<HTTPRequest>&&) final;
+    bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, Ref<HTTPRequest>&&) final;
+    void didEstablishWebSocketConnection(WebSocketServerConnection*, Ref<HTTPRequest>&&) final;
     void didReceiveWebSocketMessage(WebSocketServerConnection*, const String& message) final;
     void didCloseWebSocketConnection(WebSocketServerConnection*) final;
 
index a73a0f3..c6fac39 100644 (file)
@@ -29,7 +29,7 @@
 #if ENABLE(INSPECTOR_SERVER)
 
 #include "HTTPRequest.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebKit {
@@ -41,13 +41,13 @@ public:
     virtual ~WebSocketServerClient() { }
 
     // Received an HTTP request but didn't know what to do with it.
-    virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) { }
+    virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, Ref<HTTPRequest>&&) { }
 
     // Received a WebSocket Upgrade HTTP request. Ask if we should handle it and upgrade.
-    virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) { return true; }
+    virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, Ref<HTTPRequest>&&) { return true; }
 
     // Established a WebSocket Connection.
-    virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) { }
+    virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, Ref<HTTPRequest>&&) { }
 
     // Received a WebSocket message.
     virtual void didReceiveWebSocketMessage(WebSocketServerConnection*, const String&) { }
index 7e0525c..1177f6f 100644 (file)
@@ -173,7 +173,7 @@ void WebSocketServerConnection::readHTTPMessage()
     const HTTPHeaderMap& headers = request->headerFields();
     String upgradeHeaderValue = headers.get(HTTPHeaderName::Upgrade);
     if (upgradeHeaderValue == "websocket") {
-        upgradeToWebSocketServerConnection(request);
+        upgradeToWebSocketServerConnection(request.releaseNonNull());
         return;
     }
     if (upgradeHeaderValue == "WebSocket") {
@@ -182,24 +182,21 @@ void WebSocketServerConnection::readHTTPMessage()
     }
 
     // Otherwise, this is an HTTP Request we don't know how to deal with.
-    m_client->didReceiveUnrecognizedHTTPRequest(this, request);
+    m_client->didReceiveUnrecognizedHTTPRequest(this, request.releaseNonNull());
 }
 
-void WebSocketServerConnection::upgradeToWebSocketServerConnection(PassRefPtr<HTTPRequest> request)
+void WebSocketServerConnection::upgradeToWebSocketServerConnection(Ref<HTTPRequest>&& request)
 {
-    ASSERT(request);
     ASSERT(m_mode == HTTP);
     m_mode = WebSocket;
-    RefPtr<HTTPRequest> protectedRequest(request);
-
     // Ask the client if we should upgrade for this or not.
-    if (!m_client->didReceiveWebSocketUpgradeHTTPRequest(this, protectedRequest)) {
+    if (!m_client->didReceiveWebSocketUpgradeHTTPRequest(this, request.copyRef())) {
         shutdownNow();
         return;
     }
 
     // Build and send the WebSocket handshake response.
-    const HTTPHeaderMap& requestHeaders = protectedRequest->headerFields();
+    const HTTPHeaderMap& requestHeaders = request->headerFields();
     String accept = WebSocketHandshake::getExpectedWebSocketAccept(requestHeaders.get(HTTPHeaderName::SecWebSocketKey));
     HTTPHeaderMap responseHeaders;
     responseHeaders.add("Upgrade", requestHeaders.get(HTTPHeaderName::Upgrade));
@@ -208,7 +205,7 @@ void WebSocketServerConnection::upgradeToWebSocketServerConnection(PassRefPtr<HT
 
     sendHTTPResponseHeader(101, "WebSocket Protocol Handshake", responseHeaders);
 
-    m_client->didEstablishWebSocketConnection(this, protectedRequest);
+    m_client->didEstablishWebSocketConnection(this, WTFMove(request));
 }
 
 void WebSocketServerConnection::readWebSocketFrames()
index e913974..5ecf751 100644 (file)
@@ -29,7 +29,7 @@
 #if ENABLE(INSPECTOR_SERVER)
 
 #include <WebCore/SocketStreamHandleClient.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
@@ -78,7 +78,7 @@ private:
     void readHTTPMessage();
 
     // WebSocket Mode.
-    void upgradeToWebSocketServerConnection(PassRefPtr<HTTPRequest>);
+    void upgradeToWebSocketServerConnection(Ref<HTTPRequest>&&);
     void readWebSocketFrames();
     bool readWebSocketFrame();
 
index 818a525..6265844 100644 (file)
@@ -46,11 +46,11 @@ void NotificationPermissionRequestManagerProxy::invalidateRequests()
     m_pendingRequests.clear();
 }
 
-PassRefPtr<NotificationPermissionRequest> NotificationPermissionRequestManagerProxy::createRequest(uint64_t notificationID)
+Ref<NotificationPermissionRequest> NotificationPermissionRequestManagerProxy::createRequest(uint64_t notificationID)
 {
     auto request = NotificationPermissionRequest::create(this, notificationID);
     m_pendingRequests.add(notificationID, request.ptr());
-    return WTFMove(request);
+    return request;
 }
 
 void NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allow)
index 5bc83f6..10e4b18 100644 (file)
@@ -41,7 +41,7 @@ public:
     void invalidateRequests();
     
     // Create a request to be presented to the user.
-    PassRefPtr<NotificationPermissionRequest> createRequest(uint64_t notificationID);
+    Ref<NotificationPermissionRequest> createRequest(uint64_t notificationID);
     
     // Called by NotificationPermissionRequest when a decision is made by the user.
     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allow);
index a2a83ad..db3588c 100644 (file)
@@ -91,7 +91,7 @@ void WebNotificationProvider::removeNotificationManager(WebNotificationManagerPr
     m_client.removeNotificationManager(toAPI(manager), m_client.base.clientInfo);
 }
 
-PassRefPtr<API::Dictionary> WebNotificationProvider::notificationPermissions()
+RefPtr<API::Dictionary> WebNotificationProvider::notificationPermissions()
 {
     if (!m_client.notificationPermissions)
         return API::Dictionary::create();
index 14fabe1..262b1e5 100644 (file)
@@ -56,7 +56,7 @@ public:
     void addNotificationManager(WebNotificationManagerProxy*);
     void removeNotificationManager(WebNotificationManagerProxy*);
     
-    PassRefPtr<API::Dictionary> notificationPermissions();
+    RefPtr<API::Dictionary> notificationPermissions();
 };
 
 } // namespace WebKit
index 07ef0b2..3db7ebe 100644 (file)
@@ -165,7 +165,7 @@ public:
     virtual void setCursorHiddenUntilMouseMoves(bool) = 0;
     virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) = 0;
 
-    virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) = 0;
+    virtual void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo) = 0;
     virtual void clearAllEditCommands() = 0;
     virtual bool canUndoRedo(WebPageProxy::UndoOrRedo) = 0;
     virtual void executeUndoRedo(WebPageProxy::UndoOrRedo) = 0;
@@ -173,14 +173,14 @@ public:
 #if PLATFORM(COCOA)
     virtual void accessibilityWebProcessTokenReceived(const IPC::DataReference&) = 0;
     virtual bool executeSavedCommandBySelector(const String& selector) = 0;
-    virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, WebCore::DragSourceAction) = 0;
+    virtual void setDragImage(const WebCore::IntPoint& clientPosition, Ref<ShareableBitmap>&& dragImage, WebCore::DragSourceAction) = 0;
     virtual void updateSecureInputState() = 0;
     virtual void resetSecureInputState() = 0;
     virtual void notifyInputContextAboutDiscardedComposition() = 0;
     virtual void makeFirstResponder() = 0;
     virtual void setAcceleratedCompositingRootLayer(LayerOrView *) = 0;
     virtual LayerOrView *acceleratedCompositingRootLayer() const = 0;
-    virtual PassRefPtr<ViewSnapshot> takeViewSnapshot() = 0;
+    virtual RefPtr<ViewSnapshot> takeViewSnapshot() = 0;
 #if ENABLE(MAC_GESTURE_EVENTS)
     virtual void gestureEventWasNotHandledByWebCore(const NativeWebGestureEvent&) = 0;
 #endif
@@ -191,12 +191,9 @@ public:
 #endif
 
 #if USE(APPKIT)
-    virtual void setPromisedDataForImage(const String& pasteboardName, PassRefPtr<WebCore::SharedBuffer> imageBuffer, const String& filename, const String& extension, const String& title,
-                                 const String& url, const String& visibleUrl, PassRefPtr<WebCore::SharedBuffer> archiveBuffer) = 0;
+    virtual void setPromisedDataForImage(const String& pasteboardName, Ref<WebCore::SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl, RefPtr<WebCore::SharedBuffer>&& archiveBuffer) = 0;
 #if ENABLE(ATTACHMENT_ELEMENT)
-    virtual void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title,
-                                         const String& url, const String& visibleUrl) = 0;
-
+    virtual void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl) = 0;
 #endif
 #endif
 
@@ -305,7 +302,7 @@ public:
     virtual bool isAssistingNode() = 0;
     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;
     virtual void positionInformationDidChange(const InteractionInformationAtPosition&) = 0;
-    virtual void saveImageToLibrary(PassRefPtr<WebCore::SharedBuffer>) = 0;
+    virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0;
     virtual bool allowsBlockSelection() = 0;
     virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) = 0;
index 632657b..598a3bd 100644 (file)
@@ -33,7 +33,7 @@
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/StorageMap.h>
 #include <WebCore/SuddenTermination.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 #include <wtf/WorkQueue.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/WTFString.h>
index 3a0afe4..23324fd 100644 (file)
@@ -30,7 +30,6 @@
 #include "APIObject.h"
 #include "WKArray.h"
 #include "WebContextMenuProxy.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebKit {
index 5b0f757..27aa2ac 100644 (file)
@@ -31,7 +31,6 @@
 #include "WebContextSupplement.h"
 #include "WebCookieManagerProxyClient.h"
 #include <WebCore/SessionID.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
index 24c62fb..a0c9e2c 100644 (file)
@@ -56,7 +56,7 @@ void WebEditCommandProxy::unapply()
         return;
 
     m_page->process().send(Messages::WebPage::UnapplyEditCommand(m_commandID), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
-    m_page->registerEditCommand(this, WebPageProxy::Redo);
+    m_page->registerEditCommand(*this, WebPageProxy::Redo);
 }
 
 void WebEditCommandProxy::reapply()
@@ -65,7 +65,7 @@ void WebEditCommandProxy::reapply()
         return;
 
     m_page->process().send(Messages::WebPage::ReapplyEditCommand(m_commandID), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
-    m_page->registerEditCommand(this, WebPageProxy::Undo);
+    m_page->registerEditCommand(*this, WebPageProxy::Undo);
 }
 
 String WebEditCommandProxy::nameForEditAction(EditAction editAction)
index c375000..070906f 100644 (file)
@@ -28,8 +28,8 @@
 #include "APIObject.h"
 #include <WebCore/EditAction.h>
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 
 namespace WebKit {
 
index 0fe1bfb..6ee441b 100644 (file)
 
 namespace WebKit {
 
-PassRefPtr<WebGrammarDetail> WebGrammarDetail::create(int location, int length, API::Array* guesses, const String& userDescription)
+Ref<WebGrammarDetail> WebGrammarDetail::create(int location, int length, API::Array* guesses, const String& userDescription)
 {
-    return adoptRef(new WebGrammarDetail(location, length, guesses, userDescription));
+    return adoptRef(*new WebGrammarDetail(location, length, guesses, userDescription));
 }
 
-PassRefPtr<WebGrammarDetail> WebGrammarDetail::create(const WebCore::GrammarDetail& grammarDetail)
+Ref<WebGrammarDetail> WebGrammarDetail::create(const WebCore::GrammarDetail& grammarDetail)
 {
-    return adoptRef(new WebGrammarDetail(grammarDetail));
+    return adoptRef(*new WebGrammarDetail(grammarDetail));
 }
 
 WebGrammarDetail::WebGrammarDetail(int location, int length, API::Array* guesses, const String& userDescription)
index 7d17705..296c414 100644 (file)
 #include "APIObject.h"
 #include <WebCore/TextCheckerClient.h>
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 
 namespace WebKit {
 
 class WebGrammarDetail : public API::ObjectImpl<API::Object::Type::GrammarDetail> {
 public:
-    static PassRefPtr<WebGrammarDetail> create(int location, int length, API::Array* guesses, const String& userDescription);
-    static PassRefPtr<WebGrammarDetail> create(const WebCore::GrammarDetail&);
+    static Ref<WebGrammarDetail> create(int location, int length, API::Array* guesses, const String& userDescription);
+    static Ref<WebGrammarDetail> create(const WebCore::GrammarDetail&);
 
     int location() const { return m_grammarDetail.location; }
     int length() const { return m_grammarDetail.length; }
index 37e0319..efc8773 100644 (file)
@@ -223,7 +223,7 @@ public:
     std::unique_ptr<Record> createRecord(uint64_t frameID, String originIdentifier,
         String databaseName, String displayName, uint64_t currentQuota,
         uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, 
-        PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
+        Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&&);
 
     void add(std::unique_ptr<Record>);
     bool areBeingProcessed() const { return !!m_currentRecord; }
@@ -246,7 +246,7 @@ ExceededDatabaseQuotaRecords& ExceededDatabaseQuotaRecords::singleton()
 std::unique_ptr<ExceededDatabaseQuotaRecords::Record> ExceededDatabaseQuotaRecords::createRecord(
     uint64_t frameID, String originIdentifier, String databaseName, String displayName,
     uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage,
-    uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> reply)
+    uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&& reply)
 {
     auto record = std::make_unique<Record>();
     record->frameID = frameID;
@@ -257,7 +257,7 @@ std::unique_ptr<ExceededDatabaseQuotaRecords::Record> ExceededDatabaseQuotaRecor
     record->currentOriginUsage = currentOriginUsage;
     record->currentDatabaseUsage = currentDatabaseUsage;
     record->expectedUsage = expectedUsage;
-    record->reply = reply;
+    record->reply = WTFMove(reply);
     return record;
 }
 
@@ -4758,9 +4758,9 @@ void WebPageProxy::changeSpellingToWord(const String& word)
     m_process->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
 }
 
-void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
+void WebPageProxy::registerEditCommand(Ref<WebEditCommandProxy>&& commandProxy, UndoOrRedo undoOrRedo)
 {
-    m_pageClient.registerEditCommand(commandProxy, undoOrRedo);
+    m_pageClient.registerEditCommand(WTFMove(commandProxy), undoOrRedo);
 }
 
 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
@@ -5671,26 +5671,23 @@ void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const Aut
     didReceiveAuthenticationChallengeProxy(frameID, AuthenticationChallengeProxy::create(coreChallenge, challengeID, m_process->connection()));
 }
 
-void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy> prpAuthenticationChallenge)
+void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&& authenticationChallenge)
 {
-    ASSERT(prpAuthenticationChallenge);
-
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
-    RefPtr<AuthenticationChallengeProxy> authenticationChallenge = prpAuthenticationChallenge;
     if (m_navigationClient)
-        m_navigationClient->didReceiveAuthenticationChallenge(*this, authenticationChallenge.get());
+        m_navigationClient->didReceiveAuthenticationChallenge(*this, authenticationChallenge.ptr());
     else
-        m_loaderClient->didReceiveAuthenticationChallengeInFrame(*this, *frame, authenticationChallenge.get());
+        m_loaderClient->didReceiveAuthenticationChallengeInFrame(*this, *frame, authenticationChallenge.ptr());
 }
 
-void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> reply)
+void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&& reply)
 {
     ExceededDatabaseQuotaRecords& records = ExceededDatabaseQuotaRecords::singleton();
     std::unique_ptr<ExceededDatabaseQuotaRecords::Record> newRecord = records.createRecord(frameID,
         originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage,
-        currentDatabaseUsage, expectedUsage, reply);
+        currentDatabaseUsage, expectedUsage, WTFMove(reply));
     records.add(WTFMove(newRecord));
 
     if (records.areBeingProcessed())
@@ -5712,10 +5709,10 @@ void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originI
     }
 }
 
-void WebPageProxy::reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply> reply)
+void WebPageProxy::reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Ref<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>&& reply)
 {
     Ref<SecurityOrigin> securityOrigin = SecurityOriginData::fromDatabaseIdentifier(originIdentifier)->securityOrigin();
-    m_uiClient->reachedApplicationCacheOriginQuota(this, securityOrigin.get(), currentQuota, totalBytesNeeded, [reply](unsigned long long newQuota) { reply->send(newQuota); });
+    m_uiClient->reachedApplicationCacheOriginQuota(this, securityOrigin.get(), currentQuota, totalBytesNeeded, [reply = WTFMove(reply)](unsigned long long newQuota) { reply->send(newQuota); });
 }
 
 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
@@ -6185,7 +6182,7 @@ void WebPageProxy::setEditableElementIsFocused(bool editableElementIsFocused)
 #endif // PLATFORM(MAC)
 
 #if PLATFORM(COCOA)
-PassRefPtr<ViewSnapshot> WebPageProxy::takeViewSnapshot()
+RefPtr<ViewSnapshot> WebPageProxy::takeViewSnapshot()
 {
     return m_pageClient.takeViewSnapshot();
 }
index 35be01a..d47c0c9 100644 (file)
@@ -84,7 +84,6 @@
 #include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/Ref.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -860,7 +859,7 @@ public:
     void addEditCommand(WebEditCommandProxy*);
     void removeEditCommand(WebEditCommandProxy*);
     bool isValidEditCommand(WebEditCommandProxy*);
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
 
 #if PLATFORM(COCOA)
     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
@@ -1013,7 +1012,7 @@ public:
     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
     void setAutoSizingShouldExpandToViewHeight(bool);
 
-    void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
+    void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
 
     int64_t spellDocumentTag();
     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
@@ -1038,7 +1037,7 @@ public:
     void recordNavigationSnapshot(WebBackForwardListItem&);
 
 #if PLATFORM(COCOA)
-    PassRefPtr<ViewSnapshot> takeViewSnapshot();
+    RefPtr<ViewSnapshot> takeViewSnapshot();
 #endif
 
 #if ENABLE(SUBTLE_CRYPTO)
@@ -1312,8 +1311,8 @@ private:
     void pageDidScroll();
     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
     void printFrame(uint64_t frameID);
-    void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
-    void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>);
+    void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&&);
+    void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Ref<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>&&);
     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
 
 #if ENABLE(MEDIA_STREAM)
index 1c0b0d7..328109f 100644 (file)
@@ -1542,7 +1542,7 @@ void WebProcessPool::plugInDidReceiveUserInteraction(unsigned plugInOriginHash,
     m_plugInAutoStartProvider.didReceiveUserInteraction(plugInOriginHash, sessionID);
 }
 
-PassRefPtr<API::Dictionary> WebProcessPool::plugInAutoStartOriginHashes() const
+Ref<API::Dictionary> WebProcessPool::plugInAutoStartOriginHashes() const
 {
     return m_plugInAutoStartProvider.autoStartOriginsTableCopy();
 }
index b242a63..739b397 100644 (file)
@@ -49,7 +49,6 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounter.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/StringHash.h>
@@ -185,7 +184,7 @@ public:
     DownloadProxy* download(WebPageProxy* initiatingPage, const WebCore::ResourceRequest&, const String& suggestedFilename = { });
     DownloadProxy* resumeDownload(const API::Data* resumeData, const String& path);
 
-    void setInjectedBundleInitializationUserData(PassRefPtr<API::Object> userData) { m_injectedBundleInitializationUserData = userData; }
+    void setInjectedBundleInitializationUserData(RefPtr<API::Object>&& userData) { m_injectedBundleInitializationUserData = WTFMove(userData); }
 
     void postMessageToInjectedBundle(const String&, API::Object*);
 
@@ -306,7 +305,7 @@ public:
 
     void textCheckerStateChanged();
 
-    PassRefPtr<API::Dictionary> plugInAutoStartOriginHashes() const;
+    Ref<API::Dictionary> plugInAutoStartOriginHashes() const;
     void setPlugInAutoStartOriginHashes(API::Dictionary&);
     void setPlugInAutoStartOrigins(API::Array&);
     void setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime(API::Dictionary&, double time);
index a21ce04..41582a7 100644 (file)
@@ -43,8 +43,8 @@
 #include <memory>
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 
 namespace API {
 class PageConfiguration;
index 8b8ec8c..7ff0608 100644 (file)
@@ -73,13 +73,13 @@ private:
     void setCursor(const WebCore::Cursor&) override;
     void setCursorHiddenUntilMouseMoves(bool) override;
     void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) override;
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo) override;
     void clearAllEditCommands() override;
     bool canUndoRedo(WebPageProxy::UndoOrRedo) override;
     void executeUndoRedo(WebPageProxy::UndoOrRedo) override;
     void accessibilityWebProcessTokenReceived(const IPC::DataReference&) override;
     bool executeSavedCommandBySelector(const String& selector) override;
-    void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, WebCore::DragSourceAction) override;
+    void setDragImage(const WebCore::IntPoint& clientPosition, Ref<ShareableBitmap>&& dragImage, WebCore::DragSourceAction) override;
     void updateSecureInputState() override;
     void resetSecureInputState() override;
     void notifyInputContextAboutDiscardedComposition() override;
@@ -111,7 +111,7 @@ private:
     LayerOrView *acceleratedCompositingRootLayer() const override;
     LayerHostingMode viewLayerHostingMode() override { return LayerHostingMode::OutOfProcess; }
 
-    PassRefPtr<ViewSnapshot> takeViewSnapshot() override;
+    RefPtr<ViewSnapshot> takeViewSnapshot() override;
     void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
 
     void commitPotentialTapFailed() override;
@@ -131,7 +131,7 @@ private:
     void selectionDidChange() override;
     bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) override;
     void positionInformationDidChange(const InteractionInformationAtPosition&) override;
-    void saveImageToLibrary(PassRefPtr<WebCore::SharedBuffer>) override;
+    void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) override;
     bool allowsBlockSelection() override;
     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) override;
     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override;
index d3763e1..cd840c2 100644 (file)
@@ -64,7 +64,7 @@ using namespace WebKit;
 {
     RefPtr<WebEditCommandProxy> m_command;
 }
-- (id)initWithWebEditCommandProxy:(PassRefPtr<WebEditCommandProxy>)command;
+- (id)initWithWebEditCommandProxy:(Ref<WebEditCommandProxy>&&)command;
 - (WebEditCommandProxy*)command;
 @end
 
@@ -75,13 +75,13 @@ using namespace WebKit;
 
 @implementation WKEditCommandObjC
 
-- (id)initWithWebEditCommandProxy:(PassRefPtr<WebEditCommandProxy>)command
+- (id)initWithWebEditCommandProxy:(Ref<WebEditCommandProxy>&&)command
 {
     self = [super init];
     if (!self)
         return nil;
     
-    m_command = command;
+    m_command = WTFMove(command);
     return self;
 }
 
@@ -303,11 +303,9 @@ void PageClientImpl::didChangeViewportProperties(const ViewportAttributes&)
     notImplemented();
 }
 
-void PageClientImpl::registerEditCommand(PassRefPtr<WebEditCommandProxy> prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
+void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, WebPageProxy::UndoOrRedo undoOrRedo)
 {
-    RefPtr<WebEditCommandProxy> command = prpCommand;
-    
-    RetainPtr<WKEditCommandObjC> commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command]);
+    RetainPtr<WKEditCommandObjC> commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command.copyRef()]);
     String actionName = WebEditCommandProxy::nameForEditAction(command->editAction());
     
     NSUndoManager *undoManager = [m_contentView undoManager];
@@ -354,7 +352,7 @@ void PageClientImpl::positionInformationDidChange(const InteractionInformationAt
     [m_contentView _positionInformationDidChange:info];
 }
 
-void PageClientImpl::saveImageToLibrary(PassRefPtr<SharedBuffer> imageBuffer)
+void PageClientImpl::saveImageToLibrary(Ref<SharedBuffer>&& imageBuffer)
 {
     RetainPtr<NSData> imageData = imageBuffer->createNSData();
     UIImageDataWriteToSavedPhotosAlbum(imageData.get(), nil, NULL, NULL);
@@ -366,7 +364,7 @@ bool PageClientImpl::executeSavedCommandBySelector(const String&)
     return false;
 }
 
-void PageClientImpl::setDragImage(const IntPoint&, PassRefPtr<ShareableBitmap>, DragSourceAction)
+void PageClientImpl::setDragImage(const IntPoint&, Ref<ShareableBitmap>&&, DragSourceAction)
 {
     notImplemented();
 }
@@ -494,7 +492,7 @@ LayerOrView *PageClientImpl::acceleratedCompositingRootLayer() const
     return nullptr;
 }
 
-PassRefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot()
+RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot()
 {
     return [m_webView _takeViewSnapshot];
 }
index 31a375d..c198211 100644 (file)
@@ -46,7 +46,6 @@
 #import <wtf/Assertions.h>
 #import <wtf/BlockPtr.h>
 #import <wtf/HashSet.h>
-#import <wtf/PassRefPtr.h>
 #import <wtf/RefPtr.h>
 #import <wtf/RetainPtr.h>
 
@@ -67,7 +66,7 @@ using namespace WebKit;
 @end
 
 @interface WKWebAllowDenyPolicyListener : NSObject<WebAllowDenyPolicyListener>
-- (id)initWithPermissionRequestProxy:(PassRefPtr<GeolocationPermissionRequestProxy>)permissionRequestProxy;
+- (id)initWithPermissionRequestProxy:(RefPtr<GeolocationPermissionRequestProxy>&&)permissionRequestProxy;
 - (void)denyOnlyThisRequest NO_RETURN_DUE_TO_ASSERT;
 @end
 
@@ -333,13 +332,13 @@ static void setEnableHighAccuracy(WKGeolocationManagerRef geolocationManager, bo
     RefPtr<GeolocationPermissionRequestProxy> _permissionRequestProxy;
 }
 
-- (id)initWithPermissionRequestProxy:(PassRefPtr<GeolocationPermissionRequestProxy>)permissionRequestProxy
+- (id)initWithPermissionRequestProxy:(RefPtr<GeolocationPermissionRequestProxy>&&)permissionRequestProxy
 {
     self = [super init];
     if (!self)
         return nil;
 
-    _permissionRequestProxy = permissionRequestProxy;
+    _permissionRequestProxy = WTFMove(permissionRequestProxy);
     return self;
 }
 
index cfd1e23..a5c6fc4 100644 (file)
@@ -662,9 +662,9 @@ void WebPageProxy::performActionOnElement(uint32_t action)
 
 void WebPageProxy::saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize)
 {
-    RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::map(imageHandle, SharedMemory::Protection::ReadOnly);
-    RefPtr<SharedBuffer> buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), imageSize);
-    m_pageClient.saveImageToLibrary(buffer);
+    auto sharedMemoryBuffer = SharedMemory::map(imageHandle, SharedMemory::Protection::ReadOnly);
+    auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), imageSize);
+    m_pageClient.saveImageToLibrary(WTFMove(buffer));
 }
 
 void WebPageProxy::didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
index 3b6b0c6..0d997c2 100644 (file)
@@ -91,14 +91,14 @@ private:
     void setCursorHiddenUntilMouseMoves(bool) override;
     void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;
 
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) override;
+    void registerEditCommand(Ref<WebEditCommandProxy>&&, WebPageProxy::UndoOrRedo) override;
     void clearAllEditCommands() override;
     bool canUndoRedo(WebPageProxy::UndoOrRedo) override;
     void executeUndoRedo(WebPageProxy::UndoOrRedo) override;
     bool executeSavedCommandBySelector(const String& selector) override;
-    void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, WebCore::DragSourceAction) override;
-    void setPromisedDataForImage(const String& pasteboardName, PassRefPtr<WebCore::SharedBuffer> imageBuffer, const String& filename, const String& extension, const String& title,
-        const String& url, const String& visibleUrl, PassRefPtr<WebCore::SharedBuffer> archiveBuffer) override;
+    void setDragImage(const WebCore::IntPoint& clientPosition, Ref<ShareableBitmap>&& dragImage, WebCore::DragSourceAction) override;
+    void setPromisedDataForImage(const String& pasteboardName, Ref<WebCore::SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title,
+        const String& url, const String& visibleUrl, RefPtr<WebCore::SharedBuffer>&& archiveBuffer) override;
 #if ENABLE(ATTACHMENT_ELEMENT)
     void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl) override;
 #endif
@@ -142,7 +142,7 @@ private:
     void exitAcceleratedCompositingMode() override;
     void updateAcceleratedCompositingMode(const LayerTreeContext&) override;
 
-    PassRefPtr<ViewSnapshot> takeViewSnapshot() override;
+    RefPtr<ViewSnapshot> takeViewSnapshot() override;
     void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
 #if ENABLE(MAC_GESTURE_EVENTS)
     void gestureEventWasNotHandledByWebCore(const NativeWebGestureEvent&) override;
index 819785b..0a5aab5 100644 (file)
@@ -317,9 +317,9 @@ void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttribut
 {
 }
 
-void PageClientImpl::registerEditCommand(PassRefPtr<WebEditCommandProxy> prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
+void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, WebPageProxy::UndoOrRedo undoOrRedo)
 {
-    m_impl->registerEditCommand(prpCommand, undoOrRedo);
+    m_impl->registerEditCommand(WTFMove(command), undoOrRedo);
 }
 
 #if USE(INSERTION_UNDO_GROUPING)
@@ -344,7 +344,7 @@ void PageClientImpl::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
     return (undoOrRedo == WebPageProxy::Undo) ? [[m_view undoManager] undo] : [[m_view undoManager] redo];
 }
 
-void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, DragSourceAction action)
+void PageClientImpl::setDragImage(const IntPoint& clientPosition, Ref<ShareableBitmap>&& dragImage, DragSourceAction action)
 {
     RetainPtr<CGImageRef> dragCGImage = dragImage->makeCGImage();
     RetainPtr<NSImage> dragNSImage = adoptNS([[NSImage alloc] initWithCGImage:dragCGImage.get() size:dragImage->size()]);
@@ -355,10 +355,10 @@ void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<Sha
     m_impl->dragImageForView(m_view, dragNSImage.get(), clientPosition, action == DragSourceActionLink);
 }
 
-void PageClientImpl::setPromisedDataForImage(const String& pasteboardName, PassRefPtr<SharedBuffer> imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL, PassRefPtr<SharedBuffer> archiveBuffer)
+void PageClientImpl::setPromisedDataForImage(const String& pasteboardName, Ref<SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL, RefPtr<SharedBuffer>&& archiveBuffer)
 {
     RefPtr<Image> image = BitmapImage::create();
-    image->setData(imageBuffer.get(), true);
+    image->setData(WTFMove(imageBuffer), true);
     m_impl->setPromisedDataForImage(image.get(), filename, extension, title, url, visibleURL, archiveBuffer.get(), pasteboardName);
 }
 
@@ -503,7 +503,7 @@ CALayer *PageClientImpl::acceleratedCompositingRootLayer() const
     return m_impl->acceleratedCompositingRootLayer();
 }
 
-PassRefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot()
+RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot()
 {
     return m_impl->takeViewSnapshot();
 }
index e4becdb..b907f95 100644 (file)
@@ -254,7 +254,7 @@ using namespace WebKit;
     _page->setTextIndicatorAnimationProgress(1);
 }
 
-- (PassRefPtr<API::HitTestResult>)_webHitTestResult
+- (RefPtr<API::HitTestResult>)_webHitTestResult
 {
     RefPtr<API::HitTestResult> hitTestResult;
     if (_state == ImmediateActionState::Ready)
@@ -262,7 +262,7 @@ using namespace WebKit;
     else
         hitTestResult = _page->lastMouseMoveHitTestResult();
 
-    return WTFMove(hitTestResult);
+    return hitTestResult;
 }
 
 #pragma mark Immediate actions
index 340b9f0..17ccba4 100644 (file)
@@ -272,7 +272,7 @@ void WebPageProxy::replaceSelectionWithPasteboardData(const Vector<String>& type
 void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, std::optional<TextIndicatorData>, const FloatPoint&, uint64_t action)
 {
     if (auto dragImage = ShareableBitmap::create(dragImageHandle))
-        m_pageClient.setDragImage(clientPosition, WTFMove(dragImage), static_cast<DragSourceAction>(action));
+        m_pageClient.setDragImage(clientPosition, dragImage.releaseNonNull(), static_cast<DragSourceAction>(action));
 
     didStartDrag();
 }
@@ -283,14 +283,14 @@ void WebPageProxy::setPromisedDataForImage(const String& pasteboardName, const S
     MESSAGE_CHECK_URL(url);
     MESSAGE_CHECK_URL(visibleURL);
     RefPtr<SharedMemory> sharedMemoryImage = SharedMemory::map(imageHandle, SharedMemory::Protection::ReadOnly);
-    RefPtr<SharedBuffer> imageBuffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryImage->data()), imageSize);
+    auto imageBuffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryImage->data()), imageSize);
     RefPtr<SharedBuffer> archiveBuffer;
     
     if (!archiveHandle.isNull()) {
         RefPtr<SharedMemory> sharedMemoryArchive = SharedMemory::map(archiveHandle, SharedMemory::Protection::ReadOnly);
         archiveBuffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryArchive->data()), archiveSize);
     }
-    m_pageClient.setPromisedDataForImage(pasteboardName, imageBuffer, filename, extension, title, url, visibleURL, archiveBuffer);
+    m_pageClient.setPromisedDataForImage(pasteboardName, WTFMove(imageBuffer), filename, extension, title, url, visibleURL, WTFMove(archiveBuffer));
 }
 
 #if ENABLE(ATTACHMENT_ELEMENT)
index bdf8d4c..0a20d34 100644 (file)
@@ -29,7 +29,6 @@
 #include "MessageReceiver.h"
 #include <WebCore/IconDatabaseBase.h>
 #include <wtf/HashMap.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebKit {