API clients should not be passed by value to the setters
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 16:13:19 +0000 (16:13 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 16:13:19 +0000 (16:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173266

Reviewed by Alex Christensen.

By using a rvalue reference we make it more explicit that the ownership is transferred and we avoid the
parameter construction.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setClient):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::setProvider):
* UIProcess/WebGeolocationManagerProxy.h:
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::setClient):
* UIProcess/WebIconDatabase.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setHistoryClient):
(WebKit::WebPageProxy::setNavigationClient):
(WebKit::WebPageProxy::setLoaderClient):
(WebKit::WebPageProxy::setPolicyClient):
(WebKit::WebPageProxy::setFormClient):
(WebKit::WebPageProxy::setUIClient):
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::setFindClient):
(WebKit::WebPageProxy::setFindMatchesClient):
(WebKit::WebPageProxy::setDiagnosticLoggingClient):
(WebKit::WebPageProxy::setContextMenuClient):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::setFullscreenClient):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setHistoryClient):
(WebKit::WebProcessPool::setDownloadClient):
(WebKit::WebProcessPool::setAutomationClient):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setInjectedBundleContextMenuClient):
(WebKit::WebPage::setInjectedBundleEditorClient):
(WebKit::WebPage::setInjectedBundleFormClient):
(WebKit::WebPage::setInjectedBundlePageLoaderClient):
(WebKit::WebPage::setInjectedBundleUIClient):
* WebProcess/WebPage/WebPage.h:

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

13 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
Source/WebKit2/UIProcess/WebIconDatabase.cpp
Source/WebKit2/UIProcess/WebIconDatabase.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessPool.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h

index 1353d10..0ccd278 100644 (file)
@@ -1,5 +1,54 @@
 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        API clients should not be passed by value to the setters
+        https://bugs.webkit.org/show_bug.cgi?id=173266
+
+        Reviewed by Alex Christensen.
+
+        By using a rvalue reference we make it more explicit that the ownership is transferred and we avoid the
+        parameter construction.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::setClient):
+        * UIProcess/Automation/WebAutomationSession.h:
+        * UIProcess/WebGeolocationManagerProxy.cpp:
+        (WebKit::WebGeolocationManagerProxy::setProvider):
+        * UIProcess/WebGeolocationManagerProxy.h:
+        * UIProcess/WebIconDatabase.cpp:
+        (WebKit::WebIconDatabase::setClient):
+        * UIProcess/WebIconDatabase.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::setHistoryClient):
+        (WebKit::WebPageProxy::setNavigationClient):
+        (WebKit::WebPageProxy::setLoaderClient):
+        (WebKit::WebPageProxy::setPolicyClient):
+        (WebKit::WebPageProxy::setFormClient):
+        (WebKit::WebPageProxy::setUIClient):
+        (WebKit::WebPageProxy::setIconLoadingClient):
+        (WebKit::WebPageProxy::setFindClient):
+        (WebKit::WebPageProxy::setFindMatchesClient):
+        (WebKit::WebPageProxy::setDiagnosticLoggingClient):
+        (WebKit::WebPageProxy::setContextMenuClient):
+        (WebKit::WebPageProxy::close):
+        (WebKit::WebPageProxy::setFullscreenClient):
+        (WebKit::WebPageProxy::getLoadDecisionForIcon):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::setHistoryClient):
+        (WebKit::WebProcessPool::setDownloadClient):
+        (WebKit::WebProcessPool::setAutomationClient):
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setInjectedBundleContextMenuClient):
+        (WebKit::WebPage::setInjectedBundleEditorClient):
+        (WebKit::WebPage::setInjectedBundleFormClient):
+        (WebKit::WebPage::setInjectedBundlePageLoaderClient):
+        (WebKit::WebPage::setInjectedBundleUIClient):
+        * WebProcess/WebPage/WebPage.h:
+
+2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         [GTK] Use API::InjectedBundle::EditorClient in WebKitWebEditor
         https://bugs.webkit.org/show_bug.cgi?id=173355
 
index cb36653..ffe00f5 100644 (file)
@@ -63,7 +63,7 @@ WebAutomationSession::~WebAutomationSession()
         m_processPool->removeMessageReceiver(Messages::WebAutomationSession::messageReceiverName());
 }
 
