Bug 200571

Summary: Pass a ScriptExecutionContext as input to register/unregister URLRegistry routines
Product: WebKit Reporter: youenn fablet <youennf>
Component: Page LoadingAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, cdumez, commit-queue, darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 200567    
Attachments:
Description Flags
Patch
none
Rebasing none

Description youenn fablet 2019-08-09 05:10:40 PDT
Pass a ScriptExecutionContext as input to register/unregister URLRegistry routines
Comment 1 youenn fablet 2019-08-09 05:12:34 PDT
Created attachment 375907 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2019-08-09 06:31:54 PDT
<rdar://problem/54123571>
Comment 3 Darin Adler 2019-08-09 09:31:02 PDT
Comment on attachment 375907 [details]
Patch

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

> Source/WebCore/html/PublicURLManager.cpp:54
> +    found->key->registerURL(*scriptExecutionContext(), url, registrable);

What guarantees it’s non-null?

> Source/WebCore/html/PublicURLManager.cpp:62
> +            registry.key->unregisterURL(*scriptExecutionContext(), url);

What guarantees it’s non-null?

> Source/WebCore/html/PublicURLManager.cpp:77
> +            registry.key->unregisterURL(*scriptExecutionContext(), URL({ }, url));

What guarantees it’s non-null?
Comment 4 youenn fablet 2019-08-09 13:32:46 PDT
Thanks for the review.

(In reply to Darin Adler from comment #3)
> Comment on attachment 375907 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=375907&action=review
> 
> > Source/WebCore/html/PublicURLManager.cpp:54
> > +    found->key->registerURL(*scriptExecutionContext(), url, registrable);
> 
> What guarantees it’s non-null?

PublicURLManager is an ActiveDOMObject and all call sites doing '*scriptExecutionContext()' cannot be called after the manager is stopped or are no-op once the manager is stopped (all urls are cleared).
Comment 5 youenn fablet 2019-08-09 13:33:34 PDT
Created attachment 375945 [details]
Rebasing
Comment 6 WebKit Commit Bot 2019-08-09 13:55:12 PDT
Comment on attachment 375945 [details]
Rebasing

Clearing flags on attachment: 375945

Committed r248473: <https://trac.webkit.org/changeset/248473>
Comment 7 WebKit Commit Bot 2019-08-09 13:55:14 PDT
All reviewed patches have been landed.  Closing bug.