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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing review comments Created 3 years, 8 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 // flags, and these flags take effect immediately. An exception is if the 613 // flags, and these flags take effect immediately. An exception is if the
614 // opener's sandbox flags lack the PropagatesToAuxiliaryBrowsingContexts 614 // opener's sandbox flags lack the PropagatesToAuxiliaryBrowsingContexts
615 // bit (which is controlled by the "allow-popups-to-escape-sandbox" token). 615 // bit (which is controlled by the "allow-popups-to-escape-sandbox" token).
616 // See https://html.spec.whatwg.org/#attr-iframe-sandbox. 616 // See https://html.spec.whatwg.org/#attr-iframe-sandbox.
617 if (opener) { 617 if (opener) {
618 blink::WebSandboxFlags opener_flags = opener->effective_sandbox_flags(); 618 blink::WebSandboxFlags opener_flags = opener->effective_sandbox_flags();
619 const blink::WebSandboxFlags inherit_flag = 619 const blink::WebSandboxFlags inherit_flag =
620 blink::WebSandboxFlags::kPropagatesToAuxiliaryBrowsingContexts; 620 blink::WebSandboxFlags::kPropagatesToAuxiliaryBrowsingContexts;
621 if ((opener_flags & inherit_flag) == inherit_flag) { 621 if ((opener_flags & inherit_flag) == inherit_flag) {
622 new_root->SetPendingSandboxFlags(opener_flags); 622 new_root->SetPendingSandboxFlags(opener_flags);
623 new_root->CommitPendingSandboxFlags(); 623 new_root->CommitPendingFramePolicy();
624 } 624 }
625 } 625 }
626 626
627 // This may be true even when opener is null, such as when opening blocked 627 // This may be true even when opener is null, such as when opening blocked
628 // popups. 628 // popups.
629 if (params.created_with_opener) 629 if (params.created_with_opener)
630 new_contents->created_with_opener_ = true; 630 new_contents->created_with_opener_ = true;
631 631
632 if (params.guest_delegate) { 632 if (params.guest_delegate) {
633 // This makes |new_contents| act as a guest. 633 // This makes |new_contents| act as a guest.
(...skipping 4838 matching lines...) Expand 10 before | Expand all | Expand 10 after
5472 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5472 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5473 if (!render_view_host) 5473 if (!render_view_host)
5474 continue; 5474 continue;
5475 render_view_host_set.insert(render_view_host); 5475 render_view_host_set.insert(render_view_host);
5476 } 5476 }
5477 for (RenderViewHost* render_view_host : render_view_host_set) 5477 for (RenderViewHost* render_view_host : render_view_host_set)
5478 render_view_host->OnWebkitPreferencesChanged(); 5478 render_view_host->OnWebkitPreferencesChanged();
5479 } 5479 }
5480 5480
5481 } // namespace content 5481 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/common/feature_policy/feature_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698