Bug 231221 - Replace document.topDocument().securityOrigin() with document.topOrigin()
Summary: Replace document.topDocument().securityOrigin() with document.topOrigin()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-05 02:07 PDT by Tim Nguyen (:ntim)
Modified: 2021-10-05 04:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (6.84 KB, patch)
2021-10-05 02:26 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (7.62 KB, patch)
2021-10-05 03:01 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2021-10-05 02:07:40 PDT
Document::topOrigin() is defined as:

SecurityOrigin& topOrigin() const final { return topDocument().securityOrigin(); }
Comment 1 Tim Nguyen (:ntim) 2021-10-05 02:26:11 PDT
Created attachment 440185 [details]
Patch
Comment 2 youenn fablet 2021-10-05 02:29:28 PDT
Comment on attachment 440185 [details]
Patch

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

> Source/WebCore/dom/DocumentStorageAccess.cpp:92
> +    auto& topSecurityOrigin = m_document.topOrigin();

topSecurityOrigin is only used once, can we remove this variable?

> Source/WebCore/dom/DocumentStorageAccess.cpp:162
> +    auto& topSecurityOrigin = m_document.topOrigin();

Ditto for both topSecurityOrigin and topDocument
Comment 3 Tim Nguyen (:ntim) 2021-10-05 03:01:26 PDT
Created attachment 440191 [details]
Patch
Comment 4 EWS 2021-10-05 04:00:04 PDT
Committed r283544 (242509@main): <https://commits.webkit.org/242509@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440191 [details].
Comment 5 Radar WebKit Bug Importer 2021-10-05 04:01:21 PDT
<rdar://problem/83880206>