-void WebAutomationSession::setClient(std::unique_ptr<API::AutomationSessionClient> client)
+void WebAutomationSession::setClient(std::unique_ptr<API::AutomationSessionClient>&& client)
 {
     m_client = WTFMove(client);
 }
index 61f9180..e5fb5f0 100644 (file)
@@ -78,7 +78,7 @@ public:
     WebAutomationSession();
     ~WebAutomationSession();
 
-    void setClient(std::unique_ptr<API::AutomationSessionClient>);
+    void setClient(std::unique_ptr<API::AutomationSessionClient>&&);
 
     void setSessionIdentifier(const String& sessionIdentifier) { m_sessionIdentifier = sessionIdentifier; }
     String sessionIdentifier() const { return m_sessionIdentifier; }
index 578f168..87b2968 100644 (file)
@@ -50,7 +50,7 @@ WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebProcessPool* processPo
     WebContextSupplement::processPool()->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), *this);
 }
 
-void WebGeolocationManagerProxy::setProvider(std::unique_ptr<API::GeolocationProvider> provider)
+void WebGeolocationManagerProxy::setProvider(std::unique_ptr<API::GeolocationProvider>&& provider)
 {
     if (!provider)
         m_provider = std::make_unique<API::GeolocationProvider>();
index ee9530c..1515392 100644 (file)
@@ -47,7 +47,7 @@ public:
 
     static Ref<WebGeolocationManagerProxy> create(WebProcessPool*);
 
-    void setProvider(std::unique_ptr<API::GeolocationProvider>);
+    void setProvider(std::unique_ptr<API::GeolocationProvider>&&);
 
     void providerDidChangePosition(WebGeolocationPosition*);
     void providerDidFailToDeterminePosition(const String& errorMessage = String());
index e9babba..b5fd2e3 100644 (file)
@@ -235,7 +235,7 @@ void WebIconDatabase::close()
         m_iconDatabaseImpl->close();
 }
 
-void WebIconDatabase::setClient(std::unique_ptr<API::IconDatabaseClient> client)
+void WebIconDatabase::setClient(std::unique_ptr<API::IconDatabaseClient>&& client)
 {
     if (!client)
         m_client = std::make_unique<API::IconDatabaseClient>();
index 3a562bd..8713a8b 100644 (file)
@@ -81,7 +81,7 @@ public:
     void checkIntegrityBeforeOpening();
     void close();
 
-    void setClient(std::unique_ptr<API::IconDatabaseClient>);
+    void setClient(std::unique_ptr<API::IconDatabaseClient>&&);
 
     void setPrivateBrowsingEnabled(bool);
 
index b1702c5..e446aea 100644 (file)
@@ -326,6 +326,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     , m_configuration(WTFMove(configuration))
     , m_loaderClient(std::make_unique<API::LoaderClient>())
     , m_policyClient(std::make_unique<API::PolicyClient>())
+    , m_iconLoadingClient(std::make_unique<API::IconLoadingClient>())
     , m_formClient(std::make_unique<API::FormClient>())
     , m_uiClient(std::make_unique<API::UIClient>())
     , m_findClient(std::make_unique<API::FindClient>())
@@ -469,17 +470,17 @@ void WebPageProxy::setPreferences(WebPreferences& preferences)
     preferencesDidChange();
 }
     
-void WebPageProxy::setHistoryClient(std::unique_ptr<API::HistoryClient> historyClient)
+void WebPageProxy::setHistoryClient(std::unique_ptr<API::HistoryClient>&& historyClient)
 {
     m_historyClient = WTFMove(historyClient);
 }
 
-void WebPageProxy::setNavigationClient(std::unique_ptr<API::NavigationClient> navigationClient)
+void WebPageProxy::setNavigationClient(std::unique_ptr<API::NavigationClient>&& navigationClient)
 {
     m_navigationClient = WTFMove(navigationClient);
 }
 
-void WebPageProxy::setLoaderClient(std::unique_ptr<API::LoaderClient> loaderClient)
+void WebPageProxy::setLoaderClient(std::unique_ptr<API::LoaderClient>&& loaderClient)
 {
     if (!loaderClient) {
         m_loaderClient = std::make_unique<API::LoaderClient>();
@@ -489,7 +490,7 @@ void WebPageProxy::setLoaderClient(std::unique_ptr<API::LoaderClient> loaderClie
     m_loaderClient = WTFMove(loaderClient);
 }
 
-void WebPageProxy::setPolicyClient(std::unique_ptr<API::PolicyClient> policyClient)
+void WebPageProxy::setPolicyClient(std::unique_ptr<API::PolicyClient>&& policyClient)
 {
     if (!policyClient) {
         m_policyClient = std::make_unique<API::PolicyClient>();
@@ -499,7 +500,7 @@ void WebPageProxy::setPolicyClient(std::unique_ptr<API::PolicyClient> policyClie
     m_policyClient = WTFMove(policyClient);
 }
 
-void WebPageProxy::setFormClient(std::unique_ptr<API::FormClient> formClient)
+void WebPageProxy::setFormClient(std::unique_ptr<API::FormClient>&& formClient)
 {
     if (!formClient) {
         m_formClient = std::make_unique<API::FormClient>();
@@ -509,7 +510,7 @@ void WebPageProxy::setFormClient(std::unique_ptr<API::FormClient> formClient)
     m_formClient = WTFMove(formClient);
 }
 
-void WebPageProxy::setUIClient(std::unique_ptr<API::UIClient> uiClient)
+void WebPageProxy::setUIClient(std::unique_ptr<API::UIClient>&& uiClient)
 {
     if (!uiClient) {
         m_uiClient = std::make_unique<API::UIClient>();
@@ -525,7 +526,7 @@ void WebPageProxy::setUIClient(std::unique_ptr<API::UIClient> uiClient)
     setCanRunModal(m_uiClient->canRunModal());
 }
 
-void WebPageProxy::setIconLoadingClient(std::unique_ptr<API::IconLoadingClient> iconLoadingClient)
+void WebPageProxy::setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&& iconLoadingClient)
 {
     bool hasClient = iconLoadingClient.get();
     if (!iconLoadingClient)
@@ -539,7 +540,7 @@ void WebPageProxy::setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>
     m_process->send(Messages::WebPage::SetUseIconLoadingClient(hasClient), m_pageID);
 }
 
-void WebPageProxy::setFindClient(std::unique_ptr<API::FindClient> findClient)
+void WebPageProxy::setFindClient(std::unique_ptr<API::FindClient>&& findClient)
 {
     if (!findClient) {
         m_findClient = std::make_unique<API::FindClient>();
@@ -549,7 +550,7 @@ void WebPageProxy::setFindClient(std::unique_ptr<API::FindClient> findClient)
     m_findClient = WTFMove(findClient);
 }
 
-void WebPageProxy::setFindMatchesClient(std::unique_ptr<API::FindMatchesClient> findMatchesClient)
+void WebPageProxy::setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&& findMatchesClient)
 {
     if (!findMatchesClient) {
         m_findMatchesClient = std::make_unique<API::FindMatchesClient>();
@@ -559,7 +560,7 @@ void WebPageProxy::setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>
     m_findMatchesClient = WTFMove(findMatchesClient);
 }
 
-void WebPageProxy::setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient> diagnosticLoggingClient)
+void WebPageProxy::setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&& diagnosticLoggingClient)
 {
     if (!diagnosticLoggingClient) {
         m_diagnosticLoggingClient = std::make_unique<API::DiagnosticLoggingClient>();
@@ -570,7 +571,7 @@ void WebPageProxy::setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLog
 }
 
 #if ENABLE(CONTEXT_MENUS)
-void WebPageProxy::setContextMenuClient(std::unique_ptr<API::ContextMenuClient> contextMenuClient)
+void WebPageProxy::setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&& contextMenuClient)
 {
     if (!contextMenuClient) {
         m_contextMenuClient = std::make_unique<API::ContextMenuClient>();
@@ -758,6 +759,7 @@ void WebPageProxy::close()
     m_loaderClient = std::make_unique<API::LoaderClient>();
     m_navigationClient = nullptr;
     m_policyClient = std::make_unique<API::PolicyClient>();
+    m_iconLoadingClient = std::make_unique<API::IconLoadingClient>();
     m_formClient = std::make_unique<API::FormClient>();
     m_uiClient = std::make_unique<API::UIClient>();
     m_findClient = std::make_unique<API::FindClient>();
@@ -766,6 +768,9 @@ void WebPageProxy::close()
 #if ENABLE(CONTEXT_MENUS)
     m_contextMenuClient = std::make_unique<API::ContextMenuClient>();
 #endif
+#if ENABLE(FULLSCREEN_API)
+    m_fullscreenClient = std::make_unique<API::FullscreenClient>();
+#endif
 
     m_webProcessLifetimeTracker.pageWasInvalidated();
 
@@ -4270,8 +4275,13 @@ WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
     return m_fullScreenManager.get();
 }
 
-void WebPageProxy::setFullscreenClient(std::unique_ptr<API::FullscreenClient> client)
+void WebPageProxy::setFullscreenClient(std::unique_ptr<API::FullscreenClient>&& client)
 {
+    if (!client) {
+        m_fullscreenClient = std::make_unique<API::FullscreenClient>();
+        return;
+    }
+
     m_fullscreenClient = WTFMove(client);
 }
 #endif
@@ -6741,9 +6751,6 @@ void WebPageProxy::didRestoreScrollPosition()
 
 void WebPageProxy::getLoadDecisionForIcon(const WebCore::LinkIcon& icon, uint64_t loadIdentifier)
 {
-    if (!m_iconLoadingClient)
-        return;
-
     m_iconLoadingClient->getLoadDecisionForIcon(icon, [this, protectedThis = RefPtr<WebPageProxy>(this), loadIdentifier](std::function<void (API::Data*, CallbackBase::Error)> callbackFunction) {
         if (!isValid()) {
             if (callbackFunction)
index e535bac..6a45774 100644 (file)
@@ -334,7 +334,7 @@ public:
     WebFullScreenManagerProxy* fullScreenManager();
 
     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
-    void setFullscreenClient(std::unique_ptr<API::FullscreenClient>);
+    void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
 #endif
 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     WebPlaybackSessionManagerProxy* playbackSessionManager();
@@ -348,27 +348,27 @@ public:
 
 #if ENABLE(CONTEXT_MENUS)
     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
-    void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>);
+    void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
 #endif
     API::FindClient& findClient() { return *m_findClient; }
-    void setFindClient(std::unique_ptr<API::FindClient>);
+    void setFindClient(std::unique_ptr<API::FindClient>&&);
     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
-    void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>);
+    void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
     API::DiagnosticLoggingClient& diagnosticLoggingClient() { return *m_diagnosticLoggingClient; }
-    void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>);
-    void setFormClient(std::unique_ptr<API::FormClient>);
-    void setNavigationClient(std::unique_ptr<API::NavigationClient>);
-    void setHistoryClient(std::unique_ptr<API::HistoryClient>);
-    void setLoaderClient(std::unique_ptr<API::LoaderClient>);
-    void setPolicyClient(std::unique_ptr<API::PolicyClient>);
+    void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
+    void setFormClient(std::unique_ptr<API::FormClient>&&);
+    void setNavigationClient(std::unique_ptr<API::NavigationClient>&&);
+    void setHistoryClient(std::unique_ptr<API::HistoryClient>&&);
+    void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
+    void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
 
     API::UIClient& uiClient() { return *m_uiClient; }
-    void setUIClient(std::unique_ptr<API::UIClient>);
+    void setUIClient(std::unique_ptr<API::UIClient>&&);
 
     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
-    void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>);
+    void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
 
     void initializeWebPage();
 
index afc4768..83cd559 100644 (file)
@@ -340,7 +340,7 @@ void WebProcessPool::initializeConnectionClient(const WKContextConnectionClientB
     m_connectionClient.initialize(client);
 }
 
-void WebProcessPool::setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient> historyClient)
+void WebProcessPool::setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient>&& historyClient)
 {
     if (!historyClient)
         m_historyClient = std::make_unique<API::LegacyContextHistoryClient>();
@@ -348,7 +348,7 @@ void WebProcessPool::setHistoryClient(std::unique_ptr<API::LegacyContextHistoryC
         m_historyClient = WTFMove(historyClient);
 }
 
-void WebProcessPool::setDownloadClient(std::unique_ptr<API::DownloadClient> downloadClient)
+void WebProcessPool::setDownloadClient(std::unique_ptr<API::DownloadClient>&& downloadClient)
 {
     if (!downloadClient)
         m_downloadClient = std::make_unique<API::DownloadClient>();
@@ -356,7 +356,7 @@ void WebProcessPool::setDownloadClient(std::unique_ptr<API::DownloadClient> down
         m_downloadClient = WTFMove(downloadClient);
 }
 
-void WebProcessPool::setAutomationClient(std::unique_ptr<API::AutomationClient> automationClient)
+void WebProcessPool::setAutomationClient(std::unique_ptr<API::AutomationClient>&& automationClient)
 {
     if (!automationClient)
         m_automationClient = std::make_unique<API::AutomationClient>();
index 739b397..cfb67aa 100644 (file)
@@ -142,9 +142,9 @@ public:
     void initializeClient(const WKContextClientBase*);
     void initializeInjectedBundleClient(const WKContextInjectedBundleClientBase*);
     void initializeConnectionClient(const WKContextConnectionClientBase*);
-    void setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient>);
-    void setDownloadClient(std::unique_ptr<API::DownloadClient>);
-    void setAutomationClient(std::unique_ptr<API::AutomationClient>);
+    void setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient>&&);
+    void setDownloadClient(std::unique_ptr<API::DownloadClient>&&);
+    void setAutomationClient(std::unique_ptr<API::AutomationClient>&&);
     void setLegacyCustomProtocolManagerClient(std::unique_ptr<API::CustomProtocolManagerClient>&&);
 
     void setMaximumNumberOfProcesses(unsigned); // Can only be called when there are no processes running.
index 56b9fd9..7b3b2d1 100644 (file)
@@ -695,7 +695,7 @@ uint64_t WebPage::messageSenderDestinationID()
 }
 
 #if ENABLE(CONTEXT_MENUS)
-void WebPage::setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient> contextMenuClient)
+void WebPage::setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&& contextMenuClient)
 {
     if (!contextMenuClient) {
         m_contextMenuClient = std::make_unique<API::InjectedBundle::PageContextMenuClient>();
@@ -706,7 +706,7 @@ void WebPage::setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBu
 }
 #endif
 
-void WebPage::setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient> editorClient)
+void WebPage::setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&& editorClient)
 {
     if (!editorClient) {
         m_editorClient = std::make_unique<API::InjectedBundle::EditorClient>();
@@ -716,7 +716,7 @@ void WebPage::setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle:
     m_editorClient = WTFMove(editorClient);
 }
 
-void WebPage::setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient> formClient)
+void WebPage::setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&& formClient)
 {
     if (!formClient) {
         m_formClient = std::make_unique<API::InjectedBundle::FormClient>();
@@ -726,7 +726,7 @@ void WebPage::setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::F
     m_formClient = WTFMove(formClient);
 }
 
-void WebPage::setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient> loaderClient)
+void WebPage::setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&& loaderClient)
 {
     if (!loaderClient) {
         m_loaderClient = std::make_unique<API::InjectedBundle::PageLoaderClient>();
@@ -752,7 +752,7 @@ void WebPage::initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoa
     m_resourceLoadClient.initialize(client);
 }
 
-void WebPage::setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient> uiClient)
+void WebPage::setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&& uiClient)
 {
     if (!uiClient) {
         m_uiClient = std::make_unique<API::InjectedBundle::PageUIClient>();
index 5bfdcf6..c104ff2 100644 (file)
@@ -326,14 +326,14 @@ public:
 
     // -- InjectedBundle methods
 #if ENABLE(CONTEXT_MENUS)
-    void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>);
+    void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&&);
 #endif
-    void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>);
-    void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>);
-    void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>);
+    void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&&);
+    void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
+    void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
     void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
-    void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>);
+    void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
 #if ENABLE(FULLSCREEN_API)
     void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
 #endif