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

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 838903002: Replicate sandbox flags for OOPIF (Blink part 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@iframe-sandbox-flags-part1
Patch Set: Address Daniel's comments. Move sandbox flags inheritance to FrameLoader::effectiveSandboxFlags(). Created 5 years, 11 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
« no previous file with comments | « Source/core/html/HTMLFrameOwnerElement.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 { 1370 {
1371 if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript)) 1371 if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
1372 return; 1372 return;
1373 1373
1374 client()->dispatchDidClearWindowObjectInMainWorld(); 1374 client()->dispatchDidClearWindowObjectInMainWorld();
1375 } 1375 }
1376 1376
1377 SandboxFlags FrameLoader::effectiveSandboxFlags() const 1377 SandboxFlags FrameLoader::effectiveSandboxFlags() const
1378 { 1378 {
1379 SandboxFlags flags = m_forcedSandboxFlags; 1379 SandboxFlags flags = m_forcedSandboxFlags;
1380 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1381 if (FrameOwner* frameOwner = m_frame->owner()) 1380 if (FrameOwner* frameOwner = m_frame->owner())
1382 flags |= frameOwner->sandboxFlags(); 1381 flags |= frameOwner->sandboxFlags();
1382 // Frames need to inherit the sandbox flags of their parent frame.
1383 if (Frame* parentFrame = m_frame->tree().parent())
1384 flags |= parentFrame->securityContext()->sandboxFlags();
Nate Chapin 2015/01/22 19:00:28 This is ok, but I can't help but feel that we shou
dcheng 2015/01/22 19:05:53 I guess the counter-argument is it's nice to have
1383 return flags; 1385 return flags;
1384 } 1386 }
1385 1387
1386 bool FrameLoader::shouldEnforceStrictMixedContentChecking() const 1388 bool FrameLoader::shouldEnforceStrictMixedContentChecking() const
1387 { 1389 {
1388 Frame* parentFrame = m_frame->tree().parent(); 1390 Frame* parentFrame = m_frame->tree().parent();
1389 if (!parentFrame) 1391 if (!parentFrame)
1390 return false; 1392 return false;
1391 1393
1392 // FIXME: We need a way to propagate strict mixed content checking flags to 1394 // FIXME: We need a way to propagate strict mixed content checking flags to
1393 // out-of-process frames. For now, we'll always enforce. 1395 // out-of-process frames. For now, we'll always enforce.
1394 if (!parentFrame->isLocalFrame()) 1396 if (!parentFrame->isLocalFrame())
1395 return true; 1397 return true;
1396 1398
1397 return toLocalFrame(parentFrame)->document()->shouldEnforceStrictMixedConten tChecking(); 1399 return toLocalFrame(parentFrame)->document()->shouldEnforceStrictMixedConten tChecking();
1398 } 1400 }
1399 1401
1400 } // namespace blink 1402 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFrameOwnerElement.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698