Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h

Issue 2923563003: Move container policy logic to frame owner classes. (Closed)
Patch Set: Addressing nits Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void FrameOwnerPropertiesChanged(); 119 void FrameOwnerPropertiesChanged();
120 120
121 // Return the origin which is to be used for feature policy container 121 // Return the origin which is to be used for feature policy container
122 // policies, as "the origin of the URL in the frame's src attribute" (see 122 // policies, as "the origin of the URL in the frame's src attribute" (see
123 // https://wicg.github.io/feature-policy/#iframe-allow-attribute). 123 // https://wicg.github.io/feature-policy/#iframe-allow-attribute).
124 // This method is intended to be overridden by specific frame classes. 124 // This method is intended to be overridden by specific frame classes.
125 virtual RefPtr<SecurityOrigin> GetOriginForFeaturePolicy() const { 125 virtual RefPtr<SecurityOrigin> GetOriginForFeaturePolicy() const {
126 return SecurityOrigin::CreateUnique(); 126 return SecurityOrigin::CreateUnique();
127 } 127 }
128 128
129 // Construct a new feature policy container policy for this frame, based on 129 // Return a feature policy container policy for this frame, based on the
130 // the frame attributes and the effective origin specified in the frame 130 // frame attributes and the effective origin specified in the frame
131 // attributes. 131 // attributes.
132 virtual Vector<WebParsedFeaturePolicyDeclaration> ConstructContainerPolicy()
133 const = 0;
134
135 // Update the container policy and notify the frame loader client of any
136 // changes.
132 void UpdateContainerPolicy(); 137 void UpdateContainerPolicy();
133 138
134 private: 139 private:
135 // Intentionally private to prevent redundant checks when the type is 140 // Intentionally private to prevent redundant checks when the type is
136 // already HTMLFrameOwnerElement. 141 // already HTMLFrameOwnerElement.
137 bool IsLocal() const final { return true; } 142 bool IsLocal() const final { return true; }
138 bool IsRemote() const final { return false; } 143 bool IsRemote() const final { return false; }
139 144
140 bool IsFrameOwnerElement() const final { return true; } 145 bool IsFrameOwnerElement() const final { return true; }
141 146
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 197
193 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, 198 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement,
194 FrameOwner, 199 FrameOwner,
195 owner, 200 owner,
196 owner->IsLocal(), 201 owner->IsLocal(),
197 owner.IsLocal()); 202 owner.IsLocal());
198 203
199 } // namespace blink 204 } // namespace blink
200 205
201 #endif // HTMLFrameOwnerElement_h 206 #endif // HTMLFrameOwnerElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698