Remove createOwned
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Oct 2013 18:59:00 +0000 (18:59 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Oct 2013 18:59:00 +0000 (18:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122388

Reviewed by Darin Adler.

Source/JavaScriptCore:

* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::save):

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::createRenderTree):
(WebCore::Document::destroyRenderTree):
* dom/Document.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):
* page/Frame.h:
* page/animation/AnimationController.cpp:
(WebCore::AnimationController::AnimationController):
* page/animation/AnimationController.h:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
(WebCore::AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC):
(WebCore::AudioTrackPrivateAVFObjC::setPlayerItemTrack):
* platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
(WebCore::VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC):
(WebCore::VideoTrackPrivateAVFObjC::setPlayerItemTrack):
* platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* rendering/svg/RenderSVGResourceMasker.h:

Source/WebKit2:

* UIProcess/API/mac/WKView.mm:
(-[WKView _setFindIndicator:fadeOut:animate:]):
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayCreate):

Source/WTF:

Since we're going with std::unique_ptr instead of OwnPtr, there's no need for makeOwned to exist.
Get rid of it and replace it with calls to std::make_unique.

* wtf/FilePrintStream.cpp:
(WTF::FilePrintStream::open):
* wtf/FilePrintStream.h:
* wtf/HashTable.h:
(WTF::::HashTable):
* wtf/ListHashSet.h:
(WTF::::ListHashSet):
* wtf/OwnPtr.h:
* wtf/Threading.cpp:
(WTF::compatEntryPoint):
(WTF::createThread):
* wtf/ThreadingPthreads.cpp:
(WTF::wtfThreadEntryPoint):
(WTF::createThreadInternal):
* wtf/unicode/Collator.h:
* wtf/unicode/CollatorDefault.cpp:
(WTF::Collator::userDefault):
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::userDefault):

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

34 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/FilePrintStream.cpp
Source/WTF/wtf/FilePrintStream.h
Source/WTF/wtf/HashTable.h
Source/WTF/wtf/ListHashSet.h
Source/WTF/wtf/OwnPtr.h
Source/WTF/wtf/Threading.cpp
Source/WTF/wtf/ThreadingPthreads.cpp
Source/WTF/wtf/unicode/Collator.h
Source/WTF/wtf/unicode/CollatorDefault.cpp
Source/WTF/wtf/unicode/icu/CollatorICU.cpp
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/page/animation/AnimationController.h
Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h
Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp
Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.h
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.h
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp

index 2f90973..9aed4b5 100644 (file)
@@ -1,3 +1,13 @@
+2013-10-05  Anders Carlsson  <andersca@apple.com>
+
+        Remove createOwned
+        https://bugs.webkit.org/show_bug.cgi?id=122388
+
+        Reviewed by Darin Adler.
+
+        * profiler/ProfilerDatabase.cpp:
+        (JSC::Profiler::Database::save):
+
 2013-10-05  Darin Adler  <darin@apple.com>
 
         Cut down on use of String::number
index 2e639fc..4c5e055 100644 (file)
@@ -117,7 +117,7 @@ String Database::toJSON() const
 
 bool Database::save(const char* filename) const
 {
-    OwnPtr<FilePrintStream> out = FilePrintStream::open(filename, "w");
+    auto out = FilePrintStream::open(filename, "w");
     if (!out)
         return false;
     
index 68634cf..6d2950f 100644 (file)
@@ -1,3 +1,33 @@
+2013-10-05  Anders Carlsson  <andersca@apple.com>
+
+        Remove createOwned
+        https://bugs.webkit.org/show_bug.cgi?id=122388
+
+        Reviewed by Darin Adler.
+
+        Since we're going with std::unique_ptr instead of OwnPtr, there's no need for makeOwned to exist.
+        Get rid of it and replace it with calls to std::make_unique.
+
+        * wtf/FilePrintStream.cpp:
+        (WTF::FilePrintStream::open):
+        * wtf/FilePrintStream.h:
+        * wtf/HashTable.h:
+        (WTF::::HashTable):
+        * wtf/ListHashSet.h:
+        (WTF::::ListHashSet):
+        * wtf/OwnPtr.h:
+        * wtf/Threading.cpp:
+        (WTF::compatEntryPoint):
+        (WTF::createThread):
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::wtfThreadEntryPoint):
+        (WTF::createThreadInternal):
+        * wtf/unicode/Collator.h:
+        * wtf/unicode/CollatorDefault.cpp:
+        (WTF::Collator::userDefault):
+        * wtf/unicode/icu/CollatorICU.cpp:
+        (WTF::Collator::userDefault):
+
 2013-10-05  Darin Adler  <darin@apple.com>
 
         Remove COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) since it's required now
index b27e8bd..28714ec 100644 (file)
@@ -41,13 +41,13 @@ FilePrintStream::~FilePrintStream()
     fclose(m_file);
 }
 
-OwnPtr<FilePrintStream> FilePrintStream::open(const char* filename, const char* mode)
+std::unique_ptr<FilePrintStream> FilePrintStream::open(const char* filename, const char* mode)
 {
     FILE* file = fopen(filename, mode);
     if (!file)
         return nullptr;
 
-    return createOwned<FilePrintStream>(file);
+    return std::make_unique<FilePrintStream>(file);
 }
 
 void FilePrintStream::vprintf(const char* format, va_list argList)
index 4c07548..0692588 100644 (file)
@@ -42,7 +42,7 @@ public:
     FilePrintStream(FILE*, AdoptionMode = Adopt);
     virtual ~FilePrintStream();
     
-    WTF_EXPORT_PRIVATE static OwnPtr<FilePrintStream> open(const char* filename, const char* mode);
+    WTF_EXPORT_PRIVATE static std::unique_ptr<FilePrintStream> open(const char* filename, const char* mode);
     
     FILE* file() { return m_file; }
     
index b1bbd47..7aa1915 100644 (file)
@@ -483,7 +483,7 @@ namespace WTF {
         // All access to m_iterators should be guarded with m_mutex.
         mutable const_iterator* m_iterators;
         // Use OwnPtr so HashTable can still be memmove'd or memcpy'ed.
-        mutable OwnPtr<Mutex> m_mutex;
+        mutable std::unique_ptr<Mutex> m_mutex;
 #endif
 
 #if DUMP_HASHTABLE_STATS_PER_TABLE
@@ -539,10 +539,10 @@ namespace WTF {
         , m_deletedCount(0)
 #if CHECK_HASHTABLE_ITERATORS
         , m_iterators(0)
-        , m_mutex(createOwned<Mutex>())
+        , m_mutex(std::make_unique<Mutex>())
 #endif
 #if DUMP_HASHTABLE_STATS_PER_TABLE
-        , m_stats(createOwned<Stats>())
+        , m_stats(std::make_unique<Stats>())
 #endif
     {
     }
@@ -1147,10 +1147,10 @@ namespace WTF {
         , m_deletedCount(0)
 #if CHECK_HASHTABLE_ITERATORS
         , m_iterators(0)
-        , m_mutex(createOwned<Mutex>())
+        , m_mutex(std::make_unique<Mutex>())
 #endif
 #if DUMP_HASHTABLE_STATS_PER_TABLE
-        , m_stats(createOwned<Stats>(*other.m_stats))
+        , m_stats(std::make_unique<Stats>(*other.m_stats))
 #endif
     {
         // Copy the hash table the dumb way, by adding each element to the new table.
index 2984c5e..d6779b1 100644 (file)
@@ -160,7 +160,7 @@ private:
     HashTable<Node*, Node*, IdentityExtractor, NodeHash, NodeTraits, NodeTraits> m_impl;
     Node* m_head;
     Node* m_tail;
-    OwnPtr<NodeAllocator> m_allocator;
+    std::unique_ptr<NodeAllocator> m_allocator;
 };
 
 template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator {
@@ -405,7 +405,7 @@ template<typename T, size_t inlineCapacity, typename U>
 inline ListHashSet<T, inlineCapacity, U>::ListHashSet()
     : m_head(0)
     , m_tail(0)
-    , m_allocator(createOwned<NodeAllocator>())
+    , m_allocator(std::make_unique<NodeAllocator>())
 {
 }
 
@@ -413,7 +413,7 @@ template<typename T, size_t inlineCapacity, typename U>
 inline ListHashSet<T, inlineCapacity, U>::ListHashSet(const ListHashSet& other)
     : m_head(0)
     , m_tail(0)
-    , m_allocator(createOwned<NodeAllocator>())
+    , m_allocator(std::make_unique<NodeAllocator>())
 {
     for (auto it = other.begin(), end = other.end(); it != end; ++it)
         add(*it);
index eebe867..111375f 100644 (file)
@@ -76,14 +76,6 @@ namespace WTF {
     private:
         explicit OwnPtr(PtrType ptr) : m_ptr(ptr) { }
 
-#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES)
-        template<typename U, typename... Args> friend OwnPtr<U> createOwned(Args&&... args);
-#else
-        template<typename U> friend OwnPtr<U> createOwned();
-        template<typename U, typename A1> friend OwnPtr<U> createOwned(A1&&);
-        template<typename U, typename A1, typename A2> friend OwnPtr<U> createOwned(A1&&, A2&&);
-#endif
-
         // We should never have two OwnPtrs for the same underlying object (otherwise we'll get
         // double-destruction), so these equality operators should never be needed.
         template<typename U> bool operator==(const OwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
@@ -194,35 +186,8 @@ namespace WTF {
         return p.get();
     }
 
-#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES)
-template<typename T, typename... Args>
-inline OwnPtr<T> createOwned(Args&&... args)
-{
-    return OwnPtr<T>(new T(std::forward<Args>(args)...));
-}
-#else
-template<typename T>
-inline OwnPtr<T> createOwned()
-{
-    return OwnPtr<T>(new T);
-}
-
-template<typename T, typename A1>
-inline OwnPtr<T> createOwned(A1&& a1)
-{
-    return OwnPtr<T>(new T(std::forward<A1>(a1)));
-}
-
-template<typename T, typename A1, typename A2>
-inline OwnPtr<T> createOwned(A1&& a1, A2&& a2)
-{
-    return OwnPtr<T>(new T(std::forward<A1>(a1), std::forward<A2>(a2)));
-}
-#endif
-
 } // namespace WTF
 
 using WTF::OwnPtr;
-using WTF::createOwned;
 
 #endif // WTF_OwnPtr_h
index 12c0ca4..723a94e 100644 (file)
@@ -109,17 +109,17 @@ struct ThreadFunctionWithReturnValueInvocation {
 
 static void compatEntryPoint(void* param)
 {
-    // Balanced by .leakPtr() in createThread.
-    OwnPtr<ThreadFunctionWithReturnValueInvocation> invocation = adoptPtr(static_cast<ThreadFunctionWithReturnValueInvocation*>(param));
+    // Balanced by .release() in createThread.
+    auto invocation = std::unique_ptr<ThreadFunctionWithReturnValueInvocation>(static_cast<ThreadFunctionWithReturnValueInvocation*>(param));
     invocation->function(invocation->data);
 }
 
 ThreadIdentifier createThread(ThreadFunctionWithReturnValue entryPoint, void* data, const char* name)
 {
-    auto invocation = createOwned<ThreadFunctionWithReturnValueInvocation>(entryPoint, data);
+    auto invocation = std::make_unique<ThreadFunctionWithReturnValueInvocation>(entryPoint, data);
 
-    // Balanced by adoptPtr() in compatEntryPoint.
-    return createThread(compatEntryPoint, invocation.leakPtr(), name);
+    // Balanced by std::unique_ptr constructor in compatEntryPoint.
+    return createThread(compatEntryPoint, invocation.release(), name);
 }
 
 WTF_EXPORT_PRIVATE int waitForThreadCompletion(ThreadIdentifier, void**);
@@ -136,10 +136,10 @@ WTF_EXPORT_PRIVATE ThreadIdentifier createThread(ThreadFunctionWithReturnValue e
 
 ThreadIdentifier createThread(ThreadFunctionWithReturnValue entryPoint, void* data)
 {
-    auto invocation = createOwned<ThreadFunctionWithReturnValueInvocation>(entryPoint, data);
+    auto invocation = std::make_unique<ThreadFunctionWithReturnValueInvocation>(entryPoint, data);
 
     // Balanced by adoptPtr() in compatEntryPoint.
-    return createThread(compatEntryPoint, invocation.leakPtr(), 0);
+    return createThread(compatEntryPoint, invocation.release(), 0);
 }
 #endif
 
index e7f0e4b..c684aa4 100644 (file)
@@ -191,22 +191,22 @@ static pthread_t pthreadHandleForIdentifierWithLockAlreadyHeld(ThreadIdentifier
 static void* wtfThreadEntryPoint(void* param)
 {
     // Balanced by .leakPtr() in createThreadInternal.
-    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(static_cast<ThreadFunctionInvocation*>(param));
+    auto invocation = std::unique_ptr<ThreadFunctionInvocation>(static_cast<ThreadFunctionInvocation*>(param));
     invocation->function(invocation->data);
-    return 0;
+    return nullptr;
 }
 
 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
 {
-    auto invocation = WTF::createOwned<ThreadFunctionInvocation>(entryPoint, data);
+    auto invocation = std::make_unique<ThreadFunctionInvocation>(entryPoint, data);
     pthread_t threadHandle;
     if (pthread_create(&threadHandle, 0, wtfThreadEntryPoint, invocation.get())) {
         LOG_ERROR("Failed to create pthread at entry point %p with data %p", wtfThreadEntryPoint, invocation.get());
         return 0;
     }
 
-    // Balanced by adoptPtr() in wtfThreadEntryPoint.
-    ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr();
+    // Balanced by std::unique_ptr constructor in wtfThreadEntryPoint.
+    ThreadFunctionInvocation* leakedInvocation = invocation.release();
     UNUSED_PARAM(leakedInvocation);
 
     return establishIdentifierForPthreadHandle(threadHandle);
index 158f9af..913b137 100644 (file)
@@ -48,7 +48,7 @@ namespace WTF {
         WTF_EXPORT_PRIVATE ~Collator();
         WTF_EXPORT_PRIVATE void setOrderLowerFirst(bool);
 
-        WTF_EXPORT_PRIVATE static OwnPtr<Collator> userDefault();
+        WTF_EXPORT_PRIVATE static std::unique_ptr<Collator> userDefault();
 
         WTF_EXPORT_PRIVATE Result collate(const ::UChar*, size_t, const ::UChar*, size_t) const;
 
index 6bf4e67..4d8c479 100644 (file)
@@ -47,7 +47,7 @@ void Collator::setOrderLowerFirst(bool)
 
 OwnPtr<Collator> Collator::userDefault()
 {
-    return createOwned<Collator>(nullptr);
+    return std::make_unique<Collator>(nullptr);
 }
 
 // A default implementation for platforms that lack Unicode-aware collation.
index 9d55f88..6de6404 100644 (file)
@@ -58,7 +58,7 @@ Collator::Collator(const char* locale)
 {
 }
 
-OwnPtr<Collator> Collator::userDefault()
+std::unique_ptr<Collator> Collator::userDefault()
 {
 #if OS(DARWIN) && USE(CF)
     // Mac OS X doesn't set UNIX locale to match user-selected one, so ICU default doesn't work.
@@ -71,11 +71,11 @@ OwnPtr<Collator> Collator::userDefault()
 #endif
     char buf[256];
     if (!collationOrder)
-        return createOwned<Collator>("");
+        return std::make_unique<Collator>("");
     CFStringGetCString(collationOrder, buf, sizeof(buf), kCFStringEncodingASCII);
-    return createOwned<Collator>(buf);
+    return std::make_unique<Collator>(buf);
 #else
-    return createOwned<Collator>(static_cast<const char*>(0));
+    return std::make_unique<Collator>(static_cast<const char*>(0));
 #endif
 }
 
index 85dd8b7..4cb0b2b 100644 (file)
@@ -1,3 +1,41 @@
+2013-10-05  Anders Carlsson  <andersca@apple.com>
+
+        Remove createOwned
+        https://bugs.webkit.org/show_bug.cgi?id=122388
+
+        Reviewed by Darin Adler.
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::~Document):
+        (WebCore::Document::createRenderTree):
+        (WebCore::Document::destroyRenderTree):
+        * dom/Document.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        * page/Frame.h:
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationController::AnimationController):
+        * page/animation/AnimationController.h:
+        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
+        * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
+        (WebCore::AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC):
+        (WebCore::AudioTrackPrivateAVFObjC::setPlayerItemTrack):
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
+        (WebCore::VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC):
+        (WebCore::VideoTrackPrivateAVFObjC::setPlayerItemTrack):
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h:
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        * rendering/svg/RenderSVGResourceClipper.h:
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        * rendering/svg/RenderSVGResourceFilter.h:
+        * rendering/svg/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        * rendering/svg/RenderSVGResourceMasker.h:
+
 2013-10-05  Darin Adler  <darin@apple.com>
 
         Remove COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) since it's required now
index c55e284..d6944b6 100644 (file)
@@ -447,7 +447,7 @@ Document::Document(Frame* frame, const URL& url, unsigned documentClasses)
     , m_loadEventFinished(false)
     , m_startTime(monotonicallyIncreasingTimeMS())
     , m_overMinimumLayoutThreshold(false)
-    , m_scriptRunner(createOwned<ScriptRunner>(*this))
+    , m_scriptRunner(std::make_unique<ScriptRunner>(*this))
     , m_xmlVersion(ASCIILiteral("1.0"))
     , m_xmlStandalone(StandaloneUnspecified)
     , m_hasXMLDeclaration(0)
@@ -579,7 +579,7 @@ Document::~Document()
     if (m_domWindow)
         m_domWindow->resetUnlessSuspendedForPageCache();
 
-    m_scriptRunner.clear();
+    m_scriptRunner = nullptr;
 
     histogramMutationEventUsage(m_listenerTypes);
 
@@ -594,7 +594,7 @@ Document::~Document()
     ASSERT(!m_parser || m_parser->refCount() == 1);
     detachParser();
 
-    m_renderArena.clear();
+    m_renderArena = nullptr;
 
     if (this == topDocument())
         clearAXObjectCache();
@@ -2011,7 +2011,7 @@ void Document::createRenderTree()
     ASSERT(!m_axObjectCache || this != topDocument());
 
     if (!m_renderArena)
-        m_renderArena = createOwned<RenderArena>();
+        m_renderArena = std::make_unique<RenderArena>();
     
     setRenderView(new (*m_renderArena) RenderView(*this));
 #if USE(ACCELERATED_COMPOSITING)
@@ -2118,7 +2118,7 @@ void Document::destroyRenderTree()
     m_textAutoSizedNodes.clear();
 #endif
 
-    m_renderArena.clear();
+    m_renderArena = nullptr;
 }
 
 void Document::prepareForDestruction()
index 6a2494b..e9a7fbb 100644 (file)
@@ -1381,7 +1381,7 @@ private:
     bool m_titleSetExplicitly;
     RefPtr<Element> m_titleElement;
 
-    OwnPtr<RenderArena> m_renderArena;
+    std::unique_ptr<RenderArena> m_renderArena;
 
     OwnPtr<AXObjectCache> m_axObjectCache;
     const OwnPtr<DocumentMarkerController> m_markers;
@@ -1402,9 +1402,9 @@ private:
     double m_startTime;
     bool m_overMinimumLayoutThreshold;
     
-    OwnPtr<ScriptRunner> m_scriptRunner;
+    std::unique_ptr<ScriptRunner> m_scriptRunner;
 
-    Vector<RefPtr<HTMLScriptElement> > m_currentScriptStack;
+    Vector<RefPtr<HTMLScriptElement>> m_currentScriptStack;
 
 #if ENABLE(XSLT)
     OwnPtr<TransformSource> m_transformSource;
index 2fb73c9..07260f0 100644 (file)
@@ -159,11 +159,11 @@ Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient&
     , m_loader(*this, frameLoaderClient)
     , m_navigationScheduler(this)
     , m_ownerElement(ownerElement)
-    , m_script(createOwned<ScriptController>(*this))
+    , m_script(std::make_unique<ScriptController>(*this))
     , m_editor(Editor::create(*this))
     , m_selection(adoptPtr(new FrameSelection(this)))
     , m_eventHandler(adoptPtr(new EventHandler(*this)))
-    , m_animationController(createOwned<AnimationController>(*this))
+    , m_animationController(std::make_unique<AnimationController>(*this))
     , m_pageZoomFactor(parentPageZoomFactor(this))
     , m_textZoomFactor(parentTextZoomFactor(this))
 #if ENABLE(ORIENTATION_EVENTS)
index b8b806a..8407e9e 100644 (file)
@@ -220,11 +220,11 @@ namespace WebCore {
         RefPtr<FrameView> m_view;
         RefPtr<Document> m_doc;
 
-        const OwnPtr<ScriptController> m_script;
+        const std::unique_ptr<ScriptController> m_script;
         const OwnPtr<Editor> m_editor;
         const OwnPtr<FrameSelection> m_selection;
         const OwnPtr<EventHandler> m_eventHandler;
-        const OwnPtr<AnimationController> m_animationController;
+        const std::unique_ptr<AnimationController> m_animationController;
 
 #if ENABLE(IOS_TEXT_AUTOSIZING)
         float m_textAutosizingWidth;
index ecb355f..b711e85 100644 (file)
@@ -473,7 +473,7 @@ void AnimationControllerPrivate::animationWillBeRemoved(AnimationBase* animation
 }
 
 AnimationController::AnimationController(Frame& frame)
-    : m_data(createOwned<AnimationControllerPrivate>(frame))
+    : m_data(std::make_unique<AnimationControllerPrivate>(frame))
     , m_beginAnimationUpdateCount(0)
 {
 }
index 60c2032..6f8dbde 100644 (file)
@@ -83,7 +83,7 @@ public:
     static bool supportsAcceleratedAnimationOfProperty(CSSPropertyID);
 
 private:
-    const OwnPtr<AnimationControllerPrivate> m_data;
+    const std::unique_ptr<AnimationControllerPrivate> m_data;
     int m_beginAnimationUpdateCount;
 };
 
index 953aa04..5f2694a 100644 (file)
@@ -40,11 +40,7 @@ namespace WebCore {
 
 class AVTrackPrivateAVFObjCImpl {
 public:
-    static OwnPtr<AVTrackPrivateAVFObjCImpl> create(AVPlayerItemTrack* track)
-    {
-        return createOwned<AVTrackPrivateAVFObjCImpl>(track);
-    }
-    AVTrackPrivateAVFObjCImpl(AVPlayerItemTrack*);
+    explicit AVTrackPrivateAVFObjCImpl(AVPlayerItemTrack*);
 
     AVPlayerItemTrack* playerItemTrack() const { return m_playerItemTrack.get(); }
 
index 7eea8c5..6e97b52 100644 (file)
@@ -54,7 +54,7 @@ private:
     AudioTrackPrivateAVFObjC(AVPlayerItemTrack*);
 
     void resetPropertiesFromTrack();
-    OwnPtr<AVTrackPrivateAVFObjCImpl> m_impl;
+    std::unique_ptr<AVTrackPrivateAVFObjCImpl> m_impl;
 };
 
 }
index 6b47175..0046845 100644 (file)
@@ -32,7 +32,7 @@
 namespace WebCore {
 
 AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC(AVPlayerItemTrack* track)
-    : m_impl(AVTrackPrivateAVFObjCImpl::create(track))
+    : m_impl(std::make_unique<AVTrackPrivateAVFObjCImpl>(track))
 {
     resetPropertiesFromTrack();
 }
@@ -48,7 +48,7 @@ void AudioTrackPrivateAVFObjC::resetPropertiesFromTrack()
 
 void AudioTrackPrivateAVFObjC::setPlayerItemTrack(AVPlayerItemTrack *track)
 {
-    m_impl = AVTrackPrivateAVFObjCImpl::create(track);
+    m_impl = std::make_unique<AVTrackPrivateAVFObjCImpl>(track);
     resetPropertiesFromTrack();
 }
 
index 412206c..388e3a1 100644 (file)
@@ -32,7 +32,7 @@
 namespace WebCore {
 
 VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC(AVPlayerItemTrack* track)
-: m_impl(AVTrackPrivateAVFObjCImpl::create(track))
+    : m_impl(std::make_unique<AVTrackPrivateAVFObjCImpl>(track))
 {
     resetPropertiesFromTrack();
 }
@@ -48,7 +48,7 @@ void VideoTrackPrivateAVFObjC::resetPropertiesFromTrack()
 
 void VideoTrackPrivateAVFObjC::setPlayerItemTrack(AVPlayerItemTrack *track)
 {
-    m_impl = AVTrackPrivateAVFObjCImpl::create(track);
+    m_impl = std::make_unique<AVTrackPrivateAVFObjCImpl>(track);
     resetPropertiesFromTrack();
 }
 
index b916e06..ce6b66f 100644 (file)
@@ -51,10 +51,10 @@ public:
     AVPlayerItemTrack* playerItemTrack();
 
 private:
-    VideoTrackPrivateAVFObjC(AVPlayerItemTrack*);
+    explicit VideoTrackPrivateAVFObjC(AVPlayerItemTrack*);
 
     void resetPropertiesFromTrack();
-    OwnPtr<AVTrackPrivateAVFObjCImpl> m_impl;
+    std::unique_ptr<AVTrackPrivateAVFObjCImpl> m_impl;
 };
 
 }
index 1911826..010be08 100644 (file)
@@ -147,7 +147,7 @@ bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* object, cons
 {
     bool missingClipperData = !m_clipper.contains(object);
     if (missingClipperData)
-        m_clipper.set(object, createOwned<ClipperData>().release());
+        m_clipper.set(object, std::make_unique<ClipperData>());
 
     bool shouldCreateClipData = false;
     AffineTransform animatedLocalTransform = clipPathElement().animatedLocalTransform();
index 6aa9f91..a58bbcb 100644 (file)
@@ -75,7 +75,7 @@ private:
     void calculateClipContentRepaintRect();
 
     FloatRect m_clipBoundaries;
-    HashMap<RenderObject*, OwnPtr<ClipperData>> m_clipper;
+    HashMap<RenderObject*, std::unique_ptr<ClipperData>> m_clipper;
 };
 
 }
index d145366..7bfd1c7 100644 (file)
@@ -146,7 +146,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
         return false; // Already built, or we're in a cycle, or we're marked for removal. Regardless, just do nothing more now.
     }
 
-    auto filterData = createOwned<FilterData>();
+    auto filterData = std::make_unique<FilterData>();
     FloatRect targetBoundingBox = object->objectBoundingBox();
 
     filterData->boundaries = SVGLengthContext::resolveRectangle<SVGFilterElement>(&filterElement(), filterElement().filterUnits(), targetBoundingBox);
@@ -214,7 +214,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
     if (filterData->drawingRegion.isEmpty()) {
         ASSERT(!m_filter.contains(object));
         filterData->savedContext = context;
-        m_filter.set(object, filterData.release());
+        m_filter.set(object, std::move(filterData));
         return false;
     }
 
@@ -228,7 +228,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
     if (!SVGRenderingContext::createImageBuffer(filterData->drawingRegion, effectiveTransform, sourceGraphic, ColorSpaceLinearRGB, renderingMode)) {
         ASSERT(!m_filter.contains(object));
         filterData->savedContext = context;
-        m_filter.set(object, filterData.release());
+        m_filter.set(object, std::move(filterData));
         return false;
     }
     
@@ -244,7 +244,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
     context = sourceGraphicContext;
 
     ASSERT(!m_filter.contains(object));
-    m_filter.set(object, filterData.release());
+    m_filter.set(object, std::move(filterData));
 
     return true;
 }
index dae90f0..61797e8 100644 (file)
@@ -97,7 +97,7 @@ private:
 
     bool fitsInMaximumImageSize(const FloatSize&, FloatSize&);
 
-    HashMap<RenderObject*, OwnPtr<FilterData>> m_filter;
+    HashMap<RenderObject*, std::unique_ptr<FilterData>> m_filter;
 };
 
 inline RenderSVGResourceFilter* toRenderSVGFilter(RenderObject* object)
index 309050f..3b65421 100644 (file)
@@ -74,7 +74,7 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
 
     bool missingMaskerData = !m_masker.contains(object);
     if (missingMaskerData)
-        m_masker.set(object, createOwned<MaskerData>().release());
+        m_masker.set(object, std::make_unique<MaskerData>());
 
     MaskerData* maskerData = m_masker.get(object);
 
index edee370..0c878fb 100644 (file)
@@ -65,7 +65,7 @@ private:
     void calculateMaskContentRepaintRect();
 
     FloatRect m_maskContentBoundaries;
-    HashMap<RenderObject*, OwnPtr<MaskerData>> m_masker;
+    HashMap<RenderObject*, std::unique_ptr<MaskerData>> m_masker;
 };
 
 }
index fa6353e..7d2a821 100644 (file)
@@ -1,3 +1,15 @@
+2013-10-05  Anders Carlsson  <andersca@apple.com>
+
+        Remove createOwned
+        https://bugs.webkit.org/show_bug.cgi?id=122388
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _setFindIndicator:fadeOut:animate:]):
+        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
+        (WKBundlePageOverlayCreate):
+
 2013-10-05  Darin Adler  <darin@apple.com>
 
         Remove COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) since it's required now
index 96292c8..8948cae 100644 (file)
@@ -172,7 +172,8 @@ struct WKViewInterpretKeyEventsParameters {
     // For asynchronous validation.
     ValidationMap _validationMap;
 
-    OwnPtr<FindIndicatorWindow> _findIndicatorWindow;
+    std::unique_ptr<FindIndicatorWindow> _findIndicatorWindow;
+
     // We keep here the event when resending it to
     // the application to distinguish the case of a new event from one 
     // that has been already sent to WebCore.
@@ -2605,7 +2606,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
     }
 
     if (!_data->_findIndicatorWindow)
-        _data->_findIndicatorWindow = createOwned<FindIndicatorWindow>(self);
+        _data->_findIndicatorWindow = std::make_unique<FindIndicatorWindow>(self);
 
     _data->_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut, animate);
 }
index 3b6c80e..fbe44a7 100644 (file)
@@ -144,10 +144,10 @@ WKBundlePageOverlayRef WKBundlePageOverlayCreate(WKBundlePageOverlayClient* wkCl
     if (wkClient && wkClient->version)
         return 0;
 
-    auto clientImpl = createOwned<PageOverlayClientImpl>(wkClient);
+    auto clientImpl = std::make_unique<PageOverlayClientImpl>(wkClient);
 
     // FIXME: Looks like this leaks the clientImpl.
-    return toAPI(PageOverlay::create(clientImpl.leakPtr()).leakRef());
+    return toAPI(PageOverlay::create(clientImpl.release()).leakRef());
 }
 
 void WKBundlePageOverlaySetAccessibilityClient(WKBundlePageOverlayRef bundlePageOverlayRef, WKBundlePageOverlayAccessibilityClient* client)