| OLD | NEW |
| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // flags, and these flags take effect immediately. An exception is if the | 657 // flags, and these flags take effect immediately. An exception is if the |
| 658 // opener's sandbox flags lack the PropagatesToAuxiliaryBrowsingContexts | 658 // opener's sandbox flags lack the PropagatesToAuxiliaryBrowsingContexts |
| 659 // bit (which is controlled by the "allow-popups-to-escape-sandbox" token). | 659 // bit (which is controlled by the "allow-popups-to-escape-sandbox" token). |
| 660 // See https://html.spec.whatwg.org/#attr-iframe-sandbox. | 660 // See https://html.spec.whatwg.org/#attr-iframe-sandbox. |
| 661 if (opener) { | 661 if (opener) { |
| 662 blink::WebSandboxFlags opener_flags = opener->effective_sandbox_flags(); | 662 blink::WebSandboxFlags opener_flags = opener->effective_sandbox_flags(); |
| 663 const blink::WebSandboxFlags inherit_flag = | 663 const blink::WebSandboxFlags inherit_flag = |
| 664 blink::WebSandboxFlags::kPropagatesToAuxiliaryBrowsingContexts; | 664 blink::WebSandboxFlags::kPropagatesToAuxiliaryBrowsingContexts; |
| 665 if ((opener_flags & inherit_flag) == inherit_flag) { | 665 if ((opener_flags & inherit_flag) == inherit_flag) { |
| 666 new_root->SetPendingSandboxFlags(opener_flags); | 666 new_root->SetPendingSandboxFlags(opener_flags); |
| 667 new_root->CommitPendingSandboxFlags(); | 667 new_root->CommitPendingFramePolicy(); |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 | 670 |
| 671 // This may be true even when opener is null, such as when opening blocked | 671 // This may be true even when opener is null, such as when opening blocked |
| 672 // popups. | 672 // popups. |
| 673 if (params.created_with_opener) | 673 if (params.created_with_opener) |
| 674 new_contents->created_with_opener_ = true; | 674 new_contents->created_with_opener_ = true; |
| 675 | 675 |
| 676 if (params.guest_delegate) { | 676 if (params.guest_delegate) { |
| 677 // This makes |new_contents| act as a guest. | 677 // This makes |new_contents| act as a guest. |
| (...skipping 4841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5519 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5519 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5520 if (!render_view_host) | 5520 if (!render_view_host) |
| 5521 continue; | 5521 continue; |
| 5522 render_view_host_set.insert(render_view_host); | 5522 render_view_host_set.insert(render_view_host); |
| 5523 } | 5523 } |
| 5524 for (RenderViewHost* render_view_host : render_view_host_set) | 5524 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5525 render_view_host->OnWebkitPreferencesChanged(); | 5525 render_view_host->OnWebkitPreferencesChanged(); |
| 5526 } | 5526 } |
| 5527 | 5527 |
| 5528 } // namespace content | 5528 } // namespace content |
| OLD | NEW |