Bug 234184 - ContextDestructionObserver::m_scriptExecutionContext should be private
Summary: ContextDestructionObserver::m_scriptExecutionContext should be private
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-10 15:56 PST by Chris Dumez
Modified: 2021-12-11 16:31 PST (History)
22 users (show)

See Also:


Attachments
Patch (31.89 KB, patch)
2021-12-10 15:58 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (31.89 KB, patch)
2021-12-11 15:26 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-12-10 15:56:05 PST
ContextDestructionObserver::m_scriptExecutionContext should be private. It is poor encapsulation to have protected data members.
Comment 1 Chris Dumez 2021-12-10 15:58:02 PST
Created attachment 446836 [details]
Patch
Comment 2 youenn fablet 2021-12-11 09:16:03 PST
Comment on attachment 446836 [details]
Patch

Some pre-existing places are using *scriptExecutionContext() and it is not clear whether it is guaranteed to not be null.

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

> Source/WebCore/Modules/encryptedmedia/MediaKeySystemRequest.cpp:65
> +    auto context = scriptExecutionContext();

auto*
Comment 3 Chris Dumez 2021-12-11 15:26:04 PST
Created attachment 446908 [details]
Patch
Comment 4 EWS 2021-12-11 16:30:17 PST
Committed r286918 (245144@main): <https://commits.webkit.org/245144@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446908 [details].
Comment 5 Radar WebKit Bug Importer 2021-12-11 16:31:18 PST
<rdar://problem/86370839>