WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
133081
WebKitTestRunner: Move PassOwnPtr and OwnPtr to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=133081
Summary
WebKitTestRunner: Move PassOwnPtr and OwnPtr to std::unique_ptr
David Farler
Reported
2014-05-19 12:29:23 PDT
WebKitTestRunner looks like a simple candidate to move off of {Pass,}OwnPtr.
Attachments
Patch
(9.97 KB, patch)
2014-05-19 12:31 PDT
,
David Farler
dbates
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
David Farler
Comment 1
2014-05-19 12:31:08 PDT
Created
attachment 231710
[details]
Patch
Daniel Bates
Comment 2
2014-05-19 20:42:38 PDT
Comment on
attachment 231710
[details]
Patch 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.
David Farler
Comment 3
2014-05-20 09:23:43 PDT
Committed
r169113
: <
http://trac.webkit.org/changeset/169113
>
David Farler
Comment 4
2014-05-20 09:24:08 PDT
Landed patch with all of your suggestions - thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug