[webkit-reviews] review granted: [Bug 133081] WebKitTestRunner: Move PassOwnPtr and OwnPtr to std::unique_ptr : [Attachment 231710] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 19 20:42:14 PDT 2014


Daniel Bates <dbates at webkit.org> has granted David Farler <dfarler at apple.com>'s
request for review:
Bug 133081: WebKitTestRunner: Move PassOwnPtr and OwnPtr to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=133081

Attachment 231710: Patch
https://bugs.webkit.org/attachment.cgi?id=231710&action=review

------- Additional Comments from Daniel Bates <dbates at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=231710&action=review


> Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:108
> +    m_pages.append(std::unique_ptr<InjectedBundlePage>(new
InjectedBundlePage(page)));

Notice that Source/WTF/wtf/StdLibExtras.h,
<http://trac.webkit.org/browser/trunk/Source/WTF/wtf/StdLibExtras.h?rev=167453#
L347>, includes support for the C++14 std::make_unique<>(). We should make use
of this convenience template function to write this line as:

m_pages.append(std::make_unique<InjectedBundlePage>(page));

> Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h:137
> +    Vector<std::unique_ptr<InjectedBundlePage> > m_pages;

"> >" => ">>"

That is, no need for the space character between the greater-than characters as
C++11 compilers are smart enough to distinguish between a closing template and
the right-shift operator.

> Tools/WebKitTestRunner/TestController.cpp:343
> +    m_geolocationProvider = std::unique_ptr<GeolocationProviderMock>(new
GeolocationProviderMock(m_context.get()));

We should write this line using std::make_unique.

> Tools/WebKitTestRunner/TestController.cpp:420
> +    m_mainWebView = std::unique_ptr<PlatformWebView>(new
PlatformWebView(m_context.get(), m_pageGroup.get(), 0, options));

We should write this line using std::make_unique. Also, we should substitute
nullptr for 0.

> Tools/WebKitTestRunner/TestController.cpp:618
> +    m_eventSenderProxy = std::unique_ptr<EventSenderProxy>(new
EventSenderProxy(this));

We should write this line using std::make_unique.

> Tools/WebKitTestRunner/TestController.cpp:762
> +    m_currentInvocation = std::unique_ptr<TestInvocation>(new
TestInvocation(command.pathOrURL));

Ditto.

> Tools/WebKitTestRunner/WorkQueueManager.h:53
> +    typedef Deque<std::unique_ptr<class WorkQueueItem> > WorkQueue;

"> >" => ">>"

That is, no need for the space character between the greater-than characters.
See my remark on line 137 for the reasoning behind this change.


More information about the webkit-reviews mailing list