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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1899843002: Fix cross-site popups to inherit their opener's sandbox flags even when popup opener is not set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index a06c7ccf3ca49dc28097d344a1f2d0e2f45de9ef..c298e672bcb755c6b09cc7f85c06ab2a59c50eae 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -808,16 +808,15 @@ void RenderViewImpl::Initialize(const ViewMsg_New_Params& params,
// If we have an opener_frame but we weren't created by a renderer, then it's
// the browser asking us to set our opener to another frame.
- if (opener_frame && !was_created_by_renderer) {
+ if (opener_frame && !was_created_by_renderer)
webview()->mainFrame()->setOpener(opener_frame);
- // Ensure that sandbox flags are inherited from an opener in a different
- // process. In that case, the browser process will set any inherited
- // sandbox flags in |replicated_frame_state|, so apply them here.
- if (webview()->mainFrame()->isWebLocalFrame()) {
- webview()->mainFrame()->toWebLocalFrame()->forceSandboxFlags(
- params.replicated_frame_state.sandbox_flags);
- }
+ // Ensure that sandbox flags are inherited from an opener in a different
+ // process. In that case, the browser process will set any inherited
+ // sandbox flags in |replicated_frame_state|, so apply them here.
+ if (!was_created_by_renderer && webview()->mainFrame()->isWebLocalFrame()) {
+ webview()->mainFrame()->toWebLocalFrame()->forceSandboxFlags(
+ params.replicated_frame_state.sandbox_flags);
}
// If we are initially swapped out, navigate to kSwappedOutURL.
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager_browsertest.cc ('k') | content/test/data/click-noreferrer-links.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698