Get rid of more uses of OwnPtr and PassOwnPtr
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 00:59:12 +0000 (00:59 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 00:59:12 +0000 (00:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122136

Reviewed by Antti Koivisto.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveBinaryData):
* WebCore.exp.in:
* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
(WebCore::Blob::slice):
* fileapi/Blob.h:
(WebCore::Blob::create):
* fileapi/File.cpp:
(WebCore::createBlobDataForFileWithType):
(WebCore::createBlobDataForFile):
(WebCore::createBlobDataForFileWithName):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::BlobRegistryContext::BlobRegistryContext):
(WebCore::registerBlobURLTask):
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::BlobBuilder::getBlob):
* platform/network/BlobData.cpp:
(WebCore::BlobDataHandle::BlobDataHandle):
* platform/network/BlobData.h:
(WebCore::BlobData::BlobData):
(WebCore::BlobDataHandle::create):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseBlob):

Source/WebKit2:

* NetworkProcess/AsynchronousNetworkLoaderClient.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/SynchronousNetworkLoaderClient.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* Platform/CoreIPC/ArgumentDecoder.h:
* Platform/CoreIPC/ArgumentEncoder.h:
* Platform/CoreIPC/MessageDecoder.cpp:
(CoreIPC::MessageDecoder::setImportanceAssertion):
* Platform/CoreIPC/MessageDecoder.h:
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC::Connection::receiveSourceEventHandler):
* Platform/CoreIPC/mac/ImportanceAssertion.h:
(CoreIPC::ImportanceAssertion::ImportanceAssertion):
* Platform/mac/LayerHostingContext.h:
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForPort):
(WebKit::LayerHostingContext::createForWindowServer):
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::paint):
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::addPluginControllerProxy):
(WebKit::WebProcessConnection::removePluginControllerProxy):
(WebKit::WebProcessConnection::createPluginInternal):
* PluginProcess/WebProcessConnection.h:
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateFromCGImage):
* Shared/BlockingResponseMap.h:
(BlockingResponseMap::waitForResponse):
(BlockingResponseMap::didReceiveResponse):
* Shared/Downloads/Download.cpp:
* Shared/Downloads/Download.h:
* Shared/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
(WebKit::DownloadManager::convertHandleToDownload):
* Shared/FileAPI/BlobRegistrationData.cpp:
(WebKit::BlobRegistrationData::BlobRegistrationData):
(WebKit::BlobRegistrationData::releaseData):
(WebKit::BlobRegistrationData::decode):
* Shared/FileAPI/BlobRegistrationData.h:
* Shared/Plugins/NPObjectMessageReceiver.cpp:
* Shared/Plugins/NPObjectMessageReceiver.h:
* Shared/Plugins/NPRemoteObjectMap.cpp:
(WebKit::NPRemoteObjectMap::registerNPObject):
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::tryLoad):
* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/ShareableBitmap.h:
* Shared/WebURL.h:
(WebKit::WebURL::create):
(WebKit::WebURL::WebURL):
(WebKit::WebURL::parseURLIfNecessary):
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::makeCGImageCopy):
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
(WebKit::webSecItemCopyMatching):
(WebKit::webSecItemAdd):
(WebKit::webSecItemUpdate):
(WebKit::webSecItemDelete):
(WebKit::SecItemShim::secItemResponse):
* UIProcess/API/mac/FindIndicatorWindow.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/API/mac/WKView.mm:
(-[WKView std::WebKit::]):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/BackingStore.cpp:
* UIProcess/BackingStore.h:
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::incorporateUpdate):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
(WKBundlePageBannerCreateBannerWithCALayer):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::scheduleTimer):
(WebKit::NetscapePlugin::unscheduleTimer):
(WebKit::NetscapePlugin::snapshot):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::snapshot):
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::paint):
(WebKit::PluginProxy::update):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::getFindIndicatorBitmapAndRect):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):
(WebKit::WebFrame::createSubframe):
(WebKit::WebFrame::create):
(WebKit::WebFrame::WebFrame):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scaledSnapshotWithOptions):
(WebKit::WebPage::drawRectToImage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/LayerTreeHostMac.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

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

93 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/WebCore.exp.in
Source/WebCore/fileapi/Blob.cpp
Source/WebCore/fileapi/Blob.h
Source/WebCore/fileapi/File.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.h
Source/WebCore/fileapi/WebKitBlobBuilder.cpp
Source/WebCore/platform/network/BlobData.cpp
Source/WebCore/platform/network/BlobData.h
Source/WebCore/platform/network/BlobRegistry.h
Source/WebCore/platform/network/BlobRegistryImpl.cpp
Source/WebCore/platform/network/BlobRegistryImpl.h
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.h
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoader.h
Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h
Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm
Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
Source/WebKit2/Platform/CoreIPC/MessageDecoder.cpp
Source/WebKit2/Platform/CoreIPC/MessageDecoder.h
Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp
Source/WebKit2/Platform/CoreIPC/mac/ImportanceAssertion.h
Source/WebKit2/Platform/mac/LayerHostingContext.h
Source/WebKit2/Platform/mac/LayerHostingContext.mm
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/PluginProcess/PluginControllerProxy.h
Source/WebKit2/PluginProcess/WebProcessConnection.cpp
Source/WebKit2/PluginProcess/WebProcessConnection.h
Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp
Source/WebKit2/Shared/BlockingResponseMap.h
Source/WebKit2/Shared/Downloads/Download.cpp
Source/WebKit2/Shared/Downloads/Download.h
Source/WebKit2/Shared/Downloads/DownloadManager.cpp
Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp
Source/WebKit2/Shared/FileAPI/BlobRegistrationData.h
Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h
Source/WebKit2/Shared/ShareableBitmap.h
Source/WebKit2/Shared/WebURL.h
Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp
Source/WebKit2/Shared/mac/SecItemShim.cpp
Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/BackingStore.cpp
Source/WebKit2/UIProcess/BackingStore.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index d772a00..9dabd8f 100644 (file)
@@ -1,3 +1,41 @@
+2013-09-30  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of more uses of OwnPtr and PassOwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=122136
+
+        Reviewed by Antti Koivisto.
+
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::didReceiveBinaryData):
+        * WebCore.exp.in:
+        * fileapi/Blob.cpp:
+        (WebCore::Blob::Blob):
+        (WebCore::Blob::slice):
+        * fileapi/Blob.h:
+        (WebCore::Blob::create):
+        * fileapi/File.cpp:
+        (WebCore::createBlobDataForFileWithType):
+        (WebCore::createBlobDataForFile):
+        (WebCore::createBlobDataForFileWithName):
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::BlobRegistryContext::BlobRegistryContext):
+        (WebCore::registerBlobURLTask):
+        (WebCore::ThreadableBlobRegistry::registerBlobURL):
+        * fileapi/ThreadableBlobRegistry.h:
+        * fileapi/WebKitBlobBuilder.cpp:
+        (WebCore::BlobBuilder::getBlob):
+        * platform/network/BlobData.cpp:
+        (WebCore::BlobDataHandle::BlobDataHandle):
+        * platform/network/BlobData.h:
+        (WebCore::BlobData::BlobData):
+        (WebCore::BlobDataHandle::create):
+        * platform/network/BlobRegistry.h:
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        * platform/network/BlobRegistryImpl.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::responseBlob):
+
 2013-09-30  Benjamin Poulain  <benjamin@webkit.org>
 
         Remove the code guarded by STYLE_SCOPED
index a42b9ab..33cef5e 100644 (file)
@@ -526,9 +526,9 @@ void WebSocket::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
         size_t size = binaryData->size();
         RefPtr<RawData> rawData = RawData::create();
         binaryData->swap(*rawData->mutableData());
-        OwnPtr<BlobData> blobData = BlobData::create();
+        auto blobData = std::make_unique<BlobData>();
         blobData->appendData(rawData.release(), 0, BlobDataItem::toEndOfFile);
-        RefPtr<Blob> blob = Blob::create(blobData.release(), size);
+        RefPtr<Blob> blob = Blob::create(std::move(blobData), size);
         dispatchEvent(MessageEvent::create(blob.release(), SecurityOrigin::create(m_url)->toString()));
         break;
     }
index c211042..78bc230 100644 (file)
@@ -2377,7 +2377,6 @@ __ZN7WebCore14LoaderStrategy18createBlobRegistryEv
 __ZN7WebCore7RawDataC1Ev
 __ZN7WebCore8BlobData10appendDataEN3WTF10PassRefPtrINS_7RawDataEEExx
 __ZN7WebCore8BlobData10appendFileERKN3WTF6StringExxd
-__ZN7WebCore8BlobData6createEv
 __ZN7WebCore12BlobDataItem11toEndOfFileE
 __ZN7WebCore12BlobRegistryD2Ev
 __ZTVN7WebCore12BlobRegistryE
index 4547180..0b984e7 100644 (file)
@@ -82,14 +82,14 @@ URLRegistry& BlobURLRegistry::registry()
 Blob::Blob()
     : m_size(0)
 {
-    OwnPtr<BlobData> blobData = BlobData::create();
+    auto blobData = std::make_unique<BlobData>();
 
     // Create a new internal URL and register it with the provided blob data.
     m_internalURL = BlobURL::createInternalURL();
-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, blobData.release());
+    ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobData));
 }
 
-Blob::Blob(PassOwnPtr<BlobData> blobData, long long size)
+Blob::Blob(std::unique_ptr<BlobData> blobData, long long size)
     : m_type(blobData->contentType())
     , m_size(size)
 {
@@ -97,7 +97,7 @@ Blob::Blob(PassOwnPtr<BlobData> blobData, long long size)
 
     // Create a new internal URL and register it with the provided blob data.
     m_internalURL = BlobURL::createInternalURL();
-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, blobData);
+    ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobData));
 }
 
 Blob::Blob(const URL& srcURL, const String& type, long long size)
@@ -217,7 +217,7 @@ PassRefPtr<Blob> Blob::slice(long long start, long long end, const String& conte
         end = size;
 
     long long length = end - start;
-    OwnPtr<BlobData> blobData = BlobData::create();
+    auto blobData = std::make_unique<BlobData>();
     blobData->setContentType(Blob::normalizedContentType(contentType));
     if (isFile()) {
 #if ENABLE(FILE_SYSTEM)
@@ -229,7 +229,7 @@ PassRefPtr<Blob> Blob::slice(long long start, long long end, const String& conte
     } else
         blobData->appendBlob(m_internalURL, start, length);
 
-    return Blob::create(blobData.release(), length);
+    return Blob::create(std::move(blobData), length);
 }
 #endif
 
index 0359d42..5fd60c2 100644 (file)
@@ -51,9 +51,9 @@ public:
         return adoptRef(new Blob);
     }
 
-    static PassRefPtr<Blob> create(PassOwnPtr<BlobData> blobData, long long size)
+    static PassRefPtr<Blob> create(std::unique_ptr<BlobData> blobData, long long size)
     {
-        return adoptRef(new Blob(blobData, size));
+        return adoptRef(new Blob(std::move(blobData), size));
     }
 
     // For deserialization.
@@ -88,7 +88,7 @@ public:
 
 protected:
     Blob();
-    Blob(PassOwnPtr<BlobData>, long long size);
+    Blob(std::unique_ptr<BlobData>, long long size);
 
     // For deserialization.
     Blob(const URL& srcURL, const String& type, long long size);
