Bug 127330 - ScriptExecutionContext tasks, cross-thread data and copiers should use std::unique_ptr
Summary: ScriptExecutionContext tasks, cross-thread data and copiers should use std::u...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 128007
  Show dependency treegraph
 
Reported: 2014-01-20 19:32 PST by BJ Burg
Modified: 2015-04-20 10:04 PDT (History)
4 users (show)

See Also:


Attachments
WIP - needs rebase, CrossThreadTask broke (123.65 KB, patch)
2014-01-21 13:34 PST, BJ Burg
no flags Details | Formatted Diff | Diff
mostly done, one fail yet (134.58 KB, patch)
2014-01-21 15:44 PST, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2014-01-20 19:32:09 PST
I have done this on my feature branch since it made some things easier. I'll post the patch tomorrow after I rebase it to ToT.
Comment 1 BJ Burg 2014-01-21 13:34:55 PST
Created attachment 221781 [details]
WIP - needs rebase, CrossThreadTask broke
Comment 2 BJ Burg 2014-01-21 15:44:16 PST
Created attachment 221797 [details]
mostly done, one fail yet
Comment 3 BJ Burg 2014-01-21 15:49:13 PST
Currently stuck on what to do about WorkerThreadableWebSocketChannel::Peer. The lifetime management is pretty hacky and relied on PassOwnPtr destructors, and blindly converting to unique_ptr won't work because the copy constructor is being called somehow.

I'd appreciate any help. The relevant error:


/Users/bburg/repos/webkit_/OpenSource/Source/WebCore/dom/CrossThreadTask.h
/Users/bburg/repos/webkit_/OpenSource/Source/WebCore/dom/CrossThreadTask.h:341:37: Call to implicitly-deleted copy constructor of 'std::unique_ptr<Peer>'
/Users/bburg/repos/webkit_/OpenSource/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:38:10: In file included from /Users/bburg/repos/webkit_/OpenSource/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:38:
/Users/bburg/repos/webkit_/OpenSource/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:372:45: In instantiation of function template specialization 'WebCore::createCallbackTask<std::__1::unique_ptr<WebCore::WorkerThreadableWebSocketChannel::Peer, std::__1::default_delete<WebCore::WorkerThreadableWebSocketChannel::Peer> >, std::__1::unique_ptr<WebCore::WorkerThreadableWebSocketChannel::Peer, std::__1::default_delete<WebCore::WorkerThreadableWebSocketChannel::Peer> > >' requested here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2572:31: Copy constructor is implicitly deleted because 'unique_ptr<WebCore::WorkerThreadableWebSocketChannel::Peer, std::__1::default_delete<WebCore::WorkerThreadableWebSocketChannel::Peer> >' has a user-declared move constructor
/Users/bburg/repos/webkit_/OpenSource/Source/WebCore/platform/CrossThreadCopier.h:116:59: Passing argument to parameter 'uniquePtr' here
Comment 4 BJ Burg 2014-03-28 15:53:53 PDT
unassigning, I think many of these have been fixed already in the meantime by :zdobersek
Comment 5 Darin Adler 2015-04-20 10:04:36 PDT
Lets not keep this bug open because, as Brian said, many of these are done already. We will come back to any of these that remain as we hit the final stretch of getting rid of OwnPtr.