Bug 217233 - [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector is about to close
Summary: [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector is about t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Blaze Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-02 10:20 PDT by Blaze Burg
Modified: 2020-10-04 14:47 PDT (History)
7 users (show)

See Also:


Attachments
Patch (12.34 KB, patch)
2020-10-02 11:06 PDT, Blaze Burg
no flags Details | Formatted Diff | Diff
Patch (12.93 KB, patch)
2020-10-04 13:06 PDT, Blaze 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 Blaze Burg 2020-10-02 10:20:09 PDT
.
Comment 1 Blaze Burg 2020-10-02 11:06:03 PDT
Created attachment 410341 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-10-02 11:06:41 PDT
<rdar://problem/69888193>
Comment 3 Devin Rousso 2020-10-02 11:52:14 PDT
Comment on attachment 410341 [details]
Patch

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

r=me as well :)

> Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp:522
> +    // Guard against calls to close() made by the client while already closing.

Should we have something similar for `show()` too?

Also, can we make an API test for this?

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorDelegate.mm:122
> +TEST(WKInspectorDelegate, WillCloseLocalInspector)

IMO why not just combine these two tests and call it something like "OpenCloseLifecycle"?
Comment 4 Blaze Burg 2020-10-04 09:16:04 PDT
Comment on attachment 410341 [details]
Patch

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

>> Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp:522
>> +    // Guard against calls to close() made by the client while already closing.
> 
> Should we have something similar for `show()` too?
> 
> Also, can we make an API test for this?

OK

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorDelegate.mm:122
>> +TEST(WKInspectorDelegate, WillCloseLocalInspector)
> 
> IMO why not just combine these two tests and call it something like "OpenCloseLifecycle"?

I want to isolate the Browser domain callbacks as that could break independently of the UIDelegate methods.
Comment 5 Blaze Burg 2020-10-04 13:06:30 PDT
Created attachment 410481 [details]
Patch
Comment 6 EWS 2020-10-04 14:47:16 PDT
Committed r267950: <https://trac.webkit.org/changeset/267950>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410481 [details].