index 74b01b8..7856e3f 100644 (file)
@@ -50,21 +50,21 @@ static String getContentTypeFromFileName(const String& name, File::ContentTypeLo
     return type;
 }
 
-static PassOwnPtr<BlobData> createBlobDataForFileWithType(const String& path, const String& contentType)
+static std::unique_ptr<BlobData> createBlobDataForFileWithType(const String& path, const String& contentType)
 {
-    OwnPtr<BlobData> blobData = BlobData::create();
+    auto blobData = std::make_unique<BlobData>();
     ASSERT(Blob::isNormalizedContentType(contentType));
     blobData->setContentType(contentType);
     blobData->appendFile(path);
-    return blobData.release();
+    return blobData;
 }
 
-static PassOwnPtr<BlobData> createBlobDataForFile(const String& path, File::ContentTypeLookupPolicy policy)
+static std::unique_ptr<BlobData> createBlobDataForFile(const String& path, File::ContentTypeLookupPolicy policy)
 {
     return createBlobDataForFileWithType(path, getContentTypeFromFileName(path, policy));
 }
 
-static PassOwnPtr<BlobData> createBlobDataForFileWithName(const String& path, const String& fileSystemName, File::ContentTypeLookupPolicy policy)
+static std::unique_ptr<BlobData> createBlobDataForFileWithName(const String& path, const String& fileSystemName, File::ContentTypeLookupPolicy policy)
 {
     return createBlobDataForFileWithType(path, getContentTypeFromFileName(fileSystemName, policy));
 }
index 20dcdd7..c25be75 100644 (file)
@@ -49,9 +49,9 @@ namespace WebCore {
 struct BlobRegistryContext {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    BlobRegistryContext(const URL& url, PassOwnPtr<BlobData> blobData)
+    BlobRegistryContext(const URL& url, std::unique_ptr<BlobData> blobData)
         : url(url.copy())
-        , blobData(blobData)
+        , blobData(std::move(blobData))
     {
         this->blobData->detachFromCurrentThread();
     }
@@ -69,12 +69,12 @@ public:
 
     URL url;
     URL srcURL;
-    OwnPtr<BlobData> blobData;
+    std::unique_ptr<BlobData> blobData;
 };
 
 #if ENABLE(BLOB)
 
-typedef HashMap<String, RefPtr<SecurityOrigin> > BlobUrlOriginMap;
+typedef HashMap<String, RefPtr<SecurityOrigin>> BlobUrlOriginMap;
 static ThreadSpecific<BlobUrlOriginMap>& originMap()
 {
     AtomicallyInitializedStatic(ThreadSpecific<BlobUrlOriginMap>*, map = new ThreadSpecific<BlobUrlOriginMap>);
@@ -84,15 +84,15 @@ static ThreadSpecific<BlobUrlOriginMap>& originMap()
 static void registerBlobURLTask(void* context)
 {
     OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context));
-    blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->blobData.release());
+    blobRegistry().registerBlobURL(blobRegistryContext->url, std::move(blobRegistryContext->blobData));
 }
 
-void ThreadableBlobRegistry::registerBlobURL(const URL& url, PassOwnPtr<BlobData> blobData)
+void ThreadableBlobRegistry::registerBlobURL(const URL& url, std::unique_ptr<BlobData> blobData)
 {
     if (isMainThread())
-        blobRegistry().registerBlobURL(url, blobData);
+        blobRegistry().registerBlobURL(url, std::move(blobData));
     else {
-        OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url, blobData));
+        OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url, std::move(blobData)));
         callOnMainThread(&registerBlobURLTask, context.leakPtr());
     }
 }
index 83e55cc..e2e5c69 100644 (file)
@@ -31,7 +31,6 @@
 #ifndef ThreadableBlobRegistry_h
 #define ThreadableBlobRegistry_h
 
-#include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 
 namespace WebCore {
@@ -42,7 +41,7 @@ class SecurityOrigin;
 
 class ThreadableBlobRegistry {
 public:
-    static void registerBlobURL(const URL&, PassOwnPtr<BlobData>);
+    static void registerBlobURL(const URL&, std::unique_ptr<BlobData>);
     static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL);
     static void unregisterBlobURL(const URL&);
 
index e7d9490..c6684a1 100644 (file)
@@ -145,11 +145,11 @@ void BlobBuilder::appendBytesData(const void* data, size_t length)
 
 PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType)
 {
-    OwnPtr<BlobData> blobData = BlobData::create();
+    auto blobData = std::make_unique<BlobData>();
     blobData->setContentType(Blob::normalizedContentType(contentType));
     blobData->swapItems(m_items);
 
-    RefPtr<Blob> blob = Blob::create(blobData.release(), m_size);
+    RefPtr<Blob> blob = Blob::create(std::move(blobData), m_size);
 
     // After creating a blob from the current blob data, we do not need to keep the data around any more. Instead, we only
     // need to keep a reference to the URL of the blob just created.
index bf0166f..884bf2f 100644 (file)
@@ -60,11 +60,6 @@ void BlobDataItem::detachFromCurrentThread()
     url = url.copy();
 }
 
-PassOwnPtr<BlobData> BlobData::create()
-{
-    return adoptPtr(new BlobData());
-}
-
 void BlobData::detachFromCurrentThread()
 {
     m_contentType = m_contentType.isolatedCopy();
@@ -112,11 +107,11 @@ void BlobData::swapItems(BlobDataItemList& items)
 }
 
 
-BlobDataHandle::BlobDataHandle(PassOwnPtr<BlobData> data, long long size)
+BlobDataHandle::BlobDataHandle(std::unique_ptr<BlobData> data, long long size)
 {
     UNUSED_PARAM(size);
     m_internalURL = BlobURL::createInternalURL();
-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, data);
+    ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(data));
 }
 
 BlobDataHandle::~BlobDataHandle()
index f605481..83ac589 100644 (file)
@@ -167,7 +167,7 @@ typedef Vector<BlobDataItem> BlobDataItemList;
 class BlobData {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<BlobData> create();
+    BlobData() { }
 
     // Detaches from current thread so that it can be passed to another thread.
     void detachFromCurrentThread();
@@ -193,8 +193,6 @@ private:
     friend class BlobRegistryImpl;
     friend class BlobStorageData;
 
-    BlobData() { }
-
     // This is only exposed to BlobStorageData.
     void appendData(const RawData&, long long offset, long long length);
 
@@ -208,15 +206,15 @@ private:
 // https://codereview.chromium.org/11192017/.
 class BlobDataHandle : public ThreadSafeRefCounted<BlobDataHandle> {
 public:
-    static PassRefPtr<BlobDataHandle> create(PassOwnPtr<BlobData> data, long long size)
+    static PassRefPtr<BlobDataHandle> create(std::unique_ptr<BlobData> data, long long size)
     {
-        return adoptRef(new BlobDataHandle(data, size));
+        return adoptRef(new BlobDataHandle(std::move(data), size));
     }
 
     ~BlobDataHandle();
 
 private:
-    BlobDataHandle(PassOwnPtr<BlobData>, long long size);
+    BlobDataHandle(std::unique_ptr<BlobData>, long long size);
     URL m_internalURL;
 };
 
index db1c546..868c46c 100644 (file)
@@ -46,7 +46,7 @@ BlobRegistry& blobRegistry();
 class BlobRegistry {
 public:
     // Registers a blob URL referring to the specified blob data.
-    virtual void registerBlobURL(const URL&, PassOwnPtr<BlobData>) = 0;
+    virtual void registerBlobURL(const URL&, std::unique_ptr<BlobData>) = 0;
     
     // Registers a new blob URL referring to the blob data identified by the specified srcURL.
     virtual void registerBlobURL(const URL&, const URL& srcURL) = 0;
index 83c1913..3a7aae7 100644 (file)
@@ -128,7 +128,7 @@ void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons
     }
 }
 
-void BlobRegistryImpl::registerBlobURL(const URL& url, PassOwnPtr<BlobData> blobData)
+void BlobRegistryImpl::registerBlobURL(const URL& url, std::unique_ptr<BlobData> blobData)
 {
     ASSERT(isMainThread());
     registerBlobResourceHandleConstructor();
index e0c32be..acf4b37 100644 (file)
@@ -58,7 +58,7 @@ private:
     void appendStorageItems(BlobStorageData*, const BlobDataItemList&);
     void appendStorageItems(BlobStorageData*, const BlobDataItemList&, long long offset, long long length);
 
-    virtual void registerBlobURL(const URL&, PassOwnPtr<BlobData>) OVERRIDE;
+    virtual void registerBlobURL(const URL&, std::unique_ptr<BlobData>) OVERRIDE;
     virtual void registerBlobURL(const URL&, const URL& srcURL) OVERRIDE;
     virtual void unregisterBlobURL(const URL&) OVERRIDE;
     virtual bool isBlobRegistryImpl() const OVERRIDE { return true; }
index c275b10..72c6446 100644 (file)
@@ -300,7 +300,7 @@ Blob* XMLHttpRequest::responseBlob()
         // instead of copying the bytes. Embedders who store blob data in the
         // same process as WebCore would at least to teach BlobData to take
         // a SharedBuffer, even if they don't get the Blob from the network layer directly.
-        OwnPtr<BlobData> blobData = BlobData::create();
+        auto blobData = std::make_unique<BlobData>();
         // If we errored out or got no data, we still return a blob, just an empty one.
         size_t size = 0;
         if (m_binaryResponseBuilder) {
@@ -312,7 +312,7 @@ Blob* XMLHttpRequest::responseBlob()
             blobData->setContentType(normalizedContentType); // responseMIMEType defaults to text/xml which may be incorrect.
             m_binaryResponseBuilder.clear();
         }
-        m_responseBlob = Blob::create(blobData.release(), size);
+        m_responseBlob = Blob::create(std::move(blobData), size);
     }
 
     return m_responseBlob.get();
index bf77af2..9ad9c59 100644 (file)
@@ -1,3 +1,144 @@
+2013-09-30  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of more uses of OwnPtr and PassOwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=122136
+
+        Reviewed by Antti Koivisto.
+
+        * NetworkProcess/AsynchronousNetworkLoaderClient.h:
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+        (WebKit::NetworkBlobRegistry::registerBlobURL):
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
+        * NetworkProcess/NetworkResourceLoader.h:
+        * NetworkProcess/SynchronousNetworkLoaderClient.h:
+        * NetworkProcess/mac/RemoteNetworkingContext.mm:
+        * Platform/CoreIPC/ArgumentDecoder.h:
+        * Platform/CoreIPC/ArgumentEncoder.h:
+        * Platform/CoreIPC/MessageDecoder.cpp:
+        (CoreIPC::MessageDecoder::setImportanceAssertion):
+        * Platform/CoreIPC/MessageDecoder.h:
+        * Platform/CoreIPC/mac/ConnectionMac.cpp:
+        (CoreIPC::Connection::receiveSourceEventHandler):
+        * Platform/CoreIPC/mac/ImportanceAssertion.h:
+        (CoreIPC::ImportanceAssertion::ImportanceAssertion):
+        * Platform/mac/LayerHostingContext.h:
+        * Platform/mac/LayerHostingContext.mm:
+        (WebKit::LayerHostingContext::createForPort):
+        (WebKit::LayerHostingContext::createForWindowServer):
+        * PluginProcess/PluginControllerProxy.cpp:
+        (WebKit::PluginControllerProxy::paint):
+        * PluginProcess/PluginControllerProxy.h:
+        * PluginProcess/WebProcessConnection.cpp:
+        (WebKit::WebProcessConnection::addPluginControllerProxy):
+        (WebKit::WebProcessConnection::removePluginControllerProxy):
+        (WebKit::WebProcessConnection::createPluginInternal):
+        * PluginProcess/WebProcessConnection.h:
+        * Shared/API/c/cg/WKImageCG.cpp:
+        (WKImageCreateFromCGImage):
+        * Shared/BlockingResponseMap.h:
+        (BlockingResponseMap::waitForResponse):
+        (BlockingResponseMap::didReceiveResponse):
+        * Shared/Downloads/Download.cpp:
+        * Shared/Downloads/Download.h:
+        * Shared/Downloads/DownloadManager.cpp:
+        (WebKit::DownloadManager::startDownload):
+        (WebKit::DownloadManager::convertHandleToDownload):
+        * Shared/FileAPI/BlobRegistrationData.cpp:
+        (WebKit::BlobRegistrationData::BlobRegistrationData):
+        (WebKit::BlobRegistrationData::releaseData):
+        (WebKit::BlobRegistrationData::decode):
+        * Shared/FileAPI/BlobRegistrationData.h:
+        * Shared/Plugins/NPObjectMessageReceiver.cpp:
+        * Shared/Plugins/NPObjectMessageReceiver.h:
+        * Shared/Plugins/NPRemoteObjectMap.cpp:
+        (WebKit::NPRemoteObjectMap::registerNPObject):
+        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
+        (WebKit::NetscapePluginModule::tryLoad):
+        * Shared/Plugins/Netscape/NetscapePluginModule.h:
+        * Shared/ShareableBitmap.h:
+        * Shared/WebURL.h:
+        (WebKit::WebURL::create):
+        (WebKit::WebURL::WebURL):
+        (WebKit::WebURL::parseURLIfNecessary):
+        * Shared/cg/ShareableBitmapCG.cpp:
+        (WebKit::ShareableBitmap::createGraphicsContext):
+        (WebKit::ShareableBitmap::makeCGImageCopy):
+        * Shared/mac/SecItemShim.cpp:
+        (WebKit::sendSecItemRequest):
+        (WebKit::webSecItemCopyMatching):
+        (WebKit::webSecItemAdd):
+        (WebKit::webSecItemUpdate):
+        (WebKit::webSecItemDelete):
+        (WebKit::SecItemShim::secItemResponse):
+        * UIProcess/API/mac/FindIndicatorWindow.h:
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::createDrawingAreaProxy):
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView std::WebKit::]):
+        (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/BackingStore.cpp:
+        * UIProcess/BackingStore.h:
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
+        * UIProcess/DrawingAreaProxyImpl.h:
+        * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerBlobURL):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
+        * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
+        (WKBundlePageBannerCreateBannerWithCALayer):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+        (WebKit::imageForRect):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::scheduleTimer):
+        (WebKit::NetscapePlugin::unscheduleTimer):
+        (WebKit::NetscapePlugin::snapshot):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::snapshot):
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::paint):
+        (WebKit::PluginProxy::update):
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::convertImageToBitmap):
+        * WebProcess/WebPage/DrawingArea.cpp:
+        (WebKit::DrawingArea::create):
+        * WebProcess/WebPage/DrawingArea.h:
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::display):
+        * WebProcess/WebPage/DrawingAreaImpl.h:
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::getFindIndicatorBitmapAndRect):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::createWithCoreMainFrame):
+        (WebKit::WebFrame::createSubframe):
+        (WebKit::WebFrame::create):
+        (WebKit::WebFrame::WebFrame):
+        * WebProcess/WebPage/WebFrame.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::scaledSnapshotWithOptions):
+        (WebKit::WebPage::drawRectToImage):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/mac/LayerTreeHostMac.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+
 2013-09-27  Anders Carlsson  <andersca@apple.com>
 
         Message sending functions should only accept rvalues
index c702625..8a9a023 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "NetworkLoaderClient.h"
 #include "ShareableResource.h"
-#include <wtf/PassOwnPtr.h>
 
 #if ENABLE(NETWORK_PROCESS)
 
@@ -36,14 +35,9 @@ namespace WebKit {
 
 class AsynchronousNetworkLoaderClient : public NetworkLoaderClient {
 public:
-    static PassOwnPtr<NetworkLoaderClient> create()
-    {
-        return adoptPtr(new AsynchronousNetworkLoaderClient());
-    }
-
-private:
     AsynchronousNetworkLoaderClient();
 
+private:
     virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse) OVERRIDE;
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&) OVERRIDE;
index 850768c..f57b2f9 100644 (file)
@@ -47,7 +47,7 @@ NetworkBlobRegistry::NetworkBlobRegistry()
 {
 }
 
-void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, PassOwnPtr<BlobData> data, const Vector<RefPtr<SandboxExtension>>& newSandboxExtensions)
+void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, std::unique_ptr<BlobData> data, const Vector<RefPtr<SandboxExtension>>& newSandboxExtensions)
 {
     ASSERT(!m_sandboxExtensions.contains(url.string()));
 
@@ -59,7 +59,7 @@ void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connect
             sandboxExtensions.appendVector(m_sandboxExtensions.get(items[i].url.string()));
     }
 
-    blobRegistry().registerBlobURL(url, data);
+    blobRegistry().registerBlobURL(url, std::move(data));
 
     if (!sandboxExtensions.isEmpty())
         m_sandboxExtensions.add(url.string(), sandboxExtensions);
index 73306f2..16c6adb 100644 (file)
@@ -47,7 +47,7 @@ public:
     NetworkBlobRegistry();
     static NetworkBlobRegistry& shared();
 
-    void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, PassOwnPtr<WebCore::BlobData>, const Vector<RefPtr<SandboxExtension>>&);
+    void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, std::unique_ptr<WebCore::BlobData>, const Vector<RefPtr<SandboxExtension>>&);
     void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL);
     void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&);
 
index 91e44df..85e8bba 100644 (file)
@@ -103,9 +103,9 @@ NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters
     ASSERT(isMainThread());
     
     if (reply)
-        m_networkLoaderClient = SynchronousNetworkLoaderClient::create(m_request, reply);
+        m_networkLoaderClient = std::make_unique<SynchronousNetworkLoaderClient>(m_request, reply);
     else
-        m_networkLoaderClient = AsynchronousNetworkLoaderClient::create();
+        m_networkLoaderClient = std::make_unique<AsynchronousNetworkLoaderClient>();
 }
 
 NetworkResourceLoader::~NetworkResourceLoader()
index 399e8ba..8ca227a 100644 (file)
@@ -166,7 +166,7 @@ private:
     uint64_t m_bytesReceived;
 
     bool m_handleConvertedToDownload;
-    OwnPtr<NetworkLoaderClient> m_networkLoaderClient;
+    std::unique_ptr<NetworkLoaderClient> m_networkLoaderClient;
 
     ResourceLoadIdentifier m_identifier;
     uint64_t m_webPageID;
index 4c822fd..07c6426 100644 (file)
@@ -43,18 +43,12 @@ namespace WebKit {
 
 class SynchronousNetworkLoaderClient : public NetworkLoaderClient {
 public:
-    static PassOwnPtr<NetworkLoaderClient> create(const WebCore::ResourceRequest& originalRequest, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply)
-    {
-        return adoptPtr(new SynchronousNetworkLoaderClient(originalRequest, reply));
-    }
-    
+    SynchronousNetworkLoaderClient(const WebCore::ResourceRequest& originalRequest, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>);
     virtual ~SynchronousNetworkLoaderClient() OVERRIDE;
 
     virtual bool isSynchronous() OVERRIDE { return true; }
 
 private:
-    SynchronousNetworkLoaderClient(const WebCore::ResourceRequest& originalRequest, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>);
-
     virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest& proposedRequest, const WebCore::ResourceResponse& redirectResponse) OVERRIDE;
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&) OVERRIDE;
index 53ec91c..60c57c1 100644 (file)
@@ -30,7 +30,6 @@
 #import <WebCore/ResourceError.h>
 #import <WebKitSystemInterface.h>
 #import <wtf/MainThread.h>
-#import <wtf/PassOwnPtr.h>
 
 using namespace WebCore;
 
index e8dabb6..bde55ed 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "ArgumentCoder.h"
 #include "Attachment.h"
-#include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
 
 namespace CoreIPC {
index 17f0fd2..047c35d 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "ArgumentCoder.h"
 #include "Attachment.h"
-#include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
 
 namespace CoreIPC {
index e7bc5d2..e6971a9 100644 (file)
@@ -67,9 +67,9 @@ bool MessageDecoder::shouldDispatchMessageWhenWaitingForSyncReply() const
 }
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-void MessageDecoder::setImportanceAssertion(PassOwnPtr<ImportanceAssertion> assertion)
+void MessageDecoder::setImportanceAssertion(std::unique_ptr<ImportanceAssertion> assertion)
 {
-    m_importanceAssertion = assertion;
+    m_importanceAssertion = std::move(assertion);
 }
 #endif
 
index e151da4..1b79a37 100644 (file)
@@ -46,7 +46,7 @@ public:
     bool shouldDispatchMessageWhenWaitingForSyncReply() const;
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-    void setImportanceAssertion(PassOwnPtr<ImportanceAssertion>);
+    void setImportanceAssertion(std::unique_ptr<ImportanceAssertion>);
 #endif
 
 private:
@@ -55,7 +55,7 @@ private:
     StringReference m_messageName;
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-    OwnPtr<ImportanceAssertion> m_importanceAssertion;
+    std::unique_ptr<ImportanceAssertion> m_importanceAssertion;
 #endif
 };
 
index 948c4eb..ff56749 100644 (file)
@@ -406,7 +406,7 @@ void Connection::receiveSourceEventHandler()
     ASSERT(decoder);
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-    decoder->setImportanceAssertion(ImportanceAssertion::create(header));
+    decoder->setImportanceAssertion(std::make_unique<ImportanceAssertion>(header));
 #endif
 
     if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "InitializeConnection") {
index 37e733a..16117a6 100644 (file)
@@ -28,8 +28,6 @@
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
 
-#include <wtf/PassOwnPtr.h>
-
 #if __has_include(<libproc_internal.h>)
 #include <libproc_internal.h>
 #endif
@@ -43,9 +41,10 @@ class ImportanceAssertion {
     WTF_MAKE_NONCOPYABLE(ImportanceAssertion);
 
 public:
-    static PassOwnPtr<ImportanceAssertion> create(mach_msg_header_t* header)
+    explicit ImportanceAssertion(mach_msg_header_t* header)
+        : m_assertion(0)
     {
-        return adoptPtr(new ImportanceAssertion(header));
+        proc_importance_assertion_begin_with_msg(header, 0, &m_assertion);
     }
 
     ~ImportanceAssertion()
@@ -54,12 +53,6 @@ public:
     }
 
 private:
-    ImportanceAssertion(mach_msg_header_t* header)
-        : m_assertion(0)
-    {
-        proc_importance_assertion_begin_with_msg(header, 0, &m_assertion);
-    }
-
     uint64_t m_assertion;
 };
 
index c380403..1bbaced 100644 (file)
@@ -39,10 +39,12 @@ namespace WebKit {
 class LayerHostingContext {
     WTF_MAKE_NONCOPYABLE(LayerHostingContext);
 public:
-    static PassOwnPtr<LayerHostingContext> createForPort(mach_port_t serverPort);
+    static std::unique_ptr<LayerHostingContext> createForPort(mach_port_t serverPort);
 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    static PassOwnPtr<LayerHostingContext> createForWindowServer();
+    static std::unique_ptr<LayerHostingContext> createForWindowServer();
 #endif
+
+    LayerHostingContext();
     ~LayerHostingContext();
 
     void setRootLayer(CALayer *);
@@ -57,8 +59,6 @@ public:
     CGColorSpaceRef colorSpace() const;
 
 private:
-    LayerHostingContext();
-
     LayerHostingMode m_layerHostingMode;
     RetainPtr<WKCAContextRef> m_context;
 };
index 54fc1a1..4f5d481 100644 (file)
 #import "LayerHostingContext.h"
 
 #import <wtf/OwnPtr.h>
-#import <wtf/PassOwnPtr.h>
 #import <WebKitSystemInterface.h>
 
 namespace WebKit {
 
-PassOwnPtr<LayerHostingContext> LayerHostingContext::createForPort(mach_port_t serverPort)
+std::unique_ptr<LayerHostingContext> LayerHostingContext::createForPort(mach_port_t serverPort)
 {
-    OwnPtr<LayerHostingContext> layerHostingContext = adoptPtr(new LayerHostingContext);
+    auto layerHostingContext = std::make_unique<LayerHostingContext>();
 
     layerHostingContext->m_layerHostingMode = LayerHostingModeDefault;
     layerHostingContext->m_context = WKCAContextMakeRemoteWithServerPort(serverPort);
 
-    return layerHostingContext.release();
+    return layerHostingContext;
 }
 
 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-PassOwnPtr<LayerHostingContext> LayerHostingContext::createForWindowServer()
+std::unique_ptr<LayerHostingContext> LayerHostingContext::createForWindowServer()
 {
-    OwnPtr<LayerHostingContext> layerHostingContext = adoptPtr(new LayerHostingContext);
+    auto layerHostingContext = std::make_unique<LayerHostingContext>();
 
     layerHostingContext->m_layerHostingMode = LayerHostingModeInWindowServer;
     layerHostingContext->m_context = WKCAContextMakeRemoteForWindowServer();
 
-    return layerHostingContext.release();
+    return layerHostingContext;
 }
 #endif
 
index 6c053c1..d7346f7 100644 (file)
@@ -54,11 +54,6 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<PluginControllerProxy> PluginControllerProxy::create(WebProcessConnection* connection, const PluginCreationParameters& creationParameters)
-{
-    return adoptPtr(new PluginControllerProxy(connection, creationParameters));
-}
-
 PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, const PluginCreationParameters& creationParameters)
     : m_connection(connection)
     , m_pluginInstanceID(creationParameters.pluginInstanceID)
@@ -183,7 +178,7 @@ void PluginControllerProxy::paint()
     ASSERT(m_plugin);
 
     // Create a graphics context.
-    OwnPtr<GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
+    auto graphicsContext = m_backingStore->createGraphicsContext();
 
 #if PLATFORM(MAC)
     // FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI
index 678e2bd..ce4ef16 100644 (file)
@@ -53,7 +53,7 @@ class PluginControllerProxy : PluginController {
     WTF_MAKE_NONCOPYABLE(PluginControllerProxy);
 
 public:
-    static PassOwnPtr<PluginControllerProxy> create(WebProcessConnection*, const PluginCreationParameters&);
+    PluginControllerProxy(WebProcessConnection*, const PluginCreationParameters&);
     ~PluginControllerProxy();
 
     uint64_t pluginInstanceID() const { return m_pluginInstanceID; }
@@ -78,8 +78,6 @@ public:
     PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> takeInitializationReply();
 
 private:
-    PluginControllerProxy(WebProcessConnection*, const PluginCreationParameters&);
-
     void startPaintTimer();
     void paint();
 
@@ -206,7 +204,7 @@ private:
     bool m_isComplexTextInputEnabled;
 
     // For CA plug-ins, this holds the information needed to export the layer hierarchy to the UI process.
-    OwnPtr<LayerHostingContext> m_layerHostingContext;
+    std::unique_ptr<LayerHostingContext> m_layerHostingContext;
 #endif
 
     // The contents scale factor of this plug-in.
index 8e8ac93..c71c1d4 100644 (file)
@@ -67,12 +67,12 @@ WebProcessConnection::WebProcessConnection(CoreIPC::Connection::Identifier conne
     m_connection->open();
 }
 
-void WebProcessConnection::addPluginControllerProxy(PassOwnPtr<PluginControllerProxy> pluginController)
+void WebProcessConnection::addPluginControllerProxy(std::unique_ptr<PluginControllerProxy> pluginController)
 {
     uint64_t pluginInstanceID = pluginController->pluginInstanceID();
 
     ASSERT(!m_pluginControllers.contains(pluginInstanceID));
-    m_pluginControllers.set(pluginInstanceID, pluginController);
+    m_pluginControllers.set(pluginInstanceID, std::move(pluginController));
 }
 
 void WebProcessConnection::destroyPluginControllerProxy(PluginControllerProxy* pluginController)
@@ -87,8 +87,8 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl
     {
         ASSERT(m_pluginControllers.contains(pluginController->pluginInstanceID()));
 
-        OwnPtr<PluginControllerProxy> pluginControllerOwnPtr = m_pluginControllers.take(pluginController->pluginInstanceID());
-        ASSERT(pluginControllerOwnPtr == pluginController);
+        std::unique_ptr<PluginControllerProxy> pluginControllerUniquePtr = m_pluginControllers.take(pluginController->pluginInstanceID());
+        ASSERT(pluginControllerUniquePtr.get() == pluginController);
     }
 
     // Invalidate all objects related to this plug-in.
@@ -205,13 +205,13 @@ void WebProcessConnection::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIP
 
 void WebProcessConnection::createPluginInternal(const PluginCreationParameters& creationParameters, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID)
 {
-    OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, creationParameters);
+    auto pluginControllerProxy = std::make_unique<PluginControllerProxy>(this, creationParameters);
 
     PluginControllerProxy* pluginControllerProxyPtr = pluginControllerProxy.get();
 
     // Make sure to add the proxy to the map before initializing it, since the plug-in might call out to the web process from 
     // its NPP_New function. This will hand over ownership of the proxy to the web process connection.
-    addPluginControllerProxy(pluginControllerProxy.release());
+    addPluginControllerProxy(std::move(pluginControllerProxy));
 
     // Now try to initialize the plug-in.
     result = pluginControllerProxyPtr->initialize(creationParameters);
index 439e125..4d1c47c 100644 (file)
@@ -57,7 +57,7 @@ public:
 private:
     WebProcessConnection(CoreIPC::Connection::Identifier);
 
-    void addPluginControllerProxy(PassOwnPtr<PluginControllerProxy>);
+    void addPluginControllerProxy(std::unique_ptr<PluginControllerProxy>);
 
     void destroyPluginControllerProxy(PluginControllerProxy*);
 
@@ -78,7 +78,7 @@ private:
 
     RefPtr<CoreIPC::Connection> m_connection;
 
-    HashMap<uint64_t, OwnPtr<PluginControllerProxy>> m_pluginControllers;
+    HashMap<uint64_t, std::unique_ptr<PluginControllerProxy>> m_pluginControllers;
     RefPtr<NPRemoteObjectMap> m_npRemoteObjectMap;
     HashSet<uint64_t> m_asynchronousInstanceIDsToIgnore;
 };
index 1071ef5..7defaab 100644 (file)
@@ -54,7 +54,7 @@ WKImageRef WKImageCreateFromCGImage(CGImageRef imageRef, WKImageOptions options)
     if (!webImage->bitmap())
         return 0;
 
-    OwnPtr<GraphicsContext> graphicsContext = webImage->bitmap()->createGraphicsContext();
+    auto graphicsContext = webImage->bitmap()->createGraphicsContext();
     FloatRect rect(FloatPoint(0, 0), imageSize);
     graphicsContext->clearRect(rect);
     graphicsContext->drawNativeImage(imageRef, imageSize, WebCore::ColorSpaceDeviceRGB, rect, rect);
index 72feca8..c6de862 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <wtf/HashMap.h>
 #include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/ThreadingPrimitives.h>
 
 template<typename T>
@@ -38,7 +37,7 @@ public:
     BlockingResponseMap() : m_canceled(false) { }
     ~BlockingResponseMap() { ASSERT(m_responses.isEmpty()); }
 
-    PassOwnPtr<T> waitForResponse(uint64_t requestID)
+    std::unique_ptr<T> waitForResponse(uint64_t requestID)
     {
         while (true) {
             MutexLocker locker(m_mutex);
@@ -46,8 +45,8 @@ public:
             if (m_canceled)
                 return nullptr;
 
-            if (OwnPtr<T> response = m_responses.take(requestID))
-                return response.release();
+            if (std::unique_ptr<T> response = m_responses.take(requestID))
+                return response;
 
             m_condition.wait(m_mutex);
         }
@@ -55,12 +54,12 @@ public:
         return nullptr;
     }
 
-    void didReceiveResponse(uint64_t requestID, PassOwnPtr<T> response)
+    void didReceiveResponse(uint64_t requestID, std::unique_ptr<T> response)
     {
         MutexLocker locker(m_mutex);
         ASSERT(!m_responses.contains(requestID));
 
-        m_responses.set(requestID, response);
+        m_responses.set(requestID, std::move(response));
         // FIXME: Waking up all threads is quite inefficient.
         m_condition.broadcast();
     }
@@ -77,7 +76,7 @@ private:
     Mutex m_mutex;
     ThreadCondition m_condition;
 
-    HashMap<uint64_t, OwnPtr<T>> m_responses;
+    HashMap<uint64_t, std::unique_ptr<T>> m_responses;
     bool m_canceled;
 };
 
index 4488ac4..879752c 100644 (file)
@@ -39,11 +39,6 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<Download> Download::create(DownloadManager& downloadManager, uint64_t downloadID, const ResourceRequest& request)
-{
-    return adoptPtr(new Download(downloadManager, downloadID, request));
-}
-
 Download::Download(DownloadManager& downloadManager, uint64_t downloadID, const ResourceRequest& request)
     : m_downloadManager(downloadManager)
     , m_downloadID(downloadID)
