Bug 199070

Summary: [WinCairo][PlayStation] Add automation support for RemoteInspector SocketServer implementation.
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: PlatformAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: Basuke.Suzuki, cgarcia, chris.reid, commit-queue, ews-watchlist, hi, joepeck, keith_miller, mark.lam, mcatanzaro, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
PATCH
none
PATCH
none
PATCH none

Description Basuke Suzuki 2019-06-20 10:35:15 PDT
Add basic implementation of automation for RemoteInspector socket server backend.
Comment 1 Basuke Suzuki 2019-10-11 11:46:34 PDT
Created attachment 380774 [details]
PATCH
Comment 2 Basuke Suzuki 2019-10-11 11:49:29 PDT
Created attachment 380775 [details]
PATCH
Comment 3 Basuke Suzuki 2019-10-11 12:03:39 PDT
Basically following GTK implementation.
Comment 4 Ross Kirsling 2019-10-11 14:16:52 PDT
Comment on attachment 380775 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:200
> +    if (!m_client)
> +        return;
> +
> +    if (!m_clientCapabilities || !m_clientCapabilities->remoteAutomationAllowed)
> +        return;
> +
> +    if (sessionID.isNull())
> +        return;

Not sure that we need three separate conditionals here.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:359
> +    String sessionID = *event.message;
> +    requestAutomationSession(WTFMove(sessionID), { });

This style is a bit confusing. At the least, I think `event.message.value()` would be more readable, but I also wonder if it's worth making the new requestAutomationSession take const String& instead, so that we wouldn't have to explicitly copy.
Comment 5 Basuke Suzuki 2019-10-15 12:40:53 PDT
Comment on attachment 380775 [details]
PATCH

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

>> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:200
>> +        return;
> 
> Not sure that we need three separate conditionals here.

Latter two are runtime check which caused by configuration so I'll add different LOG_ERROR to them. First one is the correct check which caused by timing and required check.

>> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:359
>> +    requestAutomationSession(WTFMove(sessionID), { });
> 
> This style is a bit confusing. At the least, I think `event.message.value()` would be more readable, but I also wonder if it's worth making the new requestAutomationSession take const String& instead, so that we wouldn't have to explicitly copy.

Right. I'll change this to const String& because last step of this function calls may ended up with const String& and using `move` here is meaningless.
Comment 6 Basuke Suzuki 2019-10-15 12:41:23 PDT
Created attachment 381013 [details]
PATCH
Comment 7 Ross Kirsling 2019-10-21 10:37:48 PDT
Comment on attachment 381013 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/RemoteInspector.h:152
> +    void requestAutomationSession(const String& sessionID, const Client::SessionCapabilities&);

Final nit: I guess the string name can be omitted here.
Comment 8 Basuke Suzuki 2019-10-21 11:30:51 PDT
Comment on attachment 381013 [details]
PATCH

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

Thanks!

>> Source/JavaScriptCore/inspector/remote/RemoteInspector.h:152
>> +    void requestAutomationSession(const String& sessionID, const Client::SessionCapabilities&);
> 
> Final nit: I guess the string name can be omitted here.

No I don't think so. General types such as bool, int or String should have its name to make it meaningful.
Comment 9 WebKit Commit Bot 2019-10-21 12:25:59 PDT
Comment on attachment 381013 [details]
PATCH

Clearing flags on attachment: 381013

Committed r251373: <https://trac.webkit.org/changeset/251373>
Comment 10 WebKit Commit Bot 2019-10-21 12:26:01 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-10-21 12:26:20 PDT
<rdar://problem/56472064>