|
|
Created:
3 years, 11 months ago by iclelland Modified:
3 years, 9 months ago Reviewers:
haraken, raymes, Mike West, pfeldman, dcheng CC:
chromium-reviews, eae+blinkwatch, lunalu1, kinuko+watch, rwlbuis, jam, blink-reviews-dom_chromium.org, dglazkov+blink, darin-cc_chromium.org, gavinp+loader_chromium.org, blink-reviews, blink-reviews-bindings_chromium.org, loading-reviews_chromium.org, gogerald+paymentswatch_chromium.org, sof, rouslan+payments_chromium.org, Nate Chapin, tyoshino+watch_chromium.org, mlamouri+watch-blink_chromium.org, blink-reviews-api_chromium.org, mvanouwerkerk+watch_chromium.org, sebsg+paymentswatch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMake content::FeaturePolicy implement of WebFeaturePolicy, and use it in blink code
This is part 4 of 5 in the effort to move the FeaturePolicy implementation
into the content layer, which will facilitate use of the framework for browser-
based policy decisions.
See the other CLs in this series:
[1/5] https://codereview.chromium.org/2648423002/ (Rename classes)
[2/5] https://codereview.chromium.org/2654873004/ (Centralize content-side code)
[3/5] https://codereview.chromium.org/2655663004/ (Maintain parallel FP in browser)
[4/5] (This CL) (Use content/ FP in blink)
[5/5] https://codereview.chromium.org/2656533004/ (Remove unused blink code.)
BUG=685195
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2651883008
Cr-Commit-Position: refs/heads/master@{#454949}
Committed: https://chromium.googlesource.com/chromium/src/+/4a6080201a29001f398861f94f8a473d646facd2
Patch Set 1 #Patch Set 2 : Export symbols from blink platform correctly #Patch Set 3 : Rebase #Patch Set 4 : Update FP origin when document origin is updated during tests #Patch Set 5 : Remove DCHECK, it's okay to call updateSecurityOrigin before FP created #Patch Set 6 : Rebsae #Patch Set 7 : Also update FP origin in PaymentRequestDetailsTest #Patch Set 8 : Shrink the platform API to just "Is this feature enabled by policy" #Patch Set 9 : Don't use BLINK_PLATFORM_EXPORT on enum class #Patch Set 10 : Cleanup #
Total comments: 18
Patch Set 11 : Code review #Patch Set 12 : Rebase, update to include container policies as well. #Patch Set 13 : Rebasing intensifies... #
Total comments: 4
Patch Set 14 : Rebase some more #Patch Set 15 : Move methods out of platform #Patch Set 16 : Test through conditionalfeatures again #Patch Set 17 : Duplicate FP object rather than modifying in-place #
Total comments: 5
Created: 3 years, 9 months ago
Dependent Patchsets: Messages
Total messages: 103 (79 generated)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Make content::FeaturePolicy an instance of WebFeaturePolicy, and use it in blink code BUG= ========== to ========== Make content::FeaturePolicy an instance of WebFeaturePolicy, and use it in blink code This is part 4 of 5 in the effort to move the FeaturePolicy implementation into the content layer, which will facilitate use of the framework for browser- based policy decisions. See the other CLs in this series: [1/5] https://codereview.chromium.org/2648423002/ (Rename classes) [2/5] https://codereview.chromium.org/2654873004/ (Centralize content-side code) [3/5] https://codereview.chromium.org/2655663004/ (Maintain parallel FP in browser) [4/5] (This CL) (Use content/ FP in blink) [5/5] https://codereview.chromium.org/2656533004/ (Remove unused blink code.) BUG=685195 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation ==========
iclelland@chromium.org changed reviewers: + raymes@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Description was changed from ========== Make content::FeaturePolicy an instance of WebFeaturePolicy, and use it in blink code This is part 4 of 5 in the effort to move the FeaturePolicy implementation into the content layer, which will facilitate use of the framework for browser- based policy decisions. See the other CLs in this series: [1/5] https://codereview.chromium.org/2648423002/ (Rename classes) [2/5] https://codereview.chromium.org/2654873004/ (Centralize content-side code) [3/5] https://codereview.chromium.org/2655663004/ (Maintain parallel FP in browser) [4/5] (This CL) (Use content/ FP in blink) [5/5] https://codereview.chromium.org/2656533004/ (Remove unused blink code.) BUG=685195 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation ========== to ========== Make content::FeaturePolicy implement of WebFeaturePolicy, and use it in blink code This is part 4 of 5 in the effort to move the FeaturePolicy implementation into the content layer, which will facilitate use of the framework for browser- based policy decisions. See the other CLs in this series: [1/5] https://codereview.chromium.org/2648423002/ (Rename classes) [2/5] https://codereview.chromium.org/2654873004/ (Centralize content-side code) [3/5] https://codereview.chromium.org/2655663004/ (Maintain parallel FP in browser) [4/5] (This CL) (Use content/ FP in blink) [5/5] https://codereview.chromium.org/2656533004/ (Remove unused blink code.) BUG=685195 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation ==========
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
+r raymes -- I forgot that this one wasn't actually sent, oops :( Can you PTAL? I expect there are a bunch of nits; I'm going to try to clean it up tomorrow, but wanted to get this out before your weekend. This actually makes use of the content::FeaturePolicy object (as the implementation of a WebFeaturePolicy) in blink, so that we have only one implementation for both browser and renderer. Thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks Ian! https://codereview.chromium.org/2651883008/diff/180001/content/common/feature... File content/common/feature_policy/feature_policy.cc (right): https://codereview.chromium.org/2651883008/diff/180001/content/common/feature... content/common/feature_policy/feature_policy.cc:141: // https://crbug.com/690520 I put a question on the bug about this. I'm wondering if we can avoid needing to handle unique origins? https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:155: if (!RuntimeEnabledFeatures::featurePolicyEnabled() || !frame) { Currently the only callsites I see for this check that FP is enabled prior to calling this function. Maybe some of these changes could be put into an orthogonal CL? https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:161: return (isSameOriginSubframe || This might be a bit simpler to read as: if (isSameOriginSubframe) { return feature != WebFeaturePolicyFeature::x && feature != WebFeaturePolicyFeature::y; } https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:162: !(feature == WebFeaturePolicyFeature::Fullscreen || Does this mean fullscreen won't work at all in a cross-origin iframe? Shouldn't it work if the attribute is provided? Same with payments? https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:163: feature == WebFeaturePolicyFeature::Geolocation || Should geolocation be here? https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:114: void SecurityContext::updateFeaturePolicyOrigin() { Should we just call this from setSecurityOrigin instead? Would that provide more of a guarantee that things would be in-sync? https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:118: m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); Do you know under what circumstances we can change the security origin at runtime? I haven't thought hard about this case, I hope it doesn't violate our assumptions :) https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp (left): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp:3: // found in the LICENSE file. I may have asked this before, but are we losing significant coverage with this being dropped? (I don't necessarily think we are but just want to make sure we've considered it :) https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp (right): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp:172: document.updateSecurityOrigin( Are there other places that call setSecurityOrigin that should call updateSecurityOrigin? Should setSecurityOrigin be private now? (These are genuine questions since I don't know this code at all really :)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2651883008/diff/180001/content/common/feature... File content/common/feature_policy/feature_policy.cc (right): https://codereview.chromium.org/2651883008/diff/180001/content/common/feature... content/common/feature_policy/feature_policy.cc:141: // https://crbug.com/690520 On 2017/02/13 04:45:22, raymes wrote: > I put a question on the bug about this. I'm wondering if we can avoid needing to > handle unique origins? I don't know if we can -- they are going to need *some* kind of a policy, even if it's the default one. If we can, then I'll have to update the test framework to ensure that a dummy page always has a valid origin; the fullscreen tests were failing for a while because of this. Sandboxed frames are going to be the real issue, here, I think: Not so much data or file urls. (Although I'm sure there are uses for each of those as well, that's a policy rather than a technical issue, once we allow it in sandbox.) https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:155: if (!RuntimeEnabledFeatures::featurePolicyEnabled() || !frame) { On 2017/02/13 04:45:22, raymes wrote: > Currently the only callsites I see for this check that FP is enabled prior to > calling this function. Maybe some of these changes could be put into an > orthogonal CL? Agreed; most of this should be removed; when feature policy is disabled, this shouldn't be called at all. That will simplify a lot of the code, including the awkward edge-case handling below. https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:161: return (isSameOriginSubframe || On 2017/02/13 04:45:22, raymes wrote: > This might be a bit simpler to read as: > if (isSameOriginSubframe) { > return feature != WebFeaturePolicyFeature::x && > feature != WebFeaturePolicyFeature::y; > } > Done. https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:162: !(feature == WebFeaturePolicyFeature::Fullscreen || On 2017/02/13 04:45:22, raymes wrote: > Does this mean fullscreen won't work at all in a cross-origin iframe? Shouldn't > it work if the attribute is provided? Same with payments? That edge case actually isn't ever hit -- it was a rough "is this page cross origin" check for the features which are disabled by default in cross-origin frames (like vibrate), to handle the case when FeaturePolicy was not enabled. Fullscreen won't run this code, though, in that case; if FP is disabled, it just walks up the frame tree looking for 'allowfullscreen' attributes on frame owners. Same with payments. This is really just for vibrate. (And then vibrate went ahead and used the runtime feature check, so this whole block is unused now.) https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:163: feature == WebFeaturePolicyFeature::Geolocation || On 2017/02/13 04:45:22, raymes wrote: > Should geolocation be here? It was just all of the features that had a default defined in the spec of ["self"]. https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:114: void SecurityContext::updateFeaturePolicyOrigin() { On 2017/02/13 04:45:22, raymes wrote: > Should we just call this from setSecurityOrigin instead? Would that provide more > of a guarantee that things would be in-sync? Yes. Done. https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:118: m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); On 2017/02/13 04:45:22, raymes wrote: > Do you know under what circumstances we can change the security origin at > runtime? I haven't thought hard about this case, I hope it doesn't violate our > assumptions :) There are a few odd scenarios around document.open (and write, by extension, I think). I'm not sure when else, but I'll do some spelunking in the code and see what I can find out. https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp (left): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp:3: // found in the LICENSE file. On 2017/02/13 04:45:22, raymes wrote: > I may have asked this before, but are we losing significant coverage with this > being dropped? (I don't necessarily think we are but just want to make sure > we've considered it :) I don't think we're losing significant coverage -- this test was for the composition of the policies created from blink code (which are now tested in content, because that's where they are created). It also tests the operation of the isFeatureEnabledInFrame code. If we reinstate this, and we could, just to make sure that isFeatureEnabledInFrame is covered, then we'd probably need to use real features, like fullscreen, rather than the DefaultOn/DefaultOff/DefaultSelf test features. (This test was removed because the set of features is now under the control of content, and it was no longer trivial to add new features from blink.) https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp (right): https://codereview.chromium.org/2651883008/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp:172: document.updateSecurityOrigin( On 2017/02/13 04:45:22, raymes wrote: > Are there other places that call setSecurityOrigin that should call > updateSecurityOrigin? Should setSecurityOrigin be private now? (These are > genuine questions since I don't know this code at all really :) That's actually a really good point -- Most of the calls to setSecurityOrigin seem to be in initialization methods, and those, I presume, shouldn't really be touched. Maybe the best solution here is to have setSecurityOrigin update the policy if necessary. (Done)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
iclelland@chromium.org changed reviewers: + pfeldman@chromium.org
+r pfeldman, can you PTAL? Thanks!
I can perform an owners review, but i'd prefer to see some l-g-t-m-s from reviewers familiar with the matter before i do so!
On 2017/02/27 17:07:49, pfeldman wrote: > I can perform an owners review, but i'd prefer to see some l-g-t-m-s from > reviewers familiar with the matter before i do so! Absolutely :) Hit the button on that too soon. Pinging Raymes, can you take a look again?
lgtm but it would be nice to have more clarity on the below comment before shipping. I think supporting unique origins is probably ok (we just need the proper code support which I know you're looking at :). https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); This still worries me a bit just because we've always thought about the policy as being tied to a single origin through its lifetime and I don't know what assumptions we're breaking when this happens. For example, a feature may be enabled in a frame, and the origin changes but we don't recheck the policy so it's still enabled. I guess it boils down to me not understanding the circumstances under which origins can change in a SecurityContext - it seems like it should be a rare thing. Either way, I defer on this point since I don't know the answer but I do think it would be good to feel more confident about it. Perhaps dcheng or mkwst can give better advice here?
On 2017/02/28 00:39:51, raymes wrote: > lgtm but it would be nice to have more clarity on the below comment before > shipping. > > I think supporting unique origins is probably ok (we just need the proper code > support which I know you're looking at :). > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: > m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); > This still worries me a bit just because we've always thought about the policy > as being tied to a single origin through its lifetime and I don't know what > assumptions we're breaking when this happens. > > For example, a feature may be enabled in a frame, and the origin changes but we > don't recheck the policy so it's still enabled. I guess it boils down to me not > understanding the circumstances under which origins can change in a > SecurityContext - it seems like it should be a rare thing. > > Either way, I defer on this point since I don't know the answer but I do think > it would be good to feel more confident about it. Perhaps dcheng or mkwst can > give better advice here? I filed https://bugs.chromium.org/p/chromium/issues/detail?id=696819 to track that. Thanks Ian!
iclelland@chromium.org changed reviewers: + dcheng@chromium.org, mkwst@chromium.org
https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); On 2017/02/28 00:39:51, raymes wrote: > This still worries me a bit just because we've always thought about the policy > as being tied to a single origin through its lifetime and I don't know what > assumptions we're breaking when this happens. > > For example, a feature may be enabled in a frame, and the origin changes but we > don't recheck the policy so it's still enabled. With this CL, we would recalculate the feature policy in this case, so there would have to be code in the renderer which is caching the result of isFeatureEnabled, rather than calling it each time. If it's possible for the policy to change in a way that would make that caching invalid, then we'll need to document that callers shoudn't cache the results of that method. . > This would have to be I guess it boils down to me not > understanding the circumstances under which origins can change in a > SecurityContext - it seems like it should be a rare thing. > > Either way, I defer on this point since I don't know the answer but I do think > it would be good to feel more confident about it. Perhaps dcheng or mkwst can > give better advice here? I believe, from reading specs and code, that post-document-creation, there are only a couple of ways that the document's origin could change: - Setting document.domain can update the domain properly - Using document.write or .open from *another* document sets the first document's origin to be the same as the second one's. That second technique is also restricted in code: the two documents need to already be same-scheme-host-port-and-suborigin, so I believe that the only properties of the origin that can reasonably change are the domain and some flags like m_universalAccess, m_canLoadLocalResources and m_blockLocalAccessFromLocalOrigin, which we don't use for FP decisions, and are not normally set on the open web. +r mkwst and dcheng for any more useful insight here -- are there other situations where the origin can change post-creation?
On 2017/02/28 05:25:56, iclelland wrote: > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: > m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); > On 2017/02/28 00:39:51, raymes wrote: > > This still worries me a bit just because we've always thought about the policy > > as being tied to a single origin through its lifetime and I don't know what > > assumptions we're breaking when this happens. > > > > For example, a feature may be enabled in a frame, and the origin changes but > we > > don't recheck the policy so it's still enabled. > > With this CL, we would recalculate the feature policy in this case, so there > would have to be code in the renderer which is caching the result of > isFeatureEnabled, rather than calling it each time. If it's possible for the > policy to change in a way that would make that caching invalid, then we'll need > to document that callers shoudn't cache the results of that method. > . > > This would have to be I guess it boils down to me not > > understanding the circumstances under which origins can change in a > > SecurityContext - it seems like it should be a rare thing. > > > > Either way, I defer on this point since I don't know the answer but I do think > > it would be good to feel more confident about it. Perhaps dcheng or mkwst can > > give better advice here? > > I believe, from reading specs and code, that post-document-creation, there are > only a couple of ways that the document's origin could change: > > - Setting document.domain can update the domain properly > - Using document.write or .open from *another* document sets the first > document's origin to be the same as the second one's. > > That second technique is also restricted in code: the two documents need to > already be same-scheme-host-port-and-suborigin, so I believe that the only > properties of the origin that can reasonably change are the domain and some > flags like m_universalAccess, m_canLoadLocalResources and > m_blockLocalAccessFromLocalOrigin, which we don't use for FP decisions, and are > not normally set on the open web. > > +r mkwst and dcheng for any more useful insight here -- are there other > situations where the origin can change post-creation? Thanks Ian - I think that makes sense.
On 2017/02/28 05:25:56, iclelland wrote: > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: > m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); > On 2017/02/28 00:39:51, raymes wrote: > > This still worries me a bit just because we've always thought about the policy > > as being tied to a single origin through its lifetime and I don't know what > > assumptions we're breaking when this happens. > > > > For example, a feature may be enabled in a frame, and the origin changes but > we > > don't recheck the policy so it's still enabled. > > With this CL, we would recalculate the feature policy in this case, so there > would have to be code in the renderer which is caching the result of > isFeatureEnabled, rather than calling it each time. If it's possible for the > policy to change in a way that would make that caching invalid, then we'll need > to document that callers shoudn't cache the results of that method. > . > > This would have to be I guess it boils down to me not > > understanding the circumstances under which origins can change in a > > SecurityContext - it seems like it should be a rare thing. > > > > Either way, I defer on this point since I don't know the answer but I do think > > it would be good to feel more confident about it. Perhaps dcheng or mkwst can > > give better advice here? > > I believe, from reading specs and code, that post-document-creation, there are > only a couple of ways that the document's origin could change: > > - Setting document.domain can update the domain properly > - Using document.write or .open from *another* document sets the first > document's origin to be the same as the second one's. > > That second technique is also restricted in code: the two documents need to > already be same-scheme-host-port-and-suborigin, so I believe that the only > properties of the origin that can reasonably change are the domain and some > flags like m_universalAccess, m_canLoadLocalResources and > m_blockLocalAccessFromLocalOrigin, which we don't use for FP decisions, and are > not normally set on the open web. > > +r mkwst and dcheng for any more useful insight here -- are there other > situations where the origin can change post-creation? I think this pretty much covers it, with one small correction: the three flags mentioned here should be set at security context initialization, and shouldn't dynamically change after that.
On 2017/02/28 06:19:05, dcheng wrote: > On 2017/02/28 05:25:56, iclelland wrote: > > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > > File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): > > > > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > > third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: > > m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); > > On 2017/02/28 00:39:51, raymes wrote: > > > This still worries me a bit just because we've always thought about the > policy > > > as being tied to a single origin through its lifetime and I don't know what > > > assumptions we're breaking when this happens. > > > > > > For example, a feature may be enabled in a frame, and the origin changes but > > we > > > don't recheck the policy so it's still enabled. > > > > With this CL, we would recalculate the feature policy in this case, so there > > would have to be code in the renderer which is caching the result of > > isFeatureEnabled, rather than calling it each time. If it's possible for the > > policy to change in a way that would make that caching invalid, then we'll > need > > to document that callers shoudn't cache the results of that method. > > . > > > This would have to be I guess it boils down to me not > > > understanding the circumstances under which origins can change in a > > > SecurityContext - it seems like it should be a rare thing. > > > > > > Either way, I defer on this point since I don't know the answer but I do > think > > > it would be good to feel more confident about it. Perhaps dcheng or mkwst > can > > > give better advice here? > > > > I believe, from reading specs and code, that post-document-creation, there are > > only a couple of ways that the document's origin could change: > > > > - Setting document.domain can update the domain properly > > - Using document.write or .open from *another* document sets the first > > document's origin to be the same as the second one's. > > > > That second technique is also restricted in code: the two documents need to > > already be same-scheme-host-port-and-suborigin, so I believe that the only > > properties of the origin that can reasonably change are the domain and some > > flags like m_universalAccess, m_canLoadLocalResources and > > m_blockLocalAccessFromLocalOrigin, which we don't use for FP decisions, and > are > > not normally set on the open web. > > > > +r mkwst and dcheng for any more useful insight here -- are there other > > situations where the origin can change post-creation? > > I think this pretty much covers it, with one small correction: the three flags > mentioned here should be set at security context initialization, and shouldn't > dynamically change after that. (This meaning the situations covered in https://bugs.chromium.org/p/chromium/issues/detail?id=696819)
haraken@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... File content/child/blink_platform_impl.cc (right): https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... content/child/blink_platform_impl.cc:869: return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabled(feature); Hmm, it looks a bit weird that we're redirecting a Platform's method to WebFeaturePolicy's method using a static cast. Can we move createFeaturePolicy, isFeatureEnabledByPolicy and updateFeaturePolicyOrigin to WebFeaturePolicy?
On 2017/02/28 06:19:05, dcheng wrote: > On 2017/02/28 05:25:56, iclelland wrote: > > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > > File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): > > > > > https://codereview.chromium.org/2651883008/diff/240001/third_party/WebKit/Sou... > > third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: > > m_featurePolicy.get(), WebSecurityOrigin(m_securityOrigin)); > > On 2017/02/28 00:39:51, raymes wrote: > > > This still worries me a bit just because we've always thought about the > policy > > > as being tied to a single origin through its lifetime and I don't know what > > > assumptions we're breaking when this happens. > > > > > > For example, a feature may be enabled in a frame, and the origin changes but > > we > > > don't recheck the policy so it's still enabled. > > > > With this CL, we would recalculate the feature policy in this case, so there > > would have to be code in the renderer which is caching the result of > > isFeatureEnabled, rather than calling it each time. If it's possible for the > > policy to change in a way that would make that caching invalid, then we'll > need > > to document that callers shoudn't cache the results of that method. > > . > > > This would have to be I guess it boils down to me not > > > understanding the circumstances under which origins can change in a > > > SecurityContext - it seems like it should be a rare thing. > > > > > > Either way, I defer on this point since I don't know the answer but I do > think > > > it would be good to feel more confident about it. Perhaps dcheng or mkwst > can > > > give better advice here? > > > > I believe, from reading specs and code, that post-document-creation, there are > > only a couple of ways that the document's origin could change: > > > > - Setting document.domain can update the domain properly > > - Using document.write or .open from *another* document sets the first > > document's origin to be the same as the second one's. > > > > That second technique is also restricted in code: the two documents need to > > already be same-scheme-host-port-and-suborigin, so I believe that the only > > properties of the origin that can reasonably change are the domain and some > > flags like m_universalAccess, m_canLoadLocalResources and > > m_blockLocalAccessFromLocalOrigin, which we don't use for FP decisions, and > are > > not normally set on the open web. > > > > +r mkwst and dcheng for any more useful insight here -- are there other > > situations where the origin can change post-creation? > > I think this pretty much covers it, with one small correction: the three flags > mentioned here should be set at security context initialization, and shouldn't > dynamically change after that. The specific situation I was thinking of is here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Docum... The flags are set on the origins, not the security context, and it looks like it's possible for the new origin to have different flags than the old one; maybe that's not the case, and you could never reach this code if they were different, I haven't tried to actually trigger it.
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
Patchset #14 (id:260001) has been deleted
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... File content/child/blink_platform_impl.cc (right): https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... content/child/blink_platform_impl.cc:869: return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabled(feature); On 2017/02/28 06:41:43, haraken wrote: > > Hmm, it looks a bit weird that we're redirecting a Platform's method to > WebFeaturePolicy's method using a static cast. > > Can we move createFeaturePolicy, isFeatureEnabledByPolicy and > updateFeaturePolicyOrigin to WebFeaturePolicy? I can move isFeatureEnabledByPolicy and updateFeaturePolicyOrigin to virtual methods on WebFeaturePolicy; I think that makes sense. createFeaturePolicy is necessarily a static method, so it's not something that would be easily implemented by subclasses. It makes sense to make it a platform responsibility to create an appropriate FeaturePolicy object on request, and then that object implements the other methods (isFeatureEnabled, updateOrigin). WDYT?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
On 2017/02/28 21:02:39, iclelland wrote: > https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... > File content/child/blink_platform_impl.cc (right): > > https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... > content/child/blink_platform_impl.cc:869: return static_cast<const > FeaturePolicy*>(policy)->IsFeatureEnabled(feature); > On 2017/02/28 06:41:43, haraken wrote: > > > > Hmm, it looks a bit weird that we're redirecting a Platform's method to > > WebFeaturePolicy's method using a static cast. > > > > Can we move createFeaturePolicy, isFeatureEnabledByPolicy and > > updateFeaturePolicyOrigin to WebFeaturePolicy? > > I can move isFeatureEnabledByPolicy and updateFeaturePolicyOrigin to virtual > methods on WebFeaturePolicy; I think that makes sense. > > createFeaturePolicy is necessarily a static method, so it's not something that > would be easily implemented by subclasses. It makes sense to make it a platform > responsibility to create an appropriate FeaturePolicy object on request, and > then that object implements the other methods (isFeatureEnabled, updateOrigin). > WDYT? Sounds good.
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
On 2017/03/01 01:23:39, haraken wrote: > On 2017/02/28 21:02:39, iclelland wrote: > > > https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... > > File content/child/blink_platform_impl.cc (right): > > > > > https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... > > content/child/blink_platform_impl.cc:869: return static_cast<const > > FeaturePolicy*>(policy)->IsFeatureEnabled(feature); > > On 2017/02/28 06:41:43, haraken wrote: > > > > > > Hmm, it looks a bit weird that we're redirecting a Platform's method to > > > WebFeaturePolicy's method using a static cast. > > > > > > Can we move createFeaturePolicy, isFeatureEnabledByPolicy and > > > updateFeaturePolicyOrigin to WebFeaturePolicy? > > > > I can move isFeatureEnabledByPolicy and updateFeaturePolicyOrigin to virtual > > methods on WebFeaturePolicy; I think that makes sense. > > > > createFeaturePolicy is necessarily a static method, so it's not something that > > would be easily implemented by subclasses. It makes sense to make it a > platform > > responsibility to create an appropriate FeaturePolicy object on request, and > > then that object implements the other methods (isFeatureEnabled, > updateOrigin). > > WDYT? > > Sounds good. It's far more difficult than it should be to add updateOrigin to WebFeaturePolicy -- in public/platform, it needs to take a WebSecurityOrigin, but in content/common, there's no way to convert that to a url::Origin. The conversion methods are only available in content/child or content/renderer, to avoid linking the browser against blink. After thinking on it, though, a better idiom when the origin changes might be to create a new policy, a duplicate of the old one, with the same set of inherited features, but anchored to the new origin. The old policy can be destroyed at that point (it's a unique_ptr on SecurityContext), and there's never a question that the policies themselves are immutable. I'm going to give that a try and see if I can get it to work.
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/03/01 19:22:38, iclelland wrote: > On 2017/03/01 01:23:39, haraken wrote: > > On 2017/02/28 21:02:39, iclelland wrote: > > > > > > https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... > > > File content/child/blink_platform_impl.cc (right): > > > > > > > > > https://codereview.chromium.org/2651883008/diff/240001/content/child/blink_pl... > > > content/child/blink_platform_impl.cc:869: return static_cast<const > > > FeaturePolicy*>(policy)->IsFeatureEnabled(feature); > > > On 2017/02/28 06:41:43, haraken wrote: > > > > > > > > Hmm, it looks a bit weird that we're redirecting a Platform's method to > > > > WebFeaturePolicy's method using a static cast. > > > > > > > > Can we move createFeaturePolicy, isFeatureEnabledByPolicy and > > > > updateFeaturePolicyOrigin to WebFeaturePolicy? > > > > > > I can move isFeatureEnabledByPolicy and updateFeaturePolicyOrigin to virtual > > > methods on WebFeaturePolicy; I think that makes sense. > > > > > > createFeaturePolicy is necessarily a static method, so it's not something > that > > > would be easily implemented by subclasses. It makes sense to make it a > > platform > > > responsibility to create an appropriate FeaturePolicy object on request, and > > > then that object implements the other methods (isFeatureEnabled, > > updateOrigin). > > > WDYT? > > > > Sounds good. > > It's far more difficult than it should be to add updateOrigin to > WebFeaturePolicy -- in public/platform, it needs to take a WebSecurityOrigin, > but in content/common, there's no way to convert that to a url::Origin. The > conversion methods are only available in content/child or content/renderer, to > avoid linking the browser against blink. > > After thinking on it, though, a better idiom when the origin changes might be to > create a new policy, a duplicate of the old one, with the same set of inherited > features, but anchored to the new origin. The old policy can be destroyed at > that point (it's a unique_ptr on SecurityContext), and there's never a question > that the policies themselves are immutable. I'm going to give that a try and see > if I can get it to work. haraken, that change has been implemented in the most recent patchset (#17). can you PTAL? (It's the same delta as in https://codereview.chromium.org/2729623003/)
Sorry about the review delay. LGTM. https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.h (right): https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.h:25: CORE_EXPORT bool isFeatureEnabledInFrame(WebFeaturePolicyFeature, const Frame*); Nit: Another option is to make isFeatureEnabledInFrame a method of Frame. https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: *m_featurePolicy, WebSecurityOrigin(m_securityOrigin))); Oh, if your intention is just to *update* (not duplicate) the feature policy, I'm also fine with an API like updateFeaturePolicyWithOrigin(m_featurePolicy), which automatically updates m_featurePolicy. https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... File third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp (right): https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp:440: frame()->securityContext()->initializeFeaturePolicy(parsedHeader, Also we can make initializeFeaturePolicy a method of Frame.
pfeldman, can you take a look at this point? Thanks! https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.h (right): https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.h:25: CORE_EXPORT bool isFeatureEnabledInFrame(WebFeaturePolicyFeature, const Frame*); On 2017/03/04 07:36:00, haraken wrote: > > Nit: Another option is to make isFeatureEnabledInFrame a method of Frame. Thanks, I've been thinking about moving this out of bindings/ for a bit. I'll line up another CL for that. https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/SecurityContext.cpp (right): https://codereview.chromium.org/2651883008/diff/340001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/SecurityContext.cpp:120: *m_featurePolicy, WebSecurityOrigin(m_securityOrigin))); On 2017/03/04 07:36:01, haraken wrote: > > Oh, if your intention is just to *update* (not duplicate) the feature policy, > I'm also fine with an API like updateFeaturePolicyWithOrigin(m_featurePolicy), > which automatically updates m_featurePolicy. That is really the only modification being considered here, but after writing it, I'm slightly more comfortable with the idea that the policy objects are effectively immutable after they've been constructed, and the FP headers have been read. The origin is used for interpreting the policy, and we might end up breaking some assumptions inadvertently if we allow it to change after the policy has been set.
On 2017/03/06 04:17:40, iclelland wrote: > pfeldman, can you take a look at this point? > (At content/ at least: as OWNER, I think haraken's l g t m should suffice for 3p/WebKit/)
content lgtm
The CQ bit was checked by iclelland@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from raymes@chromium.org Link to the patchset: https://codereview.chromium.org/2651883008/#ps340001 (title: "Duplicate FP object rather than modifying in-place")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 340001, "attempt_start_ts": 1488824770399770, "parent_rev": "65dff8b6da7b33d422b5e02356e58254fded9006", "commit_rev": "4a6080201a29001f398861f94f8a473d646facd2"}
Message was sent while issue was closed.
Description was changed from ========== Make content::FeaturePolicy implement of WebFeaturePolicy, and use it in blink code This is part 4 of 5 in the effort to move the FeaturePolicy implementation into the content layer, which will facilitate use of the framework for browser- based policy decisions. See the other CLs in this series: [1/5] https://codereview.chromium.org/2648423002/ (Rename classes) [2/5] https://codereview.chromium.org/2654873004/ (Centralize content-side code) [3/5] https://codereview.chromium.org/2655663004/ (Maintain parallel FP in browser) [4/5] (This CL) (Use content/ FP in blink) [5/5] https://codereview.chromium.org/2656533004/ (Remove unused blink code.) BUG=685195 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation ========== to ========== Make content::FeaturePolicy implement of WebFeaturePolicy, and use it in blink code This is part 4 of 5 in the effort to move the FeaturePolicy implementation into the content layer, which will facilitate use of the framework for browser- based policy decisions. See the other CLs in this series: [1/5] https://codereview.chromium.org/2648423002/ (Rename classes) [2/5] https://codereview.chromium.org/2654873004/ (Centralize content-side code) [3/5] https://codereview.chromium.org/2655663004/ (Maintain parallel FP in browser) [4/5] (This CL) (Use content/ FP in blink) [5/5] https://codereview.chromium.org/2656533004/ (Remove unused blink code.) BUG=685195 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2651883008 Cr-Commit-Position: refs/heads/master@{#454949} Committed: https://chromium.googlesource.com/chromium/src/+/4a6080201a29001f398861f94f8a... ==========
Message was sent while issue was closed.
Committed patchset #17 (id:340001) as https://chromium.googlesource.com/chromium/src/+/4a6080201a29001f398861f94f8a... |