index 753bc7c..051b232 100644 (file)
@@ -29,7 +29,6 @@
 #include "MessageSender.h"
 #include <WebCore/ResourceRequest.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
 
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
@@ -73,7 +72,7 @@ class QtFileDownloader;
 class Download : public CoreIPC::MessageSender {
     WTF_MAKE_NONCOPYABLE(Download);
 public:
-    static PassOwnPtr<Download> create(DownloadManager&, uint64_t downloadID, const WebCore::ResourceRequest&);
+    Download(DownloadManager&, uint64_t downloadID, const WebCore::ResourceRequest&);
     ~Download();
 
     void start();
@@ -114,8 +113,6 @@ public:
     void cancelAuthenticationChallenge(const WebCore::AuthenticationChallenge&);
 
 private:
-    Download(DownloadManager&, uint64_t downloadID, const WebCore::ResourceRequest&);
-
     // CoreIPC::MessageSender
     virtual CoreIPC::Connection* messageSenderConnection() OVERRIDE;
     virtual uint64_t messageSenderDestinationID() OVERRIDE;
index b9172e0..960560b 100644 (file)
@@ -40,20 +40,20 @@ DownloadManager::DownloadManager(Client* client)
 
 void DownloadManager::startDownload(uint64_t downloadID, const ResourceRequest& request)
 {
-    OwnPtr<Download> download = Download::create(*this, downloadID, request);
+    auto download = std::make_unique<Download>(*this, downloadID, request);
     download->start();
 
     ASSERT(!m_downloads.contains(downloadID));
-    m_downloads.set(downloadID, download.leakPtr());
+    m_downloads.set(downloadID, download.release());
 }
 
 void DownloadManager::convertHandleToDownload(uint64_t downloadID, ResourceHandle* handle, const ResourceRequest& request, const ResourceResponse& response)
 {
-    OwnPtr<Download> download = Download::create(*this, downloadID, request);
+    auto download = std::make_unique<Download>(*this, downloadID, request);
 
     download->startWithHandle(handle, response);
     ASSERT(!m_downloads.contains(downloadID));
-    m_downloads.set(downloadID, download.leakPtr());
+    m_downloads.set(downloadID, download.release());
 }
 
 void DownloadManager::cancelDownload(uint64_t downloadID)
index 4130b15..47dea9f 100644 (file)
@@ -41,8 +41,8 @@ BlobRegistrationData::BlobRegistrationData()
 {
 }
 
-BlobRegistrationData::BlobRegistrationData(PassOwnPtr<BlobData> data)
-    : m_data(data)
+BlobRegistrationData::BlobRegistrationData(std::unique_ptr<BlobData> data)
+    : m_data(std::move(data))
 {
     const BlobDataItemList& items = m_data->items();
     size_t fileCount = 0;
@@ -65,9 +65,9 @@ BlobRegistrationData::~BlobRegistrationData()
 {
 }
 
-PassOwnPtr<BlobData> BlobRegistrationData::releaseData() const
+std::unique_ptr<BlobData> BlobRegistrationData::releaseData() const
 {
-    return m_data.release();
+    return std::move(m_data);
 }
 
 void BlobRegistrationData::encode(CoreIPC::ArgumentEncoder& encoder) const
@@ -107,7 +107,7 @@ void BlobRegistrationData::encode(CoreIPC::ArgumentEncoder& encoder) const
 bool BlobRegistrationData::decode(CoreIPC::ArgumentDecoder& decoder, BlobRegistrationData& result)
 {
     ASSERT(!result.m_data);
-    result.m_data = BlobData::create();
+    result.m_data = std::make_unique<BlobData>();
 
     String contentType;
     if (!decoder.decode(contentType))
index 35f6abb..b485131 100644 (file)
@@ -40,17 +40,17 @@ class BlobRegistrationData {
 WTF_MAKE_NONCOPYABLE(BlobRegistrationData);
 public:
     BlobRegistrationData();
-    BlobRegistrationData(PassOwnPtr<WebCore::BlobData>);
+    BlobRegistrationData(std::unique_ptr<WebCore::BlobData>);
     ~BlobRegistrationData();
 
     void encode(CoreIPC::ArgumentEncoder&) const;
     static bool decode(CoreIPC::ArgumentDecoder&, BlobRegistrationData&);
 
-    PassOwnPtr<WebCore::BlobData> releaseData() const;
+    std::unique_ptr<WebCore::BlobData> releaseData() const;
     const SandboxExtension::HandleArray& sandboxExtensions() const { return m_sandboxExtensions; }
 
 private:
-    mutable OwnPtr<WebCore::BlobData> m_data;
+    mutable std::unique_ptr<WebCore::BlobData> m_data;
     SandboxExtension::HandleArray m_sandboxExtensions;
 };
 
index 58af870..e5567cf 100644 (file)
 
 namespace WebKit {
 
-PassOwnPtr<NPObjectMessageReceiver> NPObjectMessageReceiver::create(NPRemoteObjectMap* npRemoteObjectMap, Plugin* plugin, uint64_t npObjectID, NPObject* npObject)
-{
-    return adoptPtr(new NPObjectMessageReceiver(npRemoteObjectMap, plugin, npObjectID, npObject));
-}
-
 NPObjectMessageReceiver::NPObjectMessageReceiver(NPRemoteObjectMap* npRemoteObjectMap, Plugin* plugin, uint64_t npObjectID, NPObject* npObject)
     : m_npRemoteObjectMap(npRemoteObjectMap)
     , m_plugin(plugin)
index 4607d05..6c8cc92 100644 (file)
@@ -31,7 +31,6 @@
 #include "Connection.h"
 #include <WebCore/npruntime.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace WebKit {
 
@@ -44,7 +43,7 @@ class NPObjectMessageReceiver {
     WTF_MAKE_NONCOPYABLE(NPObjectMessageReceiver);
 
 public:
-    static PassOwnPtr<NPObjectMessageReceiver> create(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID, NPObject*);
+    NPObjectMessageReceiver(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID, NPObject*);
     ~NPObjectMessageReceiver();
 
     void didReceiveSyncNPObjectMessageReceiverMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, std::unique_ptr<CoreIPC::MessageEncoder>&);
@@ -53,8 +52,6 @@ public:
     NPObject* npObject() const { return m_npObject; }
     
 private:
-    NPObjectMessageReceiver(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID, NPObject*);
-
     // Message handlers.
     void deallocate();
     void hasMethod(const NPIdentifierData&, bool& returnValue);
index 8f2a403..75a5e73 100644 (file)
@@ -78,7 +78,7 @@ void NPRemoteObjectMap::npObjectProxyDestroyed(NPObject* npObject)
 uint64_t NPRemoteObjectMap::registerNPObject(NPObject* npObject, Plugin* plugin)
 {
     uint64_t npObjectID = generateNPObjectID();
-    m_registeredNPObjects.set(npObjectID, NPObjectMessageReceiver::create(this, plugin, npObjectID, npObject).leakPtr());
+    m_registeredNPObjects.set(npObjectID, std::make_unique<NPObjectMessageReceiver>(this, plugin, npObjectID, npObject).release());
 
     return npObjectID;
 }
index 4a24225..5821daa 100644 (file)
@@ -31,7 +31,6 @@
 #include "Module.h"
 #include "NPRuntimeUtilities.h"
 #include "NetscapeBrowserFuncs.h"
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebKit {
@@ -199,7 +198,7 @@ bool NetscapePluginModule::load()
 
 bool NetscapePluginModule::tryLoad()
 {
-    m_module = adoptPtr(new Module(m_pluginPath));
+    m_module = std::make_unique<Module>(m_pluginPath);
     if (!m_module->load())
         return false;
 
index f11eae3..33b7b85 100644 (file)
@@ -96,7 +96,7 @@ private:
     NPP_ShutdownProcPtr m_shutdownProcPtr;
     NPPluginFuncs m_pluginFuncs;
 
-    OwnPtr<Module> m_module;
+    std::unique_ptr<Module> m_module;
 };
     
 } // namespace WebKit
index 0a01b8e..7b4cc15 100644 (file)
@@ -106,7 +106,7 @@ public:
     bool resize(const WebCore::IntSize& size);
 
     // Create a graphics context that can be used to paint into the backing store.
-    PassOwnPtr<WebCore::GraphicsContext> createGraphicsContext();
+    std::unique_ptr<WebCore::GraphicsContext> createGraphicsContext();
 
     // Paint the backing store into the given context.
     void paint(WebCore::GraphicsContext&, const WebCore::IntPoint& destination, const WebCore::IntRect& source);
index d7616d2..9378b0a 100644 (file)
@@ -50,9 +50,10 @@ public:
 
         ASSERT(baseURL);
         baseURL->parseURLIfNecessary();
-        URL* absoluteURL = new URL(*baseURL->m_parsedURL.get(), relativeURL);
+        auto absoluteURL = std::make_unique<URL>(*baseURL->m_parsedURL.get(), relativeURL);
+        const String& absoluteURLString = absoluteURL->string();
 
-        return adoptRef(new WebURL(adoptPtr(absoluteURL), absoluteURL->string()));
+        return adoptRef(new WebURL(std::move(absoluteURL), absoluteURLString));
     }
 
     bool isNull() const { return m_string.isNull(); }
@@ -90,9 +91,9 @@ private:
     {
     }
 
-    WebURL(PassOwnPtr<WebCore::URL> parsedURL, const String& string)
+    WebURL(std::unique_ptr<WebCore::URL> parsedURL, const String& string)
         : m_string(string)
-        , m_parsedURL(parsedURL)
+        , m_parsedURL(std::move(parsedURL))
     {
     }
 
@@ -100,11 +101,11 @@ private:
     {
         if (m_parsedURL)
             return;
-        m_parsedURL = WTF::adoptPtr(new WebCore::URL(WebCore::URL(), m_string));
+        m_parsedURL = std::make_unique<WebCore::URL>(WebCore::URL(), m_string);
     }
 
     String m_string;
-    mutable OwnPtr<WebCore::URL> m_parsedURL;
+    mutable std::unique_ptr<WebCore::URL> m_parsedURL;
 };
 
 } // namespace WebKit
index 55804bb..bd1ccea 100644 (file)
@@ -46,7 +46,7 @@ static CGBitmapInfo bitmapInfo(ShareableBitmap::Flags flags)
     return info;
 }
 
-PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
+std::unique_ptr<GraphicsContext> ShareableBitmap::createGraphicsContext()
 {
     RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
 
@@ -59,7 +59,7 @@ PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
     CGContextTranslateCTM(bitmapContext.get(), 0, m_size.height());
     CGContextScaleCTM(bitmapContext.get(), 1, -1);
 
-    return adoptPtr(new GraphicsContext(bitmapContext.get()));
+    return std::make_unique<GraphicsContext>(bitmapContext.get());
 }
 
 void ShareableBitmap::paint(WebCore::GraphicsContext& context, const IntPoint& destination, const IntRect& source)
@@ -74,7 +74,7 @@ void ShareableBitmap::paint(WebCore::GraphicsContext& context, float scaleFactor
 
 RetainPtr<CGImageRef> ShareableBitmap::makeCGImageCopy()
 {
-    OwnPtr<GraphicsContext> graphicsContext = createGraphicsContext();
+    auto graphicsContext = createGraphicsContext();
     RetainPtr<CGImageRef> image = adoptCF(CGBitmapContextCreateImage(graphicsContext->platformContext()));
     return image;
 }
index 958a7af..ff5d8f1 100644 (file)
@@ -70,7 +70,7 @@ static uint64_t generateSecItemRequestID()
     return atomicIncrement(&uniqueSecItemRequestID);
 }
 
-static PassOwnPtr<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
+static std::unique_ptr<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
 {
     uint64_t requestID = generateSecItemRequestID();
     if (!sharedProcess->parentProcessConnection()->send(Messages::SecItemShimProxy::SecItemRequest(requestID, SecItemRequestData(requestType, query, attributesToMatch)), 0))
@@ -81,7 +81,7 @@ static PassOwnPtr<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Ty
 
 static OSStatus webSecItemCopyMatching(CFDictionaryRef query, CFTypeRef* result)
 {
-    OwnPtr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::CopyMatching, query);
+    std::unique_ptr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::CopyMatching, query);
     if (!response)
         return errSecInteractionNotAllowed;
 
