<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169113] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169113">169113</a></dd>
<dt>Author</dt> <dd>dfarler@apple.com</dd>
<dt>Date</dt> <dd>2014-05-20 09:23:16 -0700 (Tue, 20 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationh">trunk/Tools/WebKitTestRunner/TestInvocation.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerWorkQueueManagercpp">trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerWorkQueueManagerh">trunk/Tools/WebKitTestRunner/WorkQueueManager.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-05-20 15:20:52 UTC (rev 169112)
+++ trunk/Tools/ChangeLog        2014-05-20 16:23:16 UTC (rev 169113)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-05-19 David Farler <dfarler@apple.com>
+
+ 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:
+
</ins><span class="cx"> 2014-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include <WebKit/WKBundlePrivate.h>
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <WebKit/WebKit2_C.h>
</span><del>-#include <wtf/PassOwnPtr.h>
</del><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -106,7 +105,7 @@
</span><span class="cx">
</span><span class="cx"> void InjectedBundle::didCreatePage(WKBundlePageRef page)
</span><span class="cx"> {
</span><del>- m_pages.append(adoptPtr(new InjectedBundlePage(page)));
</del><ins>+ m_pages.append(std::make_unique<InjectedBundlePage>(page));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InjectedBundle::willDestroyPage(WKBundlePageRef page)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <sstream>
</span><span class="cx"> #include <wtf/Forward.h>
</span><del>-#include <wtf/OwnPtr.h>
</del><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="lines">@@ -135,7 +134,7 @@
</span><span class="cx">
</span><span class="cx"> WKBundleRef m_bundle;
</span><span class="cx"> WKBundlePageGroupRef m_pageGroup;
</span><del>- Vector<OwnPtr<InjectedBundlePage> > m_pages;
</del><ins>+ Vector<std::unique_ptr<InjectedBundlePage>> m_pages;
</ins><span class="cx">
</span><span class="cx"> RefPtr<AccessibilityController> m_accessibilityController;
</span><span class="cx"> RefPtr<TestRunner> m_testRunner;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> #include <ctype.h>
</span><span class="cx"> #include <stdlib.h>
</span><span class="cx"> #include <string>
</span><del>-#include <wtf/PassOwnPtr.h>
</del><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -341,7 +340,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_context = adoptWK(WKContextCreateWithConfiguration(configuration.get()));
</span><del>- m_geolocationProvider = adoptPtr(new GeolocationProviderMock(m_context.get()));
</del><ins>+ m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080)
</span><span class="cx"> WKContextSetUsesNetworkProcess(m_context.get(), true);
</span><span class="lines">@@ -418,7 +417,7 @@
</span><span class="cx">
</span><span class="cx"> void TestController::createWebViewWithOptions(WKDictionaryRef options)
</span><span class="cx"> {
</span><del>- m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get(), 0, options));
</del><ins>+ m_mainWebView = std::make_unique<PlatformWebView>(m_context.get(), m_pageGroup.get(), nullptr, options);
</ins><span class="cx"> WKPageUIClientV2 pageUIClient = {
</span><span class="cx"> { 2, m_mainWebView.get() },
</span><span class="cx"> 0, // createNewPage_deprecatedForUseWithV0
</span><span class="lines">@@ -616,7 +615,7 @@
</span><span class="cx"> // FIXME: This function should also ensure that there is only one page open.
</span><span class="cx">
</span><span class="cx"> // Reset the EventSender for each test.
</span><del>- m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
</del><ins>+ m_eventSenderProxy = std::make_unique<EventSenderProxy>(this);
</ins><span class="cx">
</span><span class="cx"> // FIXME: Is this needed? Nothing in TestController changes preferences during tests, and if there is
</span><span class="cx"> // some other code doing this, it should probably be responsible for cleanup too.
</span><span class="lines">@@ -760,7 +759,7 @@
</span><span class="cx">
</span><span class="cx"> m_state = RunningTest;
</span><span class="cx">
</span><del>- m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL));
</del><ins>+ m_currentInvocation = std::make_unique<TestInvocation>(command.pathOrURL);
</ins><span class="cx"> if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests)
</span><span class="cx"> m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
</span><span class="cx"> if (command.timeout > 0)
</span><span class="lines">@@ -769,7 +768,7 @@
</span><span class="cx"> platformWillRunTest(*m_currentInvocation);
</span><span class="cx">
</span><span class="cx"> m_currentInvocation->invoke();
</span><del>- m_currentInvocation.clear();
</del><ins>+ m_currentInvocation = nullptr;
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <string>
</span><span class="cx"> #include <vector>
</span><del>-#include <wtf/OwnPtr.h>
</del><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -185,7 +184,7 @@
</span><span class="cx"> static const char* libraryPathForTesting();
</span><span class="cx"> static const char* platformLibraryPathForTesting();
</span><span class="cx">
</span><del>- OwnPtr<TestInvocation> m_currentInvocation;
</del><ins>+ std::unique_ptr<TestInvocation> m_currentInvocation;
</ins><span class="cx">
</span><span class="cx"> bool m_verbose;
</span><span class="cx"> bool m_printSeparators;
</span><span class="lines">@@ -198,7 +197,7 @@
</span><span class="cx">
</span><span class="cx"> WebNotificationProvider m_webNotificationProvider;
</span><span class="cx">
</span><del>- OwnPtr<PlatformWebView> m_mainWebView;
</del><ins>+ std::unique_ptr<PlatformWebView> m_mainWebView;
</ins><span class="cx"> WKRetainPtr<WKContextRef> m_context;
</span><span class="cx"> WKRetainPtr<WKPageGroupRef> m_pageGroup;
</span><span class="cx">
</span><span class="lines">@@ -223,7 +222,7 @@
</span><span class="cx">
</span><span class="cx"> bool m_beforeUnloadReturnValue;
</span><span class="cx">
</span><del>- OwnPtr<GeolocationProviderMock> m_geolocationProvider;
</del><ins>+ std::unique_ptr<GeolocationProviderMock> m_geolocationProvider;
</ins><span class="cx"> Vector<WKRetainPtr<WKGeolocationPermissionRequestRef> > m_geolocationPermissionRequests;
</span><span class="cx"> bool m_isGeolocationPermissionSet;
</span><span class="cx"> bool m_isGeolocationPermissionAllowed;
</span><span class="lines">@@ -243,7 +242,7 @@
</span><span class="cx">
</span><span class="cx"> bool m_shouldLogHistoryClientCallbacks;
</span><span class="cx">
</span><del>- OwnPtr<EventSenderProxy> m_eventSenderProxy;
</del><ins>+ std::unique_ptr<EventSenderProxy> m_eventSenderProxy;
</ins><span class="cx">
</span><span class="cx"> WorkQueueManager m_workQueueManager;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <climits>
</span><span class="cx"> #include <cstdio>
</span><del>-#include <wtf/PassOwnPtr.h>
</del><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <string>
</span><span class="cx"> #include <wtf/Noncopyable.h>
</span><del>-#include <wtf/OwnPtr.h>
</del><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> namespace WTR {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerWorkQueueManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include <WebKit/WKPage.h>
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <stdio.h>
</span><del>-#include <wtf/PassOwnPtr.h>
</del><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -119,7 +118,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_processing = false;
</span><span class="cx"> while (!m_processing && !m_workQueue.isEmpty()) {
</span><del>- OwnPtr<WorkQueueItem> item(m_workQueue.takeFirst());
</del><ins>+ std::unique_ptr<WorkQueueItem> item(m_workQueue.takeFirst());
</ins><span class="cx"> m_processing = (item->invoke() == WorkQueueItem::Loading);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -222,7 +221,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_workQueue.append(adoptPtr(item));
</del><ins>+ m_workQueue.append(std::unique_ptr<WorkQueueItem>(item));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerWorkQueueManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/WorkQueueManager.h (169112 => 169113)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #define WorkQueueManager_h
</span><span class="cx">
</span><span class="cx"> #include <wtf/Deque.h>
</span><del>-#include <wtf/OwnPtr.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -51,7 +50,7 @@
</span><span class="cx"> void queueNonLoadingScript(const String& script);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- typedef Deque<OwnPtr<class WorkQueueItem> > WorkQueue;
</del><ins>+ typedef Deque<std::unique_ptr<class WorkQueueItem>> WorkQueue;
</ins><span class="cx">
</span><span class="cx"> void enqueue(WorkQueueItem*); // Adopts pointer.
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>