Bug 204503 - [GTK][WPE] RemoteInspector: use sockets instead of DBus
Summary: [GTK][WPE] RemoteInspector: use sockets instead of DBus
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2019-11-22 03:34 PST by Carlos Garcia Campos
Modified: 2019-11-27 00:41 PST (History)
22 users (show)

See Also:


Attachments
Patch (108.75 KB, patch)
2019-11-22 03:42 PST, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2019-11-22 03:34:51 PST
It turns out DBus is event slower than expected. Using GSockets API we can simplify the code and make it a lot more efficient. This will drastically reduce the time to run WebDriver tests in the bots.
Comment 1 Carlos Garcia Campos 2019-11-22 03:42:35 PST
Created attachment 384141 [details]
Patch
Comment 2 Konstantin Tokarev 2019-11-22 05:45:31 PST
Will it be protocol-compatible with generic implementation in inspector/remote/socket?
Comment 3 Zan Dobersek 2019-11-22 06:06:03 PST
Comment on attachment 384141 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384141&action=review

> Source/WTF/wtf/glib/SocketConnection.cpp:125
> +        memmove(m_readBuffer.data(), m_readBuffer.data() + messageSize, m_readBuffer.size() - messageSize);

This could be std::memmove().

> Source/WTF/wtf/glib/SocketConnection.cpp:175
> +        memmove(m_writeBuffer.data(), m_writeBuffer.data() + bytesWritten, m_writeBuffer.size() - bytesWritten);

And this too.
Comment 4 Carlos Garcia Campos 2019-11-22 06:16:15 PST
(In reply to Konstantin Tokarev from comment #2)
> Will it be protocol-compatible with generic implementation in
> inspector/remote/socket?

No, the message format is different.
Comment 5 Carlos Garcia Campos 2019-11-22 06:22:47 PST
Committed r252770: <https://trac.webkit.org/changeset/252770>
Comment 6 Ross Kirsling 2019-11-26 11:33:50 PST
(In reply to Carlos Garcia Campos from comment #4)
> (In reply to Konstantin Tokarev from comment #2)
> > Will it be protocol-compatible with generic implementation in
> > inspector/remote/socket?
> 
> No, the message format is different.

How can we address this? It's really wasteful and unfortunate to have GTK/WPE move from DBus to sockets only to use a different implementation from the one that's meant for generic use. Basuke has had the socket-based inspector working downstream on GTK port for a long time, it just was higher-priority for us to get the WinCairo / PlayStation parts upstreamed first. Hopefully we can work together to realize a common solution.
Comment 7 Carlos Garcia Campos 2019-11-27 00:41:00 PST
We want to keep using GVariant for the message parameters, it's a lot more convenient when sending complex data, and probably more efficient too.