Title: [255562] trunk/Source/WebCore
Revision
255562
Author
[email protected]
Date
2020-02-03 08:25:38 -0800 (Mon, 03 Feb 2020)

Log Message

Do not copy feature policy in isFeaturePolicyAllowedByDocumentAndAllOwners
https://bugs.webkit.org/show_bug.cgi?id=207110

Reviewed by Eric Carlson.

Use auto& instead of auto to not copy the feature policy object.
Add some auto* to improve code readability.
No change of behavior.

* html/FeaturePolicy.cpp:
(WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (255561 => 255562)


--- trunk/Source/WebCore/ChangeLog	2020-02-03 16:23:48 UTC (rev 255561)
+++ trunk/Source/WebCore/ChangeLog	2020-02-03 16:25:38 UTC (rev 255562)
@@ -1,3 +1,17 @@
+2020-02-03  youenn fablet  <[email protected]>
+
+        Do not copy feature policy in isFeaturePolicyAllowedByDocumentAndAllOwners
+        https://bugs.webkit.org/show_bug.cgi?id=207110
+
+        Reviewed by Eric Carlson.
+
+        Use auto& instead of auto to not copy the feature policy object.
+        Add some auto* to improve code readability.
+        No change of behavior.
+
+        * html/FeaturePolicy.cpp:
+        (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):
+
 2020-02-03  Zan Dobersek  <[email protected]>
 
         Use std::hypot() where possible

Modified: trunk/Source/WebCore/html/FeaturePolicy.cpp (255561 => 255562)


--- trunk/Source/WebCore/html/FeaturePolicy.cpp	2020-02-03 16:23:48 UTC (rev 255561)
+++ trunk/Source/WebCore/html/FeaturePolicy.cpp	2020-02-03 16:25:38 UTC (rev 255562)
@@ -39,14 +39,14 @@
 bool isFeaturePolicyAllowedByDocumentAndAllOwners(FeaturePolicy::Type type, const Document& document)
 {
     auto& topDocument = document.topDocument();
-    auto ancestorDocument = &document;
+    auto* ancestorDocument = &document;
     while (ancestorDocument != &topDocument) {
         if (!ancestorDocument)
             return false;
 
-        auto ownerElement = ancestorDocument->ownerElement();
+        auto* ownerElement = ancestorDocument->ownerElement();
         if (is<HTMLIFrameElement>(ownerElement)) {
-            auto featurePolicy = downcast<HTMLIFrameElement>(ownerElement)->featurePolicy();
+            const auto& featurePolicy = downcast<HTMLIFrameElement>(ownerElement)->featurePolicy();
             if (!featurePolicy.allows(type, ancestorDocument->securityOrigin().data()))
                 return false;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to