@@ -91,7 +91,7 @@ static OSStatus webSecItemCopyMatching(CFDictionaryRef query, CFTypeRef* result)
 
 static OSStatus webSecItemAdd(CFDictionaryRef query, CFTypeRef* result)
 {
-    OwnPtr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::Add, query);
+    std::unique_ptr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::Add, query);
     if (!response)
         return errSecInteractionNotAllowed;
 
@@ -102,7 +102,7 @@ static OSStatus webSecItemAdd(CFDictionaryRef query, CFTypeRef* result)
 
 static OSStatus webSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
 {
-    OwnPtr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::Update, query, attributesToUpdate);
+    std::unique_ptr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::Update, query, attributesToUpdate);
     if (!response)
         return errSecInteractionNotAllowed;
     
@@ -111,7 +111,7 @@ static OSStatus webSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attribut
 
 static OSStatus webSecItemDelete(CFDictionaryRef query)
 {
-    OwnPtr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::Delete, query);
+    std::unique_ptr<SecItemResponseData> response = sendSecItemRequest(SecItemRequestData::Delete, query);
     if (!response)
         return errSecInteractionNotAllowed;
     
@@ -120,7 +120,7 @@ static OSStatus webSecItemDelete(CFDictionaryRef query)
 
 void SecItemShim::secItemResponse(uint64_t requestID, const SecItemResponseData& response)
 {
-    responseMap().didReceiveResponse(requestID, adoptPtr(new SecItemResponseData(response)));
+    responseMap().didReceiveResponse(requestID, std::make_unique<SecItemResponseData>(response));
 }
 
 void SecItemShim::initialize(ChildProcess* process)
index 1631493..8e47801 100644 (file)
@@ -29,7 +29,6 @@
 #import "WebKitSystemInterface.h"
 #import <WebCore/RunLoop.h>
 #import <wtf/Noncopyable.h>
-#import <wtf/PassOwnPtr.h>
 #import <wtf/RefPtr.h>
 #import <wtf/RetainPtr.h>
 
index 932c74b..323b592 100644 (file)
@@ -42,15 +42,13 @@ class FindIndicatorWindow;
 
 class PageClientImpl FINAL : public PageClient {
 public:
-    static PassOwnPtr<PageClientImpl> create(WKView*);
+    explicit PageClientImpl(WKView*);
     virtual ~PageClientImpl();
     
     void viewWillMoveToAnotherWindow();
 
 private:
-    explicit PageClientImpl(WKView*);
-
-    virtual OwnPtr<DrawingAreaProxy> createDrawingAreaProxy();
+    virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy();
     virtual void setViewNeedsDisplay(const WebCore::IntRect&);
     virtual void displayView();
     virtual bool canScrollView();
index 6e71d11..b6e8f1a 100644 (file)
@@ -52,7 +52,6 @@
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/SharedBuffer.h>
-#import <wtf/PassOwnPtr.h>
 #import <wtf/text/CString.h>
 #import <wtf/text/WTFString.h>
 #import <WebKitSystemInterface.h>
@@ -120,11 +119,6 @@ using namespace WebKit;
 
 namespace WebKit {
 
-PassOwnPtr<PageClientImpl> PageClientImpl::create(WKView* wkView)
-{
-    return adoptPtr(new PageClientImpl(wkView));
-}
-
 PageClientImpl::PageClientImpl(WKView* wkView)
     : m_wkView(wkView)
     , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
@@ -138,7 +132,7 @@ PageClientImpl::~PageClientImpl()
 {
 }
 
-OwnPtr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
+std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
 {
     return [m_wkView _createDrawingAreaProxy];
 }
index 963f56c..bbc9a4f 100644 (file)
@@ -156,7 +156,7 @@ struct WKViewInterpretKeyEventsParameters {
 
 @interface WKViewData : NSObject {
 @public
-    OwnPtr<PageClientImpl> _pageClient;
+    std::unique_ptr<PageClientImpl> _pageClient;
     RefPtr<WebPageProxy> _page;
     
     // Cache of the associated WKBrowsingContextController.
@@ -2365,16 +2365,16 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
 
 @implementation WKView (Internal)
 
-- (OwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy
+- (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy
 {
     if ([self _shouldUseTiledDrawingArea]) {
         if (getenv("WK_USE_REMOTE_LAYER_TREE_DRAWING_AREA"))
-            return RemoteLayerTreeDrawingAreaProxy::create(_data->_page.get());
+            return std::make_unique<RemoteLayerTreeDrawingAreaProxy>(_data->_page.get());
 
-        return createOwned<TiledCoreAnimationDrawingAreaProxy>(_data->_page.get());
+        return std::make_unique<TiledCoreAnimationDrawingAreaProxy>(_data->_page.get());
     }
 
-    return createOwned<DrawingAreaProxyImpl>(_data->_page.get());
+    return std::make_unique<DrawingAreaProxyImpl>(_data->_page.get());
 }
 
 - (BOOL)_isFocused
@@ -3063,7 +3063,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
 
     _data = [[WKViewData alloc] init];
 
-    _data->_pageClient = PageClientImpl::create(self);
+    _data->_pageClient = std::make_unique<PageClientImpl>(self);
     _data->_page = toImpl(contextRef)->createWebPage(_data->_pageClient.get(), toImpl(pageGroupRef), toImpl(relatedPage));
     _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
     _data->_page->initializeWebPage();
index 67aee1c..8b474f4 100644 (file)
@@ -50,7 +50,7 @@ namespace WebKit {
 @class WKFullScreenWindowController;
 
 @interface WKView (Internal)
-- (OwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
+- (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
 - (BOOL)_isFocused;
 - (void)_processDidCrash;
 - (void)_pageClosed;
index 30ec8e6..aae2985 100644 (file)
@@ -33,11 +33,6 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size, float deviceScaleFactor, WebPageProxy* webPageProxy)
-{
-    return adoptPtr(new BackingStore(size, deviceScaleFactor, webPageProxy));
-}
-
 BackingStore::BackingStore(const IntSize& size, float deviceScaleFactor, WebPageProxy* webPageProxy)
     : m_size(size)
     , m_deviceScaleFactor(deviceScaleFactor)
index 7c2613f..d2a3bd4 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <WebCore/IntRect.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
 
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
@@ -54,7 +53,7 @@ class BackingStore {
     WTF_MAKE_NONCOPYABLE(BackingStore);
 
 public:
-    static PassOwnPtr<BackingStore> create(const WebCore::IntSize&, float deviceScaleFactor, WebPageProxy*);
+    BackingStore(const WebCore::IntSize&, float deviceScaleFactor, WebPageProxy*);
     ~BackingStore();
 
     const WebCore::IntSize& size() const { return m_size; }
@@ -72,8 +71,6 @@ public:
     void incorporateUpdate(const UpdateInfo&);
 
 private:
-    BackingStore(const WebCore::IntSize&, float deviceScaleFactor, WebPageProxy*);
-
     void incorporateUpdate(ShareableBitmap*, const UpdateInfo&);
     void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
 
index 1c7ab40..d89bcc5 100644 (file)
@@ -269,7 +269,7 @@ void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
         return;
 
     if (!m_backingStore)
-        m_backingStore = BackingStore::create(updateInfo.viewSize, updateInfo.deviceScaleFactor, m_webPageProxy);
+        m_backingStore = std::make_unique<BackingStore>(updateInfo.viewSize, updateInfo.deviceScaleFactor, m_webPageProxy);
 
     m_backingStore->incorporateUpdate(updateInfo);
 
index b91a2bc..0e8e2ac 100644 (file)
@@ -31,7 +31,6 @@
 #include "LayerTreeContext.h"
 #include <WebCore/RunLoop.h>
 #include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 class Region;
@@ -114,7 +113,7 @@ private:
     bool m_hasReceivedFirstUpdate;
 
     bool m_isBackingStoreDiscardable;
-    OwnPtr<BackingStore> m_backingStore;
+    std::unique_ptr<BackingStore> m_backingStore;
 
     WebCore::RunLoop::Timer<DrawingAreaProxyImpl> m_discardBackingStoreTimer;
 };
index bca9ac3..7a1eb20 100644 (file)
@@ -30,7 +30,6 @@
 #include <mach-o/loader.h>
 #include <mach-o/swap.h>
 #include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebKit {
index eead146..3c56d6b 100644 (file)
@@ -77,7 +77,7 @@ public:
     virtual ~PageClient() { }
 
     // Create a new drawing area proxy for the given page.
-    virtual OwnPtr<DrawingAreaProxy> createDrawingAreaProxy() = 0;
+    virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() = 0;
 
     // Tell the view to invalidate the given rect. The rect is in view coordinates.
     virtual void setViewNeedsDisplay(const WebCore::IntRect&) = 0;
index 379eadc..99e34af 100644 (file)
@@ -1068,7 +1068,7 @@ private:
     WebPageContextMenuClient m_contextMenuClient;
 #endif
 
-    OwnPtr<DrawingAreaProxy> m_drawingArea;
+    std::unique_ptr<DrawingAreaProxy> m_drawingArea;
     RefPtr<WebProcessProxy> m_process;
     RefPtr<WebPageGroup> m_pageGroup;
     RefPtr<WebFrameProxy> m_mainFrame;
index 3a82af5..30ab229 100644 (file)
@@ -33,12 +33,10 @@ namespace WebKit {
 
 class RemoteLayerTreeDrawingAreaProxy : public DrawingAreaProxy {
 public:
-    static PassOwnPtr<RemoteLayerTreeDrawingAreaProxy> create(WebPageProxy*);
+    explicit RemoteLayerTreeDrawingAreaProxy(WebPageProxy*);
     virtual ~RemoteLayerTreeDrawingAreaProxy();
 
 private:
-    explicit RemoteLayerTreeDrawingAreaProxy(WebPageProxy*);
-
     virtual void sizeDidChange() OVERRIDE;
     virtual void deviceScaleFactorDidChange() OVERRIDE;
 
index 277e69d..b69eaaa 100644 (file)
 
 namespace WebKit {
 
-PassOwnPtr<RemoteLayerTreeDrawingAreaProxy> RemoteLayerTreeDrawingAreaProxy::create(WebPageProxy* webPageProxy)
-{
-    return adoptPtr(new RemoteLayerTreeDrawingAreaProxy(webPageProxy));
-}
-
 RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy(WebPageProxy* webPageProxy)
     : DrawingAreaProxy(DrawingAreaTypeRemoteLayerTree, webPageProxy)
     , m_remoteLayerTreeHost(webPageProxy)
index 745ba25..5f3f1a2 100644 (file)
@@ -27,7 +27,6 @@
 #define TiledCoreAnimationDrawingAreaProxy_h
 
 #include "DrawingAreaProxy.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebKit {
 
index 93fc010..ab0ea4d 100644 (file)
@@ -39,11 +39,11 @@ using namespace WebCore;
 
 namespace WebKit {
 
-void BlobRegistryProxy::registerBlobURL(const URL& url, PassOwnPtr<BlobData> blobData)
+void BlobRegistryProxy::registerBlobURL(const URL& url, std::unique_ptr<BlobData> blobData)
 {
     ASSERT(WebProcess::shared().usesNetworkProcess());
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, BlobRegistrationData(blobData)), 0);
+    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, BlobRegistrationData(std::move(blobData))), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
index c151c11..aa3a8c5 100644 (file)
@@ -34,9 +34,9 @@ namespace WebKit {
 
 class BlobRegistryProxy : public WebCore::BlobRegistry {
 public:
-    virtual void registerBlobURL(const WebCore::URL&, PassOwnPtr<WebCore::BlobData>);
-    virtual void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL);
-    virtual void unregisterBlobURL(const WebCore::URL&);
+    virtual void registerBlobURL(const WebCore::URL&, std::unique_ptr<WebCore::BlobData>) OVERRIDE;
+    virtual void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) OVERRIDE;
+    virtual void unregisterBlobURL(const WebCore::URL&) OVERRIDE;
 };
 
 }
index de48100..3b6c80e 100644 (file)
@@ -30,7 +30,6 @@
 #include "WKAPICast.h"
 #include "WKBundleAPICast.h"
 #include <WebCore/GraphicsContext.h>
-#include <wtf/PassOwnPtr.h>
 
 using namespace WebCore;
 using namespace WebKit;
index 3b3169e..309e308 100644 (file)
@@ -36,12 +36,6 @@ using namespace WebKit;
 
 class PageBannerClientImpl : public PageBanner::Client {
 public:
-    static PassOwnPtr<PageBannerClientImpl> create(WKBundlePageBannerClient* client)
-    {
-        return adoptPtr(new PageBannerClientImpl(client));
-    }
-
-private:
     explicit PageBannerClientImpl(WKBundlePageBannerClient* client)
         : m_client()
     {
@@ -49,6 +43,7 @@ private:
             m_client = *client;
     }
 
+private:
     // PageBanner::Client.
     virtual void pageBannerDestroyed(PageBanner*)
     {
@@ -98,8 +93,8 @@ WKBundlePageBannerRef WKBundlePageBannerCreateBannerWithCALayer(CALayer *layer,
     if (wkClient && wkClient->version)
         return 0;
 
-    OwnPtr<PageBannerClientImpl> clientImpl = PageBannerClientImpl::create(wkClient);
-    return toAPI(PageBanner::create(layer, height, clientImpl.leakPtr()).leakRef());
+    auto clientImpl = std::make_unique<PageBannerClientImpl>(wkClient);
+    return toAPI(PageBanner::create(layer, height, clientImpl.release()).leakRef());
 }
 
 CALayer * WKBundlePageBannerGetLayer(WKBundlePageBannerRef pageBanner)
index 7b86849..69176c4 100644 (file)
@@ -134,7 +134,7 @@ static PassRefPtr<WebImage> imageForRect(FrameView* frameView, const IntRect& re
     if (!snapshot->bitmap())
         return 0;
 
-    OwnPtr<GraphicsContext> graphicsContext = snapshot->bitmap()->createGraphicsContext();
+    auto graphicsContext = snapshot->bitmap()->createGraphicsContext();
     graphicsContext->clearRect(IntRect(IntPoint(), bitmapSize));
     graphicsContext->applyDeviceScaleFactor(scaleFactor);
     graphicsContext->translate(-rect.x(), -rect.y());
index c4ba835..a9e0818 100644 (file)
@@ -319,11 +319,6 @@ void NetscapePlugin::handlePluginThreadAsyncCall(void (*function)(void*), void*
     function(userData);
 }
 
-PassOwnPtr<NetscapePlugin::Timer> NetscapePlugin::Timer::create(NetscapePlugin* netscapePlugin, unsigned timerID, unsigned interval, bool repeat, TimerFunc timerFunc)
-{
-    return adoptPtr(new Timer(netscapePlugin, timerID, interval, repeat, timerFunc));
-}
-
 NetscapePlugin::Timer::Timer(NetscapePlugin* netscapePlugin, unsigned timerID, unsigned interval, bool repeat, TimerFunc timerFunc)
     : m_netscapePlugin(netscapePlugin)
     , m_timerID(timerID)
@@ -369,18 +364,18 @@ uint32_t NetscapePlugin::scheduleTimer(unsigned interval, bool repeat, void (*ti
     // FIXME: Handle wrapping around.
     unsigned timerID = ++m_nextTimerID;
 
-    OwnPtr<Timer> timer = Timer::create(this, timerID, interval, repeat, timerFunc);
+    auto timer = std::make_unique<Timer>(this, timerID, interval, repeat, timerFunc);
     
     // FIXME: Based on the plug-in visibility, figure out if we should throttle the timer, or if we should start it at all.
     timer->start();
-    m_timers.set(timerID, timer.release());
+    m_timers.set(timerID, std::move(timer));
 
     return timerID;
 }
 
 void NetscapePlugin::unscheduleTimer(unsigned timerID)
 {
-    if (OwnPtr<Timer> timer = m_timers.take(timerID))
+    if (auto timer = m_timers.take(timerID))
         timer->stop();
 }
 
@@ -702,7 +697,7 @@ PassRefPtr<ShareableBitmap> NetscapePlugin::snapshot()
     backingStoreSize.scale(contentsScaleFactor());
 
     RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha);
-    OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext();
+    auto context = bitmap->createGraphicsContext();
 
     // FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI
     // which we currently don't have initiated in the plug-in process.
index 4c137aa..b649a20 100644 (file)
@@ -313,15 +313,13 @@ private:
     public:
         typedef void (*TimerFunc)(NPP, uint32_t timerID);
 
-        static PassOwnPtr<Timer> create(NetscapePlugin*, unsigned timerID, unsigned interval, bool repeat, TimerFunc);
+        Timer(NetscapePlugin*, unsigned timerID, unsigned interval, bool repeat, TimerFunc);
         ~Timer();
 
         void start();
         void stop();
 
     private:
-        Timer(NetscapePlugin*, unsigned timerID, unsigned interval, bool repeat, TimerFunc);
-
         void timerFired();
 
         // This is a weak pointer since Timer objects are destroyed before the NetscapePlugin object itself is destroyed.
@@ -334,7 +332,7 @@ private:
 
         WebCore::RunLoop::Timer<Timer> m_timer;
     };
-    typedef HashMap<unsigned, OwnPtr<Timer>> TimerMap;
+    typedef HashMap<unsigned, std::unique_ptr<Timer>> TimerMap;
     TimerMap m_timers;
     unsigned m_nextTimerID;
 
index b19c12b..2193ec4 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "NetscapePlugin.h"
 #include <utility>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
 
 using namespace WebCore;
index b43700e..283f3c8 100644 (file)
@@ -1132,7 +1132,7 @@ PassRefPtr<ShareableBitmap> PDFPlugin::snapshot()
     backingStoreSize.scale(contentsScaleFactor);
 
     RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha);
-    OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext();
+    auto context = bitmap->createGraphicsContext();
 
     context->scale(FloatSize(contentsScaleFactor, -contentsScaleFactor));
     context->translate(0, -size().height());
index 8a8f272..67d92a0 100644 (file)
@@ -211,7 +211,7 @@ void PluginProxy::paint(GraphicsContext* graphicsContext, const IntRect& dirtyRe
         m_connection->connection()->sendSync(Messages::PluginControllerProxy::PaintEntirePlugin(), Messages::PluginControllerProxy::PaintEntirePlugin::Reply(), m_pluginInstanceID);
     
         // Blit the plug-in backing store into our own backing store.
-        OwnPtr<WebCore::GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
+        auto graphicsContext = m_backingStore->createGraphicsContext();
         graphicsContext->applyDeviceScaleFactor(contentsScaleFactor());
         graphicsContext->setCompositeOperation(CompositeCopy);
 
@@ -692,7 +692,7 @@ void PluginProxy::update(const IntRect& paintedRect)
 
     if (m_backingStore) {
         // Blit the plug-in backing store into our own backing store.
-        OwnPtr<GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
+        auto graphicsContext = m_backingStore->createGraphicsContext();
         graphicsContext->applyDeviceScaleFactor(contentsScaleFactor());
         graphicsContext->setCompositeOperation(CompositeCopy);
         m_pluginBackingStore->paint(*graphicsContext, contentsScaleFactor(), paintedRect.location(), paintedRect);
index 1478757..94ccd62 100644 (file)
@@ -64,7 +64,7 @@ static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const In
     if (!bitmap)
         return nullptr;
 
-    OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
+    auto graphicsContext = bitmap->createGraphicsContext();
 
     RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext];
 
index 458b907..9eff462 100644 (file)
 
 namespace WebKit {
 
-PassOwnPtr<DrawingArea> DrawingArea::create(WebPage* webPage, const WebPageCreationParameters& parameters)
+std::unique_ptr<DrawingArea> DrawingArea::create(WebPage* webPage, const WebPageCreationParameters& parameters)
 {
     switch (parameters.drawingAreaType) {
     case DrawingAreaTypeImpl:
-        return DrawingAreaImpl::create(webPage, parameters);
+        return std::make_unique<DrawingAreaImpl>(webPage, parameters);
 #if PLATFORM(MAC)
     case DrawingAreaTypeTiledCoreAnimation:
-        return TiledCoreAnimationDrawingArea::create(webPage, parameters);
+        return std::make_unique<TiledCoreAnimationDrawingArea>(webPage, parameters);
     case DrawingAreaTypeRemoteLayerTree:
-        return RemoteLayerTreeDrawingArea::create(webPage, parameters);
+        return std::make_unique<RemoteLayerTreeDrawingArea>(webPage, parameters);
 #endif
     }
 
index 2e8c8df..f039331 100644 (file)
@@ -31,7 +31,6 @@
 #include <WebCore/IntRect.h>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace CoreIPC {
 class Connection;
@@ -57,7 +56,7 @@ class DrawingArea {
     WTF_MAKE_NONCOPYABLE(DrawingArea);
 
 public:
-    static PassOwnPtr<DrawingArea> create(WebPage*, const WebPageCreationParameters&);
+    static std::unique_ptr<DrawingArea> create(WebPage*, const WebPageCreationParameters&);
     virtual ~DrawingArea();
     
     void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
index 5629588..d025023 100644 (file)
@@ -41,11 +41,6 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<DrawingAreaImpl> DrawingAreaImpl::create(WebPage* webPage, const WebPageCreationParameters& parameters)
-{
-    return adoptPtr(new DrawingAreaImpl(webPage, parameters));
-}
-
 DrawingAreaImpl::~DrawingAreaImpl()
 {
     if (m_layerTreeHost)
@@ -688,7 +683,7 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
     m_scrollRect = IntRect();
     m_scrollOffset = IntSize();
 
-    OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
+    auto graphicsContext = bitmap->createGraphicsContext();
     graphicsContext->applyDeviceScaleFactor(deviceScaleFactor);
     
     updateInfo.updateRectBounds = bounds;
index 3b03c7f..058fac8 100644 (file)
@@ -42,14 +42,12 @@ class UpdateInfo;
 
 class DrawingAreaImpl : public DrawingArea {
 public:
-    static PassOwnPtr<DrawingAreaImpl> create(WebPage*, const WebPageCreationParameters&);
+    DrawingAreaImpl(WebPage*, const WebPageCreationParameters&);
     virtual ~DrawingAreaImpl();
 
     void layerHostDidFlushLayers();
 
 private:
-    DrawingAreaImpl(WebPage*, const WebPageCreationParameters&);
-
     // DrawingArea
     virtual void setNeedsDisplay() OVERRIDE;
     virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE;
index 8823b29..ccd03cc 100644 (file)
@@ -215,7 +215,7 @@ bool FindController::getFindIndicatorBitmapAndRect(Frame* frame, ShareableBitmap
     if (!findIndicatorTextBackingStore)
         return false;
 
-    OwnPtr<GraphicsContext> graphicsContext = findIndicatorTextBackingStore->createGraphicsContext();
+    auto graphicsContext = findIndicatorTextBackingStore->createGraphicsContext();
     graphicsContext->scale(FloatSize(m_webPage->corePage()->deviceScaleFactor(), m_webPage->corePage()->deviceScaleFactor()));
 
     IntRect paintRect = selectionRect;
index 801ede7..8e5a014 100644 (file)
@@ -104,7 +104,7 @@ static uint64_t generateListenerID()
 
 PassRefPtr<WebFrame> WebFrame::createWithCoreMainFrame(WebPage* page, WebCore::Frame* coreFrame)
 {
-    RefPtr<WebFrame> frame = create(adoptPtr(static_cast<WebFrameLoaderClient*>(&coreFrame->loader().client())));
+    RefPtr<WebFrame> frame = create(std::unique_ptr<WebFrameLoaderClient>(static_cast<WebFrameLoaderClient*>(&coreFrame->loader().client())));
     page->send(Messages::WebPageProxy::DidCreateMainFrame(frame->frameID()));
 
     frame->m_coreFrame = coreFrame;
@@ -115,7 +115,7 @@ PassRefPtr<WebFrame> WebFrame::createWithCoreMainFrame(WebPage* page, WebCore::F
 
 PassRefPtr<WebFrame> WebFrame::createSubframe(WebPage* page, const String& frameName, HTMLFrameOwnerElement* ownerElement)
 {
-    RefPtr<WebFrame> frame = create(adoptPtr(new WebFrameLoaderClient));
+    RefPtr<WebFrame> frame = create(std::make_unique<WebFrameLoaderClient>());
     page->send(Messages::WebPageProxy::DidCreateSubframe(frame->frameID()));
 
     RefPtr<Frame> coreFrame = Frame::create(page->corePage(), ownerElement, frame->m_frameLoaderClient.get());
@@ -129,9 +129,9 @@ PassRefPtr<WebFrame> WebFrame::createSubframe(WebPage* page, const String& frame
     return frame.release();
 }
 
-PassRefPtr<WebFrame> WebFrame::create(PassOwnPtr<WebFrameLoaderClient> frameLoaderClient)
+PassRefPtr<WebFrame> WebFrame::create(std::unique_ptr<WebFrameLoaderClient> frameLoaderClient)
 {
-    RefPtr<WebFrame> frame = adoptRef(new WebFrame(frameLoaderClient));
+    RefPtr<WebFrame> frame = adoptRef(new WebFrame(std::move(frameLoaderClient)));
 
     // Add explict ref() that will be balanced in WebFrameLoaderClient::frameLoaderDestroyed().
     frame->ref();
@@ -139,12 +139,12 @@ PassRefPtr<WebFrame> WebFrame::create(PassOwnPtr<WebFrameLoaderClient> frameLoad
     return frame.release();
 }
 
-WebFrame::WebFrame(PassOwnPtr<WebFrameLoaderClient> frameLoaderClient)
+WebFrame::WebFrame(std::unique_ptr<WebFrameLoaderClient> frameLoaderClient)
     : m_coreFrame(0)
     , m_policyListenerID(0)
     , m_policyFunction(0)
     , m_policyDownloadID(0)
-    , m_frameLoaderClient(frameLoaderClient)
+    , m_frameLoaderClient(std::move(frameLoaderClient))
     , m_loadListener(0)
     , m_frameID(generateFrameID())
 {
index 68762ff..957f0b5 100644 (file)
@@ -141,8 +141,8 @@ public:
 #endif
 
 private:
-    static PassRefPtr<WebFrame> create(PassOwnPtr<WebFrameLoaderClient>);
-    WebFrame(PassOwnPtr<WebFrameLoaderClient>);
+    static PassRefPtr<WebFrame> create(std::unique_ptr<WebFrameLoaderClient>);
+    WebFrame(std::unique_ptr<WebFrameLoaderClient>);
 
     WebCore::Frame* m_coreFrame;
 
@@ -150,7 +150,7 @@ private:
     WebCore::FramePolicyFunction m_policyFunction;
     uint64_t m_policyDownloadID;
 
-    OwnPtr<WebFrameLoaderClient> m_frameLoaderClient;
+    std::unique_ptr<WebFrameLoaderClient> m_frameLoaderClient;
     LoadListener* m_loadListener;
     
     uint64_t m_frameID;
index c7466c6..4cf0898 100644 (file)
@@ -1515,7 +1515,7 @@ PassRefPtr<WebImage> WebPage::scaledSnapshotWithOptions(const IntRect& rect, dou
     if (!snapshot->bitmap())
         return 0;
 
-    OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->bitmap()->createGraphicsContext();
+    auto graphicsContext = snapshot->bitmap()->createGraphicsContext();
 
     graphicsContext->clearRect(IntRect(IntPoint(), bitmapSize));
 
@@ -3448,7 +3448,7 @@ void WebPage::drawRectToImage(uint64_t frameID, const PrintInfo& printInfo, cons
 #endif
 
         RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(imageSize, ShareableBitmap::SupportsAlpha);
-        OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
+        auto graphicsContext = bitmap->createGraphicsContext();
 
         float printingScale = static_cast<float>(imageSize.width()) / rect.width();
         graphicsContext->scale(FloatSize(printingScale, printingScale));
index b0b673f..8cdafc4 100644 (file)
@@ -857,7 +857,7 @@ private:
     String m_userAgent;
 
     WebCore::IntSize m_viewSize;
-    OwnPtr<DrawingArea> m_drawingArea;
+    std::unique_ptr<DrawingArea> m_drawingArea;
 
     HashSet<PluginView*> m_pluginViews;
     bool m_hasSeenPlugin;
index 46ba2d7..a62eebc 100644 (file)
@@ -97,7 +97,7 @@ private:
     typedef HashMap<PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> PageOverlayLayerMap;
     PageOverlayLayerMap m_pageOverlayLayers;
 
-    OwnPtr<LayerHostingContext> m_layerHostingContext;
+    std::unique_ptr<LayerHostingContext> m_layerHostingContext;
     WebCore::LayerFlushScheduler m_layerFlushScheduler;
 };
 
index 77a0954..4dd95b3 100644 (file)
@@ -38,7 +38,7 @@ class WebPage;
 
 class RemoteLayerTreeContext : public WebCore::GraphicsLayerFactory {
 public:
-    static PassOwnPtr<RemoteLayerTreeContext> create(WebPage*);
+    explicit RemoteLayerTreeContext(WebPage*);
     ~RemoteLayerTreeContext();
 
     void setRootLayer(WebCore::GraphicsLayer*);
@@ -49,8 +49,6 @@ public:
     RemoteLayerTreeTransaction& currentTransaction();
 
 private:
-    explicit RemoteLayerTreeContext(WebPage*);
-
     // WebCore::GraphicsLayerFactory
     virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
 
index 8993dcb..abf1a66 100644 (file)
 #import <WebCore/FrameView.h>
 #import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
-#import <wtf/PassOwnPtr.h>
 #import <wtf/TemporaryChange.h>
 
 using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<RemoteLayerTreeContext> RemoteLayerTreeContext::create(WebPage* webPage)
-{
-    return adoptPtr(new RemoteLayerTreeContext(webPage));
-}
-
 RemoteLayerTreeContext::RemoteLayerTreeContext(WebPage* webPage)
     : m_webPage(webPage)
     , m_layerFlushTimer(this, &RemoteLayerTreeContext::layerFlushTimerFired)
index e49d66c..c6863ce 100644 (file)
@@ -27,7 +27,6 @@
 #define RemoteLayerTreeDrawingArea_h
 
 #include "DrawingArea.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebKit {
 
@@ -35,12 +34,10 @@ class RemoteLayerTreeContext;
 
 class RemoteLayerTreeDrawingArea : public DrawingArea {
 public:
-    static PassOwnPtr<RemoteLayerTreeDrawingArea> create(WebPage*, const WebPageCreationParameters&);
+    RemoteLayerTreeDrawingArea(WebPage*, const WebPageCreationParameters&);
     virtual ~RemoteLayerTreeDrawingArea();
 
 private:
-    RemoteLayerTreeDrawingArea(WebPage*, const WebPageCreationParameters&);
-
     // DrawingArea
     virtual void setNeedsDisplay() OVERRIDE;
     virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE;
@@ -50,7 +47,7 @@ private:
     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) OVERRIDE;
     virtual void scheduleCompositingLayerFlush() OVERRIDE;
 
-    OwnPtr<RemoteLayerTreeContext> m_RemoteLayerTreeContext;
+    std::unique_ptr<RemoteLayerTreeContext> m_RemoteLayerTreeContext;
 };
 
 } // namespace WebKit
index ecb983c..0ca0997 100644 (file)
@@ -32,14 +32,9 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<RemoteLayerTreeDrawingArea> RemoteLayerTreeDrawingArea::create(WebPage* webPage, const WebPageCreationParameters& parameters)
-{
-    return adoptPtr(new RemoteLayerTreeDrawingArea(webPage, parameters));
-}
-
 RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea(WebPage* webPage, const WebPageCreationParameters&)
     : DrawingArea(DrawingAreaTypeRemoteLayerTree, webPage)
-    , m_RemoteLayerTreeContext(RemoteLayerTreeContext::create(webPage))
+    , m_RemoteLayerTreeContext(std::make_unique<RemoteLayerTreeContext>(webPage))
 {
 }
 
index 038b32b..7efca6b 100644 (file)
@@ -50,12 +50,10 @@ class LayerHostingContext;
 
 class TiledCoreAnimationDrawingArea : public DrawingArea, WebCore::GraphicsLayerClient, WebCore::LayerFlushSchedulerClient {
 public:
-    static PassOwnPtr<TiledCoreAnimationDrawingArea> create(WebPage*, const WebPageCreationParameters&);
+    TiledCoreAnimationDrawingArea(WebPage*, const WebPageCreationParameters&);
     virtual ~TiledCoreAnimationDrawingArea();
 
 private:
-    TiledCoreAnimationDrawingArea(WebPage*, const WebPageCreationParameters&);
-
     // DrawingArea
     virtual void setNeedsDisplay() OVERRIDE;
     virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE;
@@ -120,7 +118,7 @@ private:
     bool m_layerTreeStateIsFrozen;
     WebCore::LayerFlushScheduler m_layerFlushScheduler;
 
-    OwnPtr<LayerHostingContext> m_layerHostingContext;
+    std::unique_ptr<LayerHostingContext> m_layerHostingContext;
 
     RetainPtr<CALayer> m_rootLayer;
     RetainPtr<CALayer> m_pendingRootCompositingLayer;
index a15fb83..bfb93f7 100644 (file)
@@ -60,11 +60,6 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<TiledCoreAnimationDrawingArea> TiledCoreAnimationDrawingArea::create(WebPage* webPage, const WebPageCreationParameters& parameters)
-{
-    return adoptPtr(new TiledCoreAnimationDrawingArea(webPage, parameters));
-}
-
 TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage* webPage, const WebPageCreationParameters& parameters)
     : DrawingArea(DrawingAreaTypeTiledCoreAnimation, webPage)
     , m_layerTreeStateIsFrozen(false)