Title: [169113] trunk/Tools
Revision
169113
Author
[email protected]
Date
2014-05-20 09:23:16 -0700 (Tue, 20 May 2014)

Log Message

Move WebKitTestRunner to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=133081

Reviewed by Daniel Bates.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didCreatePage):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::runTest):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/WorkQueueManager.cpp:
(WTR::WorkQueueManager::processWorkQueue):
(WTR::WorkQueueManager::enqueue):
* WebKitTestRunner/WorkQueueManager.h:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (169112 => 169113)


--- trunk/Tools/ChangeLog	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/ChangeLog	2014-05-20 16:23:16 UTC (rev 169113)
@@ -1,3 +1,26 @@
+2014-05-19  David Farler  <[email protected]>
+
+        Move WebKitTestRunner to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=133081
+
+        Reviewed by Daniel Bates.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::didCreatePage):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+        (WTR::TestController::createWebViewWithOptions):
+        (WTR::TestController::resetStateToConsistentValues):
+        (WTR::TestController::runTest):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        * WebKitTestRunner/TestInvocation.h:
+        * WebKitTestRunner/WorkQueueManager.cpp:
+        (WTR::WorkQueueManager::processWorkQueue):
+        (WTR::WorkQueueManager::enqueue):
+        * WebKitTestRunner/WorkQueueManager.h:
+
 2014-05-20  Carlos Garcia Campos  <[email protected]>
 
         [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2014-05-20 16:23:16 UTC (rev 169113)
@@ -35,7 +35,6 @@
 #include <WebKit/WKBundlePrivate.h>
 #include <WebKit/WKRetainPtr.h>
 #include <WebKit/WebKit2_C.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/Vector.h>
@@ -106,7 +105,7 @@
 
 void InjectedBundle::didCreatePage(WKBundlePageRef page)
 {
-    m_pages.append(adoptPtr(new InjectedBundlePage(page)));
+    m_pages.append(std::make_unique<InjectedBundlePage>(page));
 }
 
 void InjectedBundle::willDestroyPage(WKBundlePageRef page)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2014-05-20 16:23:16 UTC (rev 169113)
@@ -35,7 +35,6 @@
 #include <WebKit/WKRetainPtr.h>
 #include <sstream>
 #include <wtf/Forward.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
@@ -135,7 +134,7 @@
 
     WKBundleRef m_bundle;
     WKBundlePageGroupRef m_pageGroup;
-    Vector<OwnPtr<InjectedBundlePage> > m_pages;
+    Vector<std::unique_ptr<InjectedBundlePage>> m_pages;
 
     RefPtr<AccessibilityController> m_accessibilityController;
     RefPtr<TestRunner> m_testRunner;

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2014-05-20 16:23:16 UTC (rev 169113)
@@ -51,7 +51,6 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/CString.h>
 
 #if PLATFORM(COCOA)
@@ -341,7 +340,7 @@
     }
 
     m_context = adoptWK(WKContextCreateWithConfiguration(configuration.get()));
-    m_geolocationProvider = adoptPtr(new GeolocationProviderMock(m_context.get()));
+    m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
 
 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080)
     WKContextSetUsesNetworkProcess(m_context.get(), true);
@@ -418,7 +417,7 @@
 
 void TestController::createWebViewWithOptions(WKDictionaryRef options)
 {
-    m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get(), 0, options));
+    m_mainWebView = std::make_unique<PlatformWebView>(m_context.get(), m_pageGroup.get(), nullptr, options);
     WKPageUIClientV2 pageUIClient = {
         { 2, m_mainWebView.get() },
         0, // createNewPage_deprecatedForUseWithV0
@@ -616,7 +615,7 @@
     // FIXME: This function should also ensure that there is only one page open.
 
     // Reset the EventSender for each test.
-    m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
+    m_eventSenderProxy = std::make_unique<EventSenderProxy>(this);
 
     // FIXME: Is this needed? Nothing in TestController changes preferences during tests, and if there is
     // some other code doing this, it should probably be responsible for cleanup too.
@@ -760,7 +759,7 @@
 
     m_state = RunningTest;
 
-    m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL));
+    m_currentInvocation = std::make_unique<TestInvocation>(command.pathOrURL);
     if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests)
         m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
     if (command.timeout > 0)
@@ -769,7 +768,7 @@
     platformWillRunTest(*m_currentInvocation);
 
     m_currentInvocation->invoke();
-    m_currentInvocation.clear();
+    m_currentInvocation = nullptr;
 
     return true;
 }

Modified: trunk/Tools/WebKitTestRunner/TestController.h (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/TestController.h	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2014-05-20 16:23:16 UTC (rev 169113)
@@ -32,7 +32,6 @@
 #include <WebKit/WKRetainPtr.h>
 #include <string>
 #include <vector>
-#include <wtf/OwnPtr.h>
 #include <wtf/Vector.h>
 
 namespace WTR {
@@ -185,7 +184,7 @@
     static const char* libraryPathForTesting();
     static const char* platformLibraryPathForTesting();
 
-    OwnPtr<TestInvocation> m_currentInvocation;
+    std::unique_ptr<TestInvocation> m_currentInvocation;
 
     bool m_verbose;
     bool m_printSeparators;
@@ -198,7 +197,7 @@
 
     WebNotificationProvider m_webNotificationProvider;
 
-    OwnPtr<PlatformWebView> m_mainWebView;
+    std::unique_ptr<PlatformWebView> m_mainWebView;
     WKRetainPtr<WKContextRef> m_context;
     WKRetainPtr<WKPageGroupRef> m_pageGroup;
 
@@ -223,7 +222,7 @@
     
     bool m_beforeUnloadReturnValue;
 
-    OwnPtr<GeolocationProviderMock> m_geolocationProvider;
+    std::unique_ptr<GeolocationProviderMock> m_geolocationProvider;
     Vector<WKRetainPtr<WKGeolocationPermissionRequestRef> > m_geolocationPermissionRequests;
     bool m_isGeolocationPermissionSet;
     bool m_isGeolocationPermissionAllowed;
@@ -243,7 +242,7 @@
 
     bool m_shouldLogHistoryClientCallbacks;
 
-    OwnPtr<EventSenderProxy> m_eventSenderProxy;
+    std::unique_ptr<EventSenderProxy> m_eventSenderProxy;
 
     WorkQueueManager m_workQueueManager;
 };

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2014-05-20 16:23:16 UTC (rev 169113)
@@ -38,7 +38,6 @@
 #include <WebKit/WKRetainPtr.h>
 #include <climits>
 #include <cstdio>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
 

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/TestInvocation.h	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.h	2014-05-20 16:23:16 UTC (rev 169113)
@@ -29,7 +29,6 @@
 #include <WebKit/WKRetainPtr.h>
 #include <string>
 #include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace WTR {

Modified: trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp	2014-05-20 16:23:16 UTC (rev 169113)
@@ -31,7 +31,6 @@
 #include <WebKit/WKPage.h>
 #include <WebKit/WKRetainPtr.h>
 #include <stdio.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/CString.h>
 
 namespace WTR {
@@ -119,7 +118,7 @@
 {
     m_processing = false;
     while (!m_processing && !m_workQueue.isEmpty()) {
-        OwnPtr<WorkQueueItem> item(m_workQueue.takeFirst());
+        std::unique_ptr<WorkQueueItem> item(m_workQueue.takeFirst());
         m_processing = (item->invoke() == WorkQueueItem::Loading);
     }
 
@@ -222,7 +221,7 @@
         return;
     }
 
-    m_workQueue.append(adoptPtr(item));
+    m_workQueue.append(std::unique_ptr<WorkQueueItem>(item));
 }
 
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/WorkQueueManager.h (169112 => 169113)


--- trunk/Tools/WebKitTestRunner/WorkQueueManager.h	2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/WebKitTestRunner/WorkQueueManager.h	2014-05-20 16:23:16 UTC (rev 169113)
@@ -27,7 +27,6 @@
 #define WorkQueueManager_h
 
 #include <wtf/Deque.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WTR {
@@ -51,7 +50,7 @@
     void queueNonLoadingScript(const String& script);
 
 private:    
-    typedef Deque<OwnPtr<class WorkQueueItem> > WorkQueue;
+    typedef Deque<std::unique_ptr<class WorkQueueItem>> WorkQueue;
 
     void enqueue(WorkQueueItem*); // Adopts pointer.
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to