RESOLVED FIXED 138018
[WK2] Use C++ lambdas in IPC::Connection
https://bugs.webkit.org/show_bug.cgi?id=138018
Summary [WK2] Use C++ lambdas in IPC::Connection
Zan Dobersek
Reported 2014-10-23 13:31:04 PDT
[WK2] Remove uses of WTF::bind() in IPC::Connection
Attachments
Patch (10.15 KB, patch)
2014-10-23 13:37 PDT, Zan Dobersek
no flags
Patch (10.39 KB, patch)
2014-10-29 14:13 PDT, Zan Dobersek
no flags
Patch (11.98 KB, patch)
2014-11-14 03:07 PST, Zan Dobersek
no flags
Patch (9.88 KB, patch)
2015-01-19 02:13 PST, Zan Dobersek
no flags
Patch (10.27 KB, patch)
2015-03-08 12:49 PDT, Zan Dobersek
no flags
Patch (10.97 KB, patch)
2015-03-09 04:29 PDT, Zan Dobersek
no flags
Patch (10.55 KB, patch)
2015-03-10 02:39 PDT, Zan Dobersek
no flags
Patch (10.86 KB, patch)
2015-03-10 04:16 PDT, Zan Dobersek
andersca: review+
Zan Dobersek
Comment 1 2014-10-23 13:37:30 PDT
Zan Dobersek
Comment 2 2014-10-29 14:13:49 PDT
Zan Dobersek
Comment 3 2014-11-10 04:29:59 PST
Comment on attachment 240621 [details] Patch Clearing flags on attachment: 240621 Committed r175806: <http://trac.webkit.org/changeset/175806>
Zan Dobersek
Comment 4 2014-11-10 04:30:07 PST
All reviewed patches have been landed. Closing bug.
Antti Koivisto
Comment 5 2014-11-10 07:46:03 PST
Comment on attachment 240621 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240621&action=review > Source/WebKit2/Platform/IPC/Connection.cpp:647 > + CString messageReceiverName = message->messageReceiverName().isEmpty() ? "<unknown message>" : message->messageReceiverName().toString(); > + CString messageName = message->messageName().isEmpty() ? String::format("<message length: %zu bytes>", message->length()).utf8() : message->messageReceiverName().toString(); > + > + RefPtr<Connection> protectedThis(this); > + m_clientRunLoop.dispatch([protectedThis, messageReceiverName, messageName] { Is m_clientRunLoop the current run loop? If not the capture of messageReceiverName and messageName does not look thread safe. You could use StringCapture instead. > Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm:516 > + CString messageReceiverNameString = decoder->messageReceiverName().toString(); > + CString messageNameString = decoder->messageName().toString(); > + m_clientRunLoop.dispatch([protectedThis, messageReceiverNameString, messageNameString] { > + protectedThis->dispatchDidReceiveInvalidMessage(messageReceiverNameString, messageNameString); > + }); Here too.
Zan Dobersek
Comment 6 2014-11-11 04:01:18 PST
Comment on attachment 240621 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240621&action=review >> Source/WebKit2/Platform/IPC/Connection.cpp:647 >> + m_clientRunLoop.dispatch([protectedThis, messageReceiverName, messageName] { > > Is m_clientRunLoop the current run loop? If not the capture of messageReceiverName and messageName does not look thread safe. You could use StringCapture instead. Can we avoid formatting the "<message length ...>" string and use something static instead? That way we wouldn't have to handle CStrings at all, and could capture StringReference objects instead.
WebKit Commit Bot
Comment 7 2014-11-12 13:45:55 PST
Re-opened since this is blocked by bug 138666
Zan Dobersek
Comment 8 2014-11-14 03:07:24 PST
Zan Dobersek
Comment 9 2015-01-19 02:13:22 PST
Anders Carlsson
Comment 10 2015-01-19 15:32:05 PST
Comment on attachment 244888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244888&action=review > Source/WebKit2/Platform/IPC/Connection.cpp:646 > + m_clientRunLoop.dispatch([protectedThis, messageReceiverName, messageName] { > + protectedThis->dispatchDidReceiveInvalidMessage(messageReceiverName, messageName); > + }); messageReceiverName and messageName could point to into a MessageDecoder that has been freed here.
Zan Dobersek
Comment 11 2015-03-08 12:49:11 PDT
Zan Dobersek
Comment 12 2015-03-09 03:58:52 PDT
Comment on attachment 248196 [details] Patch Doesn't yet build.
Zan Dobersek
Comment 13 2015-03-09 04:29:54 PDT
Zan Dobersek
Comment 14 2015-03-10 02:39:33 PDT
Zan Dobersek
Comment 15 2015-03-10 04:16:04 PDT
Zan Dobersek
Comment 16 2015-03-10 12:34:18 PDT
Comment on attachment 248326 [details] Patch This finally compiles everywhere, so I'm setting the r? flag.
Anders Carlsson
Comment 17 2015-03-13 08:25:23 PDT
Comment on attachment 248326 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=248326&action=review > Source/WebKit2/Platform/IPC/Connection.cpp:348 > // Reset the client. Can remove this comment.
Zan Dobersek
Comment 18 2015-03-17 03:05:10 PDT
Note You need to log in before you can comment on or make changes to this bug.