Bug 208391 - [WinCairo][PlayStation] Add interface to get listening port of RemoteInspectorServer
Summary: [WinCairo][PlayStation] Add interface to get listening port of RemoteInspecto...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 208349
  Show dependency treegraph
 
Reported: 2020-02-28 13:58 PST by Basuke Suzuki
Modified: 2020-03-03 12:25 PST (History)
13 users (show)

See Also:


Attachments
PATCH (2.66 KB, patch)
2020-03-03 10:48 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff
PATCH (2.66 KB, patch)
2020-03-03 11:35 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basuke Suzuki 2020-02-28 13:58:07 PST
Current implementation cannot allow client to specify server address to listen. It is safe to specify "127.0.0.1" when no access from outside is needed. Also if server picks port number available, it is also handy.
Comment 1 Basuke Suzuki 2020-03-03 10:44:46 PST
Change the title. Now client can get the listening port when passing zero as a port number to allow system to pick an available port.
Comment 2 Basuke Suzuki 2020-03-03 10:48:51 PST
Created attachment 392296 [details]
PATCH
Comment 3 Ross Kirsling 2020-03-03 10:53:58 PST
Comment on attachment 392296 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:61
> +    if (isRunning())
> +        return WTF::nullopt;

Shouldn't this condition be negative?
Comment 4 Ross Kirsling 2020-03-03 10:56:02 PST
Comment on attachment 392296 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:52
>      auto& endpoint = Inspector::RemoteInspectorSocketEndpoint::singleton();
> +    if (isRunning())
> +        return false;

Also it seems like the early out can precede the declaration here.
Comment 5 Don Olmstead 2020-03-03 11:00:05 PST
Comment on attachment 392296 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:53
> +    if (isRunning())
> +        return false;
> +

Shouldn't this go at the start? You don't use endpoint before this check.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h:42
> +    JS_EXPORT_PRIVATE Optional<uint16_t> RemoteInspectorServer::getPort();

Copy pasta error?
Comment 6 Basuke Suzuki 2020-03-03 11:26:10 PST
Comment on attachment 392296 [details]
PATCH

Sorry for too many casual mistake.
Comment 7 Basuke Suzuki 2020-03-03 11:35:49 PST
Created attachment 392304 [details]
PATCH

I got a coffee. My brain is now working.
Comment 8 WebKit Commit Bot 2020-03-03 12:24:15 PST
Comment on attachment 392304 [details]
PATCH

Clearing flags on attachment: 392304

Committed r257795: <https://trac.webkit.org/changeset/257795>
Comment 9 WebKit Commit Bot 2020-03-03 12:24:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2020-03-03 12:25:17 PST
<rdar://problem/60007846>