Drop uses of PassRefPtr in WebKit/win
https://bugs.webkit.org/show_bug.cgi?id=172067
Reviewed by Yusuke Suzuki.
* DOMEventsClasses.cpp:
(DOMEvent::DOMEvent):
(DOMEvent::createInstance):
* DOMEventsClasses.h:
(DOMUIEvent::DOMUIEvent):
(DOMKeyboardEvent::DOMKeyboardEvent):
(DOMMouseEvent::DOMMouseEvent):
(DOMMutationEvent::DOMMutationEvent):
(DOMOverflowEvent::DOMOverflowEvent):
(DOMWheelEvent::DOMWheelEvent):
* MemoryStream.cpp:
(MemoryStream::MemoryStream):
(MemoryStream::createInstance):
* MemoryStream.h:
* Plugins/PluginDatabase.cpp:
(WebCore::PluginDatabase::refresh):
(WebCore::PluginDatabase::add):
(WebCore::PluginDatabase::loadPersistentMetadataCache):
* Plugins/PluginDatabase.h:
* Plugins/PluginPackage.cpp:
(WebCore::PluginPackage::createPackage):
(WebCore::PluginPackage::createPackageFromCache):
* Plugins/PluginPackage.h:
* Plugins/PluginStream.h:
(WebCore::PluginStream::create):
* WebActionPropertyBag.cpp:
(WebActionPropertyBag::WebActionPropertyBag):
(WebActionPropertyBag::createInstance):
* WebActionPropertyBag.h:
* WebArchive.cpp:
(WebArchive::createInstance):
(WebArchive::WebArchive):
* WebArchive.h:
* WebBackForwardList.cpp:
(WebBackForwardList::WebBackForwardList):
(WebBackForwardList::createInstance):
* WebBackForwardList.h:
* WebCoreSupport/EmbeddedWidget.cpp:
(EmbeddedWidget::create):
* WebCoreSupport/EmbeddedWidget.h:
* WebCoreSupport/WebChromeClient.h:
* WebFrame.cpp:
(WebFrame::loadData):
(WebFrame::createSubframeWithOwnerElement):
* WebFrame.h:
* WebFramePolicyListener.cpp:
(WebFramePolicyListener::WebFramePolicyListener):
(WebFramePolicyListener::createInstance):
* WebFramePolicyListener.h:
* WebGeolocationPolicyListener.cpp:
(WebGeolocationPolicyListener::createInstance):
(WebGeolocationPolicyListener::WebGeolocationPolicyListener):
* WebGeolocationPolicyListener.h:
* WebHistoryItem.cpp:
(WebHistoryItem::WebHistoryItem):
(WebHistoryItem::createInstance):
* WebHistoryItem.h:
* WebMutableURLRequest.cpp:
(WebMutableURLRequest::setFormData):
(WebMutableURLRequest::formData):
* WebMutableURLRequest.h:
* WebResource.cpp:
(WebResource::createInstance):
* WebResource.h:
* WebScriptWorld.cpp:
(WebScriptWorld::WebScriptWorld):
(WebScriptWorld::createInstance):
* WebScriptWorld.h:
* WebURLAuthenticationChallengeSender.cpp:
(WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender):
(WebURLAuthenticationChallengeSender::createInstance):
* WebURLAuthenticationChallengeSender.h:
* WebView.cpp:
(WebView::setFullScreenElement):
* WebView.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@216823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index 6f0dc50..388fdd1 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,86 @@
+2017-05-13 Chris Dumez <cdumez@apple.com>
+
+ Drop uses of PassRefPtr in WebKit/win
+ https://bugs.webkit.org/show_bug.cgi?id=172067
+
+ Reviewed by Yusuke Suzuki.
+
+ * DOMEventsClasses.cpp:
+ (DOMEvent::DOMEvent):
+ (DOMEvent::createInstance):
+ * DOMEventsClasses.h:
+ (DOMUIEvent::DOMUIEvent):
+ (DOMKeyboardEvent::DOMKeyboardEvent):
+ (DOMMouseEvent::DOMMouseEvent):
+ (DOMMutationEvent::DOMMutationEvent):
+ (DOMOverflowEvent::DOMOverflowEvent):
+ (DOMWheelEvent::DOMWheelEvent):
+ * MemoryStream.cpp:
+ (MemoryStream::MemoryStream):
+ (MemoryStream::createInstance):
+ * MemoryStream.h:
+ * Plugins/PluginDatabase.cpp:
+ (WebCore::PluginDatabase::refresh):
+ (WebCore::PluginDatabase::add):
+ (WebCore::PluginDatabase::loadPersistentMetadataCache):
+ * Plugins/PluginDatabase.h:
+ * Plugins/PluginPackage.cpp:
+ (WebCore::PluginPackage::createPackage):
+ (WebCore::PluginPackage::createPackageFromCache):
+ * Plugins/PluginPackage.h:
+ * Plugins/PluginStream.h:
+ (WebCore::PluginStream::create):
+ * WebActionPropertyBag.cpp:
+ (WebActionPropertyBag::WebActionPropertyBag):
+ (WebActionPropertyBag::createInstance):
+ * WebActionPropertyBag.h:
+ * WebArchive.cpp:
+ (WebArchive::createInstance):
+ (WebArchive::WebArchive):
+ * WebArchive.h:
+ * WebBackForwardList.cpp:
+ (WebBackForwardList::WebBackForwardList):
+ (WebBackForwardList::createInstance):
+ * WebBackForwardList.h:
+ * WebCoreSupport/EmbeddedWidget.cpp:
+ (EmbeddedWidget::create):
+ * WebCoreSupport/EmbeddedWidget.h:
+ * WebCoreSupport/WebChromeClient.h:
+ * WebFrame.cpp:
+ (WebFrame::loadData):
+ (WebFrame::createSubframeWithOwnerElement):
+ * WebFrame.h:
+ * WebFramePolicyListener.cpp:
+ (WebFramePolicyListener::WebFramePolicyListener):
+ (WebFramePolicyListener::createInstance):
+ * WebFramePolicyListener.h:
+ * WebGeolocationPolicyListener.cpp:
+ (WebGeolocationPolicyListener::createInstance):
+ (WebGeolocationPolicyListener::WebGeolocationPolicyListener):
+ * WebGeolocationPolicyListener.h:
+ * WebHistoryItem.cpp:
+ (WebHistoryItem::WebHistoryItem):
+ (WebHistoryItem::createInstance):
+ * WebHistoryItem.h:
+ * WebMutableURLRequest.cpp:
+ (WebMutableURLRequest::setFormData):
+ (WebMutableURLRequest::formData):
+ * WebMutableURLRequest.h:
+ * WebResource.cpp:
+ (WebResource::createInstance):
+ * WebResource.h:
+ * WebScriptWorld.cpp:
+ (WebScriptWorld::WebScriptWorld):
+ (WebScriptWorld::createInstance):
+ * WebScriptWorld.h:
+ * WebURLAuthenticationChallengeSender.cpp:
+ (WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender):
+ (WebURLAuthenticationChallengeSender::createInstance):
+ * WebURLAuthenticationChallengeSender.h:
+ * WebView.cpp:
+ (WebView::setFullScreenElement):
+ * WebView.h:
+
2017-05-11 Chris Dumez <cdumez@apple.com>
Drop remaining uses of PassRefPtr in WebCore
diff --git a/Source/WebKit/win/DOMEventsClasses.cpp b/Source/WebKit/win/DOMEventsClasses.cpp
index ad8766b..052d85c 100644
--- a/Source/WebKit/win/DOMEventsClasses.cpp
+++ b/Source/WebKit/win/DOMEventsClasses.cpp
@@ -77,7 +77,7 @@
void WebEventListener::handleEvent(WebCore::ScriptExecutionContext* s, WebCore::Event* e)
{
RefPtr<WebCore::Event> ePtr(e);
- COMPtr<IDOMEvent> domEvent = DOMEvent::createInstance(ePtr);
+ COMPtr<IDOMEvent> domEvent = DOMEvent::createInstance(WTFMove(ePtr));
m_iDOMEventListener->handleEvent(domEvent.get());
}
@@ -88,16 +88,16 @@
// DOMEvent -------------------------------------------------------------------
-DOMEvent::DOMEvent(PassRefPtr<WebCore::Event> e)
+DOMEvent::DOMEvent(RefPtr<WebCore::Event>&& e)
{
- m_event = e;
+ m_event = WTFMove(e);
}
DOMEvent::~DOMEvent()
{
}
-IDOMEvent* DOMEvent::createInstance(PassRefPtr<WebCore::Event> e)
+IDOMEvent* DOMEvent::createInstance(RefPtr<WebCore::Event>&& e)
{
if (!e)
return nullptr;
@@ -107,36 +107,36 @@
switch (e->eventInterface()) {
case WebCore::KeyboardEventInterfaceType: {
- DOMKeyboardEvent* newEvent = new DOMKeyboardEvent(e);
+ DOMKeyboardEvent* newEvent = new DOMKeyboardEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMKeyboardEvent, (void**)&domEvent);
break;
}
case WebCore::MouseEventInterfaceType: {
- DOMMouseEvent* newEvent = new DOMMouseEvent(e);
+ DOMMouseEvent* newEvent = new DOMMouseEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMMouseEvent, (void**)&domEvent);
break;
}
case WebCore::MutationEventInterfaceType: {
- DOMMutationEvent* newEvent = new DOMMutationEvent(e);
+ DOMMutationEvent* newEvent = new DOMMutationEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMMutationEvent, (void**)&domEvent);
break;
}
case WebCore::OverflowEventInterfaceType: {
- DOMOverflowEvent* newEvent = new DOMOverflowEvent(e);
+ DOMOverflowEvent* newEvent = new DOMOverflowEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMOverflowEvent, (void**)&domEvent);
break;
}
case WebCore::WheelEventInterfaceType: {
- DOMWheelEvent* newEvent = new DOMWheelEvent(e);
+ DOMWheelEvent* newEvent = new DOMWheelEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMWheelEvent, (void**)&domEvent);
break;
}
default:
if (e->isUIEvent()) {
- DOMUIEvent* newEvent = new DOMUIEvent(e);
+ DOMUIEvent* newEvent = new DOMUIEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMUIEvent, (void**)&domEvent);
} else {
- DOMEvent* newEvent = new DOMEvent(e);
+ DOMEvent* newEvent = new DOMEvent(WTFMove(e));
hr = newEvent->QueryInterface(IID_IDOMEvent, (void**)&domEvent);
}
}
diff --git a/Source/WebKit/win/DOMEventsClasses.h b/Source/WebKit/win/DOMEventsClasses.h
index 7df813b..3b53b5e 100644
--- a/Source/WebKit/win/DOMEventsClasses.h
+++ b/Source/WebKit/win/DOMEventsClasses.h
@@ -30,7 +30,6 @@
#include "DOMCoreClasses.h"
#include <WebCore/EventListener.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
// {AC3D1BC3-4976-4431-8A19-4812C5EFE39C}
@@ -109,9 +108,9 @@
class DOMEvent : public DOMObject, public IDOMEvent
{
public:
- static IDOMEvent* createInstance(PassRefPtr<WebCore::Event> e);
+ static IDOMEvent* createInstance(RefPtr<WebCore::Event>&&);
protected:
- DOMEvent(PassRefPtr<WebCore::Event> e);
+ DOMEvent(RefPtr<WebCore::Event>&&);
~DOMEvent();
public:
@@ -183,7 +182,9 @@
class DOMUIEvent : public DOMEvent, public IDOMUIEvent
{
public:
- DOMUIEvent(PassRefPtr<WebCore::Event> e) : DOMEvent(e) {}
+ DOMUIEvent(RefPtr<WebCore::Event>&& e)
+ : DOMEvent(WTFMove(e))
+ { }
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
@@ -298,7 +299,9 @@
class DOMKeyboardEvent : public DOMUIEvent, public IDOMKeyboardEvent
{
public:
- DOMKeyboardEvent(PassRefPtr<WebCore::Event> e) : DOMUIEvent(e) { }
+ DOMKeyboardEvent(RefPtr<WebCore::Event>&& e)
+ : DOMUIEvent(WTFMove(e))
+ { }
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
@@ -464,7 +467,9 @@
class DOMMouseEvent : public DOMUIEvent, public IDOMMouseEvent
{
public:
- DOMMouseEvent(PassRefPtr<WebCore::Event> e) : DOMUIEvent(e) { }
+ DOMMouseEvent(RefPtr<WebCore::Event>&& e)
+ : DOMUIEvent(WTFMove(e))
+ { }
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
@@ -639,7 +644,9 @@
class DOMMutationEvent : public DOMEvent, public IDOMMutationEvent
{
public:
- DOMMutationEvent(PassRefPtr<WebCore::Event> e) : DOMEvent(e) { }
+ DOMMutationEvent(RefPtr<WebCore::Event>&& e)
+ : DOMEvent(WTFMove(e))
+ { }
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
@@ -752,7 +759,9 @@
class DOMOverflowEvent : public DOMEvent, public IDOMOverflowEvent
{
public:
- DOMOverflowEvent(PassRefPtr<WebCore::Event> e) : DOMEvent(e) { }
+ DOMOverflowEvent(RefPtr<WebCore::Event>&& e)
+ : DOMEvent(WTFMove(e))
+ { }
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
@@ -860,7 +869,9 @@
class DOMWheelEvent : public DOMUIEvent, public IDOMWheelEvent
{
public:
- DOMWheelEvent(PassRefPtr<WebCore::Event> e) : DOMUIEvent(e) { }
+ DOMWheelEvent(RefPtr<WebCore::Event>&& e)
+ : DOMUIEvent(WTFMove(e))
+ { }
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
diff --git a/Source/WebKit/win/MemoryStream.cpp b/Source/WebKit/win/MemoryStream.cpp
index 2c2051d..360aedc 100644
--- a/Source/WebKit/win/MemoryStream.cpp
+++ b/Source/WebKit/win/MemoryStream.cpp
@@ -31,8 +31,8 @@
// MemoryStream ---------------------------------------------------------------
-MemoryStream::MemoryStream(PassRefPtr<SharedBuffer> buffer)
- : m_buffer(buffer)
+MemoryStream::MemoryStream(RefPtr<SharedBuffer>&& buffer)
+ : m_buffer(WTFMove(buffer))
{
gClassCount++;
gClassNameCount().add("MemoryStream");
@@ -44,9 +44,9 @@
gClassNameCount().remove("MemoryStream");
}
-COMPtr<MemoryStream> MemoryStream::createInstance(PassRefPtr<SharedBuffer> buffer)
+COMPtr<MemoryStream> MemoryStream::createInstance(RefPtr<SharedBuffer>&& buffer)
{
- return new MemoryStream(buffer);
+ return new MemoryStream(WTFMove(buffer));
}
// IUnknown -------------------------------------------------------------------
@@ -228,7 +228,7 @@
HRESULT MemoryStream::Clone(_COM_Outptr_ IStream** ppstm)
{
- MemoryStream::createInstance(m_buffer).copyRefTo(ppstm);
+ MemoryStream::createInstance(m_buffer.copyRef()).copyRefTo(ppstm);
// FIXME: MSDN says we should be returning STG_E_INSUFFICIENT_MEMORY instead of E_OUTOFMEMORY here.
return (*ppstm) ? S_OK : E_OUTOFMEMORY;
}
diff --git a/Source/WebKit/win/MemoryStream.h b/Source/WebKit/win/MemoryStream.h
index f559c58..97f1c97 100644
--- a/Source/WebKit/win/MemoryStream.h
+++ b/Source/WebKit/win/MemoryStream.h
@@ -30,16 +30,15 @@
#include <WebCore/COMPtr.h>
#include <WebCore/SharedBuffer.h>
-#include <WTF/PassRefPtr.h>
#include <WTF/RefPtr.h>
class MemoryStream : public IStream
{
public:
- static COMPtr<MemoryStream> createInstance(PassRefPtr<WebCore::SharedBuffer> buffer);
+ static COMPtr<MemoryStream> createInstance(RefPtr<WebCore::SharedBuffer>&&);
protected:
- MemoryStream(PassRefPtr<WebCore::SharedBuffer> buffer);
+ MemoryStream(RefPtr<WebCore::SharedBuffer>&&);
~MemoryStream();
public:
diff --git a/Source/WebKit/win/Plugins/PluginDatabase.cpp b/Source/WebKit/win/Plugins/PluginDatabase.cpp
index 169b197..0bf8b59 100644
--- a/Source/WebKit/win/Plugins/PluginDatabase.cpp
+++ b/Source/WebKit/win/Plugins/PluginDatabase.cpp
@@ -139,7 +139,7 @@
}
RefPtr<PluginPackage> package = PluginPackage::createPackage(*it, lastModified);
- if (package && add(package.release()))
+ if (package && add(package.releaseNonNull()))
pluginSetChanged = true;
}
@@ -325,16 +325,12 @@
}
}
-bool PluginDatabase::add(PassRefPtr<PluginPackage> prpPackage)
+bool PluginDatabase::add(Ref<PluginPackage>&& package)
{
- ASSERT_ARG(prpPackage, prpPackage);
-
- RefPtr<PluginPackage> package = prpPackage;
-
- if (!m_plugins.add(package).isNewEntry)
+ if (!m_plugins.add(package.copyRef()).isNewEntry)
return false;
- m_pluginsByPath.add(package->path(), package);
+ m_pluginsByPath.add(package->path(), package.copyRef());
return true;
}
@@ -529,9 +525,9 @@
if (m_pluginDirectories.find(pluginDirectoryName) == WTF::notFound)
continue;
- RefPtr<PluginPackage> package = PluginPackage::createPackageFromCache(path, lastModified, name, desc, mimeDesc);
+ auto package = PluginPackage::createPackageFromCache(path, lastModified, name, desc, mimeDesc);
- if (package && cachedPlugins.add(package).isNewEntry) {
+ if (cachedPlugins.add(package.copyRef()).isNewEntry) {
cachedPluginPathsWithTimes.add(package->path(), package->lastModified());
cachedPluginsByPath.add(package->path(), package);
}
diff --git a/Source/WebKit/win/Plugins/PluginDatabase.h b/Source/WebKit/win/Plugins/PluginDatabase.h
index eb6a841..013708e 100644
--- a/Source/WebKit/win/Plugins/PluginDatabase.h
+++ b/Source/WebKit/win/Plugins/PluginDatabase.h
@@ -94,7 +94,7 @@
bool fileExistsAndIsNotDisabled(const String&) const;
// Returns whether the plugin was actually added or not (it won't be added if it's a duplicate of an existing plugin).
- bool add(PassRefPtr<PluginPackage>);
+ bool add(Ref<PluginPackage>&&);
void remove(PluginPackage*);
#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
void loadPersistentMetadataCache();
diff --git a/Source/WebKit/win/Plugins/PluginPackage.cpp b/Source/WebKit/win/Plugins/PluginPackage.cpp
index 50f1b33..b848546 100644
--- a/Source/WebKit/win/Plugins/PluginPackage.cpp
+++ b/Source/WebKit/win/Plugins/PluginPackage.cpp
@@ -163,26 +163,26 @@
m_isEnabled = enabled;
}
-PassRefPtr<PluginPackage> PluginPackage::createPackage(const String& path, const time_t& lastModified)
+RefPtr<PluginPackage> PluginPackage::createPackage(const String& path, const time_t& lastModified)
{
RefPtr<PluginPackage> package = adoptRef(new PluginPackage(path, lastModified));
if (!package->fetchInfo())
- return 0;
+ return nullptr;
- return package.release();
+ return package;
}
#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-PassRefPtr<PluginPackage> PluginPackage::createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription)
+Ref<PluginPackage> PluginPackage::createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription)
{
- RefPtr<PluginPackage> package = adoptRef(new PluginPackage(path, lastModified));
+ Ref<PluginPackage> package = adoptRef(*new PluginPackage(path, lastModified));
package->m_name = name;
package->m_description = description;
package->determineModuleVersionFromDescription();
package->setMIMEDescription(mimeDescription);
package->m_infoIsFromCache = true;
- return package.release();
+ return package;
}
#endif
diff --git a/Source/WebKit/win/Plugins/PluginPackage.h b/Source/WebKit/win/Plugins/PluginPackage.h
index d76eafd..f127725 100644
--- a/Source/WebKit/win/Plugins/PluginPackage.h
+++ b/Source/WebKit/win/Plugins/PluginPackage.h
@@ -46,9 +46,9 @@
class PluginPackage : public RefCounted<PluginPackage> {
public:
~PluginPackage();
- static PassRefPtr<PluginPackage> createPackage(const String& path, const time_t& lastModified);
+ static RefPtr<PluginPackage> createPackage(const String& path, const time_t& lastModified);
#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
- static PassRefPtr<PluginPackage> createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription);
+ static Ref<PluginPackage> createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription);
#endif
const String& name() const { return m_name; }
diff --git a/Source/WebKit/win/Plugins/PluginStream.h b/Source/WebKit/win/Plugins/PluginStream.h
index 42c6ddf..600e1f2 100644
--- a/Source/WebKit/win/Plugins/PluginStream.h
+++ b/Source/WebKit/win/Plugins/PluginStream.h
@@ -56,9 +56,9 @@
class PluginStream : public RefCounted<PluginStream>, private NetscapePlugInStreamLoaderClient {
public:
- static PassRefPtr<PluginStream> create(PluginStreamClient* client, Frame* frame, const ResourceRequest& request, bool sendNotification, void* notifyData, const NPPluginFuncs* functions, NPP instance, const PluginQuirkSet& quirks)
+ static Ref<PluginStream> create(PluginStreamClient* client, Frame* frame, const ResourceRequest& request, bool sendNotification, void* notifyData, const NPPluginFuncs* functions, NPP instance, const PluginQuirkSet& quirks)
{
- return adoptRef(new PluginStream(client, frame, request, sendNotification, notifyData, functions, instance, quirks));
+ return adoptRef(*new PluginStream(client, frame, request, sendNotification, notifyData, functions, instance, quirks));
}
virtual ~PluginStream();
diff --git a/Source/WebKit/win/WebActionPropertyBag.cpp b/Source/WebKit/win/WebActionPropertyBag.cpp
index e347026..721d1cd 100644
--- a/Source/WebKit/win/WebActionPropertyBag.cpp
+++ b/Source/WebKit/win/WebActionPropertyBag.cpp
@@ -39,10 +39,10 @@
// WebActionPropertyBag ------------------------------------------------
-WebActionPropertyBag::WebActionPropertyBag(const NavigationAction& action, PassRefPtr<HTMLFormElement> form, PassRefPtr<Frame> frame)
+WebActionPropertyBag::WebActionPropertyBag(const NavigationAction& action, RefPtr<HTMLFormElement>&& form, RefPtr<Frame>&& frame)
: m_action(action)
- , m_form(form)
- , m_frame(frame)
+ , m_form(WTFMove(form))
+ , m_frame(WTFMove(frame))
{
gClassCount++;
gClassNameCount().add("WebActionPropertyBag");
@@ -54,9 +54,9 @@
gClassNameCount().remove("WebActionPropertyBag");
}
-WebActionPropertyBag* WebActionPropertyBag::createInstance(const NavigationAction& action, PassRefPtr<HTMLFormElement> form, PassRefPtr<Frame> frame)
+WebActionPropertyBag* WebActionPropertyBag::createInstance(const NavigationAction& action, RefPtr<HTMLFormElement>&& form, RefPtr<Frame>&& frame)
{
- WebActionPropertyBag* instance = new WebActionPropertyBag(action, form, frame);
+ WebActionPropertyBag* instance = new WebActionPropertyBag(action, WTFMove(form), WTFMove(frame));
instance->AddRef();
return instance;
}
diff --git a/Source/WebKit/win/WebActionPropertyBag.h b/Source/WebKit/win/WebActionPropertyBag.h
index 3757151..0f9f015 100644
--- a/Source/WebKit/win/WebActionPropertyBag.h
+++ b/Source/WebKit/win/WebActionPropertyBag.h
@@ -33,10 +33,10 @@
class WebActionPropertyBag : public IPropertyBag {
public:
- static WebActionPropertyBag* createInstance(const WebCore::NavigationAction&, PassRefPtr<WebCore::HTMLFormElement>, PassRefPtr<WebCore::Frame>);
+ static WebActionPropertyBag* createInstance(const WebCore::NavigationAction&, RefPtr<WebCore::HTMLFormElement>&&, RefPtr<WebCore::Frame>&&);
private:
- WebActionPropertyBag(const WebCore::NavigationAction&, PassRefPtr<WebCore::HTMLFormElement>, PassRefPtr<WebCore::Frame>);
+ WebActionPropertyBag(const WebCore::NavigationAction&, RefPtr<WebCore::HTMLFormElement>&&, RefPtr<WebCore::Frame>&&);
~WebActionPropertyBag();
public:
diff --git a/Source/WebKit/win/WebArchive.cpp b/Source/WebKit/win/WebArchive.cpp
index ad0c986..1863748 100644
--- a/Source/WebKit/win/WebArchive.cpp
+++ b/Source/WebKit/win/WebArchive.cpp
@@ -41,16 +41,16 @@
return instance;
}
-WebArchive* WebArchive::createInstance(PassRefPtr<LegacyWebArchive> coreArchive)
+WebArchive* WebArchive::createInstance(RefPtr<LegacyWebArchive>&& coreArchive)
{
- WebArchive* instance = new WebArchive(coreArchive);
+ WebArchive* instance = new WebArchive(WTFMove(coreArchive));
instance->AddRef();
return instance;
}
-WebArchive::WebArchive(PassRefPtr<LegacyWebArchive> coreArchive)
- : m_archive(coreArchive)
+WebArchive::WebArchive(RefPtr<LegacyWebArchive>&& coreArchive)
+ : m_archive(WTFMove(coreArchive))
{
gClassCount++;
gClassNameCount().add("WebArchive");
@@ -152,7 +152,7 @@
if (!cfData)
return E_FAIL;
- RefPtr<SharedBuffer> buffer = SharedBuffer::create(CFDataGetBytePtr(cfData.get()), CFDataGetLength(cfData.get()));
+ auto buffer = SharedBuffer::create(CFDataGetBytePtr(cfData.get()), CFDataGetLength(cfData.get()));
- return MemoryStream::createInstance(buffer).copyRefTo(stream);
+ return MemoryStream::createInstance(WTFMove(buffer)).copyRefTo(stream);
}
diff --git a/Source/WebKit/win/WebArchive.h b/Source/WebKit/win/WebArchive.h
index 5ce60d8..e1acaff 100644
--- a/Source/WebKit/win/WebArchive.h
+++ b/Source/WebKit/win/WebArchive.h
@@ -28,7 +28,6 @@
#include "WebKit.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -39,9 +38,9 @@
{
public:
static WebArchive* createInstance();
- static WebArchive* createInstance(PassRefPtr<WebCore::LegacyWebArchive>);
+ static WebArchive* createInstance(RefPtr<WebCore::LegacyWebArchive>&&);
protected:
- WebArchive(PassRefPtr<WebCore::LegacyWebArchive>);
+ WebArchive(RefPtr<WebCore::LegacyWebArchive>&&);
~WebArchive();
public:
diff --git a/Source/WebKit/win/WebBackForwardList.cpp b/Source/WebKit/win/WebBackForwardList.cpp
index 4ea200d..5aa73d5 100644
--- a/Source/WebKit/win/WebBackForwardList.cpp
+++ b/Source/WebKit/win/WebBackForwardList.cpp
@@ -47,8 +47,8 @@
return staticBackForwardListWrappers;
}
-WebBackForwardList::WebBackForwardList(PassRefPtr<BackForwardList> backForwardList)
- : m_backForwardList(backForwardList)
+WebBackForwardList::WebBackForwardList(RefPtr<BackForwardList>&& backForwardList)
+ : m_backForwardList(WTFMove(backForwardList))
{
ASSERT(!backForwardListWrappers().contains(m_backForwardList.get()));
backForwardListWrappers().set(m_backForwardList.get(), this);
@@ -68,12 +68,12 @@
gClassNameCount().remove("WebBackForwardList");
}
-WebBackForwardList* WebBackForwardList::createInstance(PassRefPtr<BackForwardList> backForwardList)
+WebBackForwardList* WebBackForwardList::createInstance(RefPtr<BackForwardList>&& backForwardList)
{
WebBackForwardList* instance = backForwardListWrappers().get(backForwardList.get());
if (!instance)
- instance = new WebBackForwardList(backForwardList);
+ instance = new WebBackForwardList(WTFMove(backForwardList));
instance->AddRef();
return instance;
diff --git a/Source/WebKit/win/WebBackForwardList.h b/Source/WebKit/win/WebBackForwardList.h
index 9de68b3..bfa2516 100644
--- a/Source/WebKit/win/WebBackForwardList.h
+++ b/Source/WebKit/win/WebBackForwardList.h
@@ -29,7 +29,6 @@
#include "WebHistoryItem.h"
-#include <WTF/PassRefPtr.h>
#include <WTF/RefPtr.h>
class BackForwardList;
@@ -37,9 +36,9 @@
class WebBackForwardList : public IWebBackForwardList, IWebBackForwardListPrivate
{
public:
- static WebBackForwardList* createInstance(PassRefPtr<BackForwardList>);
+ static WebBackForwardList* createInstance(RefPtr<BackForwardList>&&);
protected:
- WebBackForwardList(PassRefPtr<BackForwardList>);
+ WebBackForwardList(RefPtr<BackForwardList>&&);
~WebBackForwardList();
public:
diff --git a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index 14723fd..5a6f112 100644
--- a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -37,12 +37,12 @@
using namespace WebCore;
-PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, HTMLPlugInElement* element, HWND parentWindow, const IntSize& size)
+Ref<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, HTMLPlugInElement* element, HWND parentWindow, const IntSize& size)
{
- RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));
+ auto widget = adoptRef(*new EmbeddedWidget(view, element));
widget->createWindow(parentWindow, size);
- return widget.release();
+ return widget;
}
EmbeddedWidget::~EmbeddedWidget()
diff --git a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h
index f647b3e..2527982 100644
--- a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h
+++ b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h
@@ -40,7 +40,7 @@
class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
public:
- static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::HTMLPlugInElement*, HWND parentWindow, const WebCore::IntSize&);
+ static Ref<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::HTMLPlugInElement*, HWND parentWindow, const WebCore::IntSize&);
~EmbeddedWidget();
private:
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
index 809b8a7..866787c 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -30,7 +30,7 @@
#include <WebCore/FocusDirection.h>
#include <WebCore/ScrollTypes.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
class WebView;
class WebDesktopNotificationsDelegate;
diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp
index ba14351..bc90c94 100644
--- a/Source/WebKit/win/WebFrame.cpp
+++ b/Source/WebKit/win/WebFrame.cpp
@@ -565,7 +565,7 @@
return S_OK;
}
-void WebFrame::loadData(PassRefPtr<WebCore::SharedBuffer> data, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL)
+void WebFrame::loadData(RefPtr<WebCore::SharedBuffer>&& data, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL)
{
String mimeTypeString(mimeType, SysStringLen(mimeType));
if (!mimeType)
@@ -582,7 +582,7 @@
ResourceRequest request(baseCoreURL);
ResourceResponse response(URL(), mimeTypeString, data->size(), encodingString);
- SubstituteData substituteData(data, failingCoreURL, response, SubstituteData::SessionHistoryVisibility::Hidden);
+ SubstituteData substituteData(WTFMove(data), failingCoreURL, response, SubstituteData::SessionHistoryVisibility::Hidden);
// This method is only called from IWebFrame methods, so don't ASSERT that the Frame pointer isn't null.
if (Frame* coreFrame = core(this))
@@ -591,7 +591,7 @@
HRESULT WebFrame::loadData(_In_opt_ IStream* data, _In_ BSTR mimeType, _In_ BSTR textEncodingName, _In_ BSTR url)
{
- RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create();
+ auto sharedBuffer = SharedBuffer::create();
STATSTG stat;
if (SUCCEEDED(data->Stat(&stat, STATFLAG_NONAME))) {
@@ -605,7 +605,7 @@
}
}
- loadData(sharedBuffer, mimeType, textEncodingName, url, nullptr);
+ loadData(WTFMove(sharedBuffer), mimeType, textEncodingName, url, nullptr);
return S_OK;
}
@@ -1031,7 +1031,7 @@
// WebFrame ---------------------------------------------------------------
-PassRefPtr<Frame> WebFrame::createSubframeWithOwnerElement(IWebView* webView, Page* page, HTMLFrameOwnerElement* ownerElement)
+Ref<Frame> WebFrame::createSubframeWithOwnerElement(IWebView* webView, Page* page, HTMLFrameOwnerElement* ownerElement)
{
webView->QueryInterface(&d->webView);
d->webView->Release(); // don't hold the extra ref
@@ -1040,9 +1040,9 @@
d->webView->viewWindow(&viewWindow);
this->AddRef(); // We release this ref in frameLoaderDestroyed()
- RefPtr<Frame> frame = Frame::create(page, ownerElement, new WebFrameLoaderClient(this));
- d->frame = frame.get();
- return frame.release();
+ auto frame = Frame::create(page, ownerElement, new WebFrameLoaderClient(this));
+ d->frame = frame.ptr();
+ return frame;
}
void WebFrame::initWithWebView(IWebView* webView, Page* page)
diff --git a/Source/WebKit/win/WebFrame.h b/Source/WebKit/win/WebFrame.h
index a4d9191..dbea698 100644
--- a/Source/WebKit/win/WebFrame.h
+++ b/Source/WebKit/win/WebFrame.h
@@ -170,7 +170,7 @@
virtual void frameLoaderDestroyed();
// WebFrame
- PassRefPtr<WebCore::Frame> createSubframeWithOwnerElement(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
+ Ref<WebCore::Frame> createSubframeWithOwnerElement(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
void initWithWebView(IWebView*, WebCore::Page*);
WebCore::Frame* impl();
void invalidate();
@@ -199,7 +199,7 @@
protected:
void loadHTMLString(_In_ BSTR string, _In_ BSTR baseURL, _In_ BSTR unreachableURL);
- void loadData(PassRefPtr<WebCore::SharedBuffer>, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL);
+ void loadData(RefPtr<WebCore::SharedBuffer>&&, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL);
const Vector<WebCore::IntRect>& computePageRects(HDC printDC);
void setPrinting(bool printing, const WebCore::FloatSize& pageSize, const WebCore::FloatSize& originalPageSize, float maximumShrinkRatio, WebCore::AdjustViewSizeOrNot);
void headerAndFooterHeights(float*, float*);
diff --git a/Source/WebKit/win/WebFramePolicyListener.cpp b/Source/WebKit/win/WebFramePolicyListener.cpp
index f085b28..2d6f69e 100644
--- a/Source/WebKit/win/WebFramePolicyListener.cpp
+++ b/Source/WebKit/win/WebFramePolicyListener.cpp
@@ -35,8 +35,8 @@
// WebFramePolicyListener ----------------------------------------------------------------
-WebFramePolicyListener::WebFramePolicyListener(PassRefPtr<Frame> frame)
- : m_frame(frame)
+WebFramePolicyListener::WebFramePolicyListener(RefPtr<Frame>&& frame)
+ : m_frame(WTFMove(frame))
{
gClassCount++;
gClassNameCount().add("WebFramePolicyListener");
@@ -48,9 +48,9 @@
gClassNameCount().remove("WebFramePolicyListener");
}
-WebFramePolicyListener* WebFramePolicyListener::createInstance(PassRefPtr<Frame> frame)
+WebFramePolicyListener* WebFramePolicyListener::createInstance(RefPtr<Frame>&& frame)
{
- WebFramePolicyListener* instance = new WebFramePolicyListener(frame);
+ WebFramePolicyListener* instance = new WebFramePolicyListener(WTFMove(frame));
instance->AddRef();
return instance;
}
diff --git a/Source/WebKit/win/WebFramePolicyListener.h b/Source/WebKit/win/WebFramePolicyListener.h
index d3f67f9..02bc4ca 100644
--- a/Source/WebKit/win/WebFramePolicyListener.h
+++ b/Source/WebKit/win/WebFramePolicyListener.h
@@ -27,7 +27,6 @@
#define WebFramePolicyListener_h
#include "WebKit.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <WebCore/FrameLoaderTypes.h>
@@ -38,9 +37,9 @@
class WebFramePolicyListener : public IWebPolicyDecisionListener, public IWebFormSubmissionListener {
public:
- static WebFramePolicyListener* createInstance(PassRefPtr<WebCore::Frame>);
+ static WebFramePolicyListener* createInstance(RefPtr<WebCore::Frame>&&);
protected:
- WebFramePolicyListener(PassRefPtr<WebCore::Frame>);
+ WebFramePolicyListener(RefPtr<WebCore::Frame>&&);
~WebFramePolicyListener();
public:
diff --git a/Source/WebKit/win/WebGeolocationPolicyListener.cpp b/Source/WebKit/win/WebGeolocationPolicyListener.cpp
index 806edf6..97755a9 100644
--- a/Source/WebKit/win/WebGeolocationPolicyListener.cpp
+++ b/Source/WebKit/win/WebGeolocationPolicyListener.cpp
@@ -32,14 +32,14 @@
// WebGeolocationPolicyListener ----------------------------------------------------------------
-COMPtr<WebGeolocationPolicyListener> WebGeolocationPolicyListener::createInstance(PassRefPtr<Geolocation> geolocation)
+COMPtr<WebGeolocationPolicyListener> WebGeolocationPolicyListener::createInstance(RefPtr<Geolocation>&& geolocation)
{
- return new WebGeolocationPolicyListener(geolocation);
+ return new WebGeolocationPolicyListener(WTFMove(geolocation));
}
-WebGeolocationPolicyListener::WebGeolocationPolicyListener(PassRefPtr<Geolocation> geolocation)
+WebGeolocationPolicyListener::WebGeolocationPolicyListener(RefPtr<Geolocation>&& geolocation)
: m_refCount(0)
- , m_geolocation(geolocation)
+ , m_geolocation(WTFMove(geolocation))
{
gClassCount++;
gClassNameCount().add("WebGeolocationPolicyListener");
diff --git a/Source/WebKit/win/WebGeolocationPolicyListener.h b/Source/WebKit/win/WebGeolocationPolicyListener.h
index fce5b55..07f9afe 100644
--- a/Source/WebKit/win/WebGeolocationPolicyListener.h
+++ b/Source/WebKit/win/WebGeolocationPolicyListener.h
@@ -28,7 +28,6 @@
#include "WebKit.h"
#include <WebCore/COMPtr.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -37,7 +36,7 @@
class WebGeolocationPolicyListener : public IWebGeolocationPolicyListener {
public:
- static COMPtr<WebGeolocationPolicyListener> createInstance(PassRefPtr<WebCore::Geolocation>);
+ static COMPtr<WebGeolocationPolicyListener> createInstance(RefPtr<WebCore::Geolocation>&&);
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
@@ -49,7 +48,7 @@
virtual HRESULT STDMETHODCALLTYPE deny();
private:
- WebGeolocationPolicyListener(PassRefPtr<WebCore::Geolocation>);
+ WebGeolocationPolicyListener(RefPtr<WebCore::Geolocation>&&);
~WebGeolocationPolicyListener();
ULONG m_refCount { 0 };
diff --git a/Source/WebKit/win/WebHistoryItem.cpp b/Source/WebKit/win/WebHistoryItem.cpp
index 3be781e..8437620 100644
--- a/Source/WebKit/win/WebHistoryItem.cpp
+++ b/Source/WebKit/win/WebHistoryItem.cpp
@@ -46,8 +46,8 @@
return staticHistoryItemWrappers;
}
-WebHistoryItem::WebHistoryItem(PassRefPtr<HistoryItem> historyItem)
- : m_historyItem(historyItem)
+WebHistoryItem::WebHistoryItem(RefPtr<HistoryItem>&& historyItem)
+ : m_historyItem(WTFMove(historyItem))
{
ASSERT(!historyItemWrappers().contains(m_historyItem.get()));
historyItemWrappers().set(m_historyItem.get(), this);
@@ -72,14 +72,14 @@
return instance;
}
-WebHistoryItem* WebHistoryItem::createInstance(PassRefPtr<HistoryItem> historyItem)
+WebHistoryItem* WebHistoryItem::createInstance(RefPtr<HistoryItem>&& historyItem)
{
WebHistoryItem* instance;
instance = historyItemWrappers().get(historyItem.get());
if (!instance)
- instance = new WebHistoryItem(historyItem);
+ instance = new WebHistoryItem(WTFMove(historyItem));
instance->AddRef();
return instance;
diff --git a/Source/WebKit/win/WebHistoryItem.h b/Source/WebKit/win/WebHistoryItem.h
index 20df9ac..b386570 100644
--- a/Source/WebKit/win/WebHistoryItem.h
+++ b/Source/WebKit/win/WebHistoryItem.h
@@ -29,7 +29,6 @@
#include "WebKit.h"
#include <CoreFoundation/CoreFoundation.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
@@ -43,9 +42,9 @@
{
public:
static WebHistoryItem* createInstance();
- static WebHistoryItem* createInstance(PassRefPtr<WebCore::HistoryItem>);
+ static WebHistoryItem* createInstance(RefPtr<WebCore::HistoryItem>&&);
protected:
- WebHistoryItem(PassRefPtr<WebCore::HistoryItem>);
+ WebHistoryItem(RefPtr<WebCore::HistoryItem>&&);
~WebHistoryItem();
public:
diff --git a/Source/WebKit/win/WebMutableURLRequest.cpp b/Source/WebKit/win/WebMutableURLRequest.cpp
index d5d62af..3f36f2e 100644
--- a/Source/WebKit/win/WebMutableURLRequest.cpp
+++ b/Source/WebKit/win/WebMutableURLRequest.cpp
@@ -394,12 +394,12 @@
// IWebMutableURLRequest ----------------------------------------------------
-void WebMutableURLRequest::setFormData(const PassRefPtr<FormData> data)
+void WebMutableURLRequest::setFormData(RefPtr<FormData>&& data)
{
- m_request.setHTTPBody(data);
+ m_request.setHTTPBody(WTFMove(data));
}
-const PassRefPtr<FormData> WebMutableURLRequest::formData() const
+const RefPtr<FormData> WebMutableURLRequest::formData() const
{
return m_request.httpBody();
}
diff --git a/Source/WebKit/win/WebMutableURLRequest.h b/Source/WebKit/win/WebMutableURLRequest.h
index 7750adb..041c909 100644
--- a/Source/WebKit/win/WebMutableURLRequest.h
+++ b/Source/WebKit/win/WebMutableURLRequest.h
@@ -99,8 +99,8 @@
virtual /* [local] */ CFURLRequestRef STDMETHODCALLTYPE cfRequest();
// WebMutableURLRequest
- void setFormData(const PassRefPtr<WebCore::FormData> data);
- const PassRefPtr<WebCore::FormData> formData() const;
+ void setFormData(RefPtr<WebCore::FormData>&&);
+ const RefPtr<WebCore::FormData> formData() const;
const WebCore::HTTPHeaderMap& httpHeaderFields() const;
diff --git a/Source/WebKit/win/WebResource.cpp b/Source/WebKit/win/WebResource.cpp
index 9d75f2f..b292dde 100644
--- a/Source/WebKit/win/WebResource.cpp
+++ b/Source/WebKit/win/WebResource.cpp
@@ -51,9 +51,9 @@
gClassNameCount().remove("WebResource");
}
-WebResource* WebResource::createInstance(PassRefPtr<WebCore::SharedBuffer> data, const WebCore::ResourceResponse& response)
+WebResource* WebResource::createInstance(RefPtr<WebCore::SharedBuffer>&& data, const WebCore::ResourceResponse& response)
{
- COMPtr<MemoryStream> memoryStream = MemoryStream::createInstance(data);
+ COMPtr<MemoryStream> memoryStream = MemoryStream::createInstance(WTFMove(data));
WebResource* instance = new WebResource(memoryStream.get(), response.url(), response.mimeType(), response.textEncodingName(), String());
instance->AddRef();
diff --git a/Source/WebKit/win/WebResource.h b/Source/WebKit/win/WebResource.h
index 34f632d..b8c7dcc 100644
--- a/Source/WebKit/win/WebResource.h
+++ b/Source/WebKit/win/WebResource.h
@@ -31,12 +31,12 @@
#include <WebCore/URL.h>
#include <WebCore/ResourceResponse.h>
#include <WebCore/SharedBuffer.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
class WebResource : public IWebResource {
public:
- static WebResource* createInstance(PassRefPtr<WebCore::SharedBuffer> data, const WebCore::ResourceResponse& response);
+ static WebResource* createInstance(RefPtr<WebCore::SharedBuffer>&&, const WebCore::ResourceResponse&);
protected:
WebResource(IStream* data, const WebCore::URL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName);
~WebResource();
diff --git a/Source/WebKit/win/WebScriptWorld.cpp b/Source/WebKit/win/WebScriptWorld.cpp
index 329b26d..d5ab4ae 100644
--- a/Source/WebKit/win/WebScriptWorld.cpp
+++ b/Source/WebKit/win/WebScriptWorld.cpp
@@ -38,8 +38,8 @@
return map;
}
-inline WebScriptWorld::WebScriptWorld(PassRefPtr<DOMWrapperWorld> world)
- : m_world(world)
+inline WebScriptWorld::WebScriptWorld(RefPtr<DOMWrapperWorld>&& world)
+ : m_world(WTFMove(world))
{
ASSERT_ARG(world, m_world);
@@ -70,9 +70,9 @@
return createInstance(ScriptController::createWorld());
}
-COMPtr<WebScriptWorld> WebScriptWorld::createInstance(PassRefPtr<DOMWrapperWorld> world)
+COMPtr<WebScriptWorld> WebScriptWorld::createInstance(RefPtr<DOMWrapperWorld>&& world)
{
- return new WebScriptWorld(world);
+ return new WebScriptWorld(WTFMove(world));
}
COMPtr<WebScriptWorld> WebScriptWorld::findOrCreateWorld(DOMWrapperWorld& world)
diff --git a/Source/WebKit/win/WebScriptWorld.h b/Source/WebKit/win/WebScriptWorld.h
index 6c5f13c..9caba2e 100644
--- a/Source/WebKit/win/WebScriptWorld.h
+++ b/Source/WebKit/win/WebScriptWorld.h
@@ -46,9 +46,9 @@
WebCore::DOMWrapperWorld& world() const { return *m_world; }
private:
- static COMPtr<WebScriptWorld> createInstance(PassRefPtr<WebCore::DOMWrapperWorld>);
+ static COMPtr<WebScriptWorld> createInstance(RefPtr<WebCore::DOMWrapperWorld>&&);
- WebScriptWorld(PassRefPtr<WebCore::DOMWrapperWorld>);
+ WebScriptWorld(RefPtr<WebCore::DOMWrapperWorld>&&);
~WebScriptWorld();
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID, _COM_Outptr_ void** ppvObject);
diff --git a/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp b/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp
index 2bf039e..35a845e 100644
--- a/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp
+++ b/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp
@@ -37,8 +37,8 @@
// WebURLAuthenticationChallengeSender ----------------------------------------------------------------
-WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender(PassRefPtr<AuthenticationClient> client)
- : m_client(client)
+WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender(RefPtr<AuthenticationClient>&& client)
+ : m_client(WTFMove(client))
{
ASSERT(m_client);
gClassCount++;
@@ -51,9 +51,9 @@
gClassNameCount().remove("WebURLAuthenticationChallengeSender");
}
-WebURLAuthenticationChallengeSender* WebURLAuthenticationChallengeSender::createInstance(PassRefPtr<WebCore::AuthenticationClient> client)
+WebURLAuthenticationChallengeSender* WebURLAuthenticationChallengeSender::createInstance(RefPtr<WebCore::AuthenticationClient>&& client)
{
- WebURLAuthenticationChallengeSender* instance = new WebURLAuthenticationChallengeSender(client);
+ WebURLAuthenticationChallengeSender* instance = new WebURLAuthenticationChallengeSender(WTFMove(client));
instance->AddRef();
return instance;
}
diff --git a/Source/WebKit/win/WebURLAuthenticationChallengeSender.h b/Source/WebKit/win/WebURLAuthenticationChallengeSender.h
index 2b8f6a4..db30b65 100644
--- a/Source/WebKit/win/WebURLAuthenticationChallengeSender.h
+++ b/Source/WebKit/win/WebURLAuthenticationChallengeSender.h
@@ -39,9 +39,9 @@
: public IWebURLAuthenticationChallengeSender
{
public:
- static WebURLAuthenticationChallengeSender* createInstance(PassRefPtr<WebCore::AuthenticationClient>);
+ static WebURLAuthenticationChallengeSender* createInstance(RefPtr<WebCore::AuthenticationClient>&&);
private:
- WebURLAuthenticationChallengeSender(PassRefPtr<WebCore::AuthenticationClient>);
+ WebURLAuthenticationChallengeSender(RefPtr<WebCore::AuthenticationClient>&&);
~WebURLAuthenticationChallengeSender();
public:
// IUnknown
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp
index aa39d57..00120f8 100644
--- a/Source/WebKit/win/WebView.cpp
+++ b/Source/WebKit/win/WebView.cpp
@@ -6734,7 +6734,7 @@
return S_OK;
}
- *item = WebHistoryItem::createInstance(m_globalHistoryItem);
+ *item = WebHistoryItem::createInstance(m_globalHistoryItem.copyRef());
return S_OK;
}
@@ -7526,9 +7526,9 @@
return m_fullscreenController.get();
}
-void WebView::setFullScreenElement(PassRefPtr<Element> element)
+void WebView::setFullScreenElement(RefPtr<Element>&& element)
{
- m_fullScreenElement = element;
+ m_fullScreenElement = WTFMove(element);
}
HWND WebView::fullScreenClientWindow() const
diff --git a/Source/WebKit/win/WebView.h b/Source/WebKit/win/WebView.h
index 1b743a5..d98daff 100644
--- a/Source/WebKit/win/WebView.h
+++ b/Source/WebKit/win/WebView.h
@@ -519,7 +519,7 @@
bool supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard) const;
bool isFullScreen() const;
WebCore::FullScreenController* fullScreenController();
- void setFullScreenElement(PassRefPtr<WebCore::Element>);
+ void setFullScreenElement(RefPtr<WebCore::Element>&&);
WebCore::Element* fullScreenElement() const { return m_fullScreenElement.get(); }
#endif