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

Unified Diff: Source/web/WebRemoteFrameImpl.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: Remove old createLocalChild 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/WebRemoteFrameImpl.cpp
diff --git a/Source/web/WebRemoteFrameImpl.cpp b/Source/web/WebRemoteFrameImpl.cpp
index d06b510b246c92fa65573bebdfc337034905cd59..6a6c830cd3808bbe06d31bdf770a0fbec0401f8c 100644
--- a/Source/web/WebRemoteFrameImpl.cpp
+++ b/Source/web/WebRemoteFrameImpl.cpp
@@ -41,10 +41,7 @@ public:
return false;
}
- virtual SandboxFlags sandboxFlags() const override
- {
- return m_sandboxFlags;
- }
+ virtual SandboxFlags sandboxFlags() const override;
void setSandboxFlags(SandboxFlags flags)
{
@@ -68,6 +65,18 @@ RemoteBridgeFrameOwner::RemoteBridgeFrameOwner(PassRefPtrWillBeRawPtr<WebLocalFr
{
}
+SandboxFlags RemoteBridgeFrameOwner::sandboxFlags() const
+{
+ SandboxFlags flags = m_sandboxFlags;
+ // Frames need to inherit the sandbox flags of their parent frame.
dcheng 2015/01/16 19:11:19 It this covered by any of our current tests?
alexmos 2015/01/17 02:54:42 LayoutTests/http/tests/security/sandbox-inherit-to
+ Frame* parentFrame = m_frame->frame()->tree().parent();
+ if (parentFrame) {
+ ASSERT(parentFrame->isRemoteFrame());
+ flags |= toRemoteFrame(parentFrame)->securityContext()->sandboxFlags();
+ }
+ return flags;
+}
+
void RemoteBridgeFrameOwner::trace(Visitor* visitor)
{
visitor->trace(m_frame);
@@ -798,12 +807,6 @@ WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const
return WebString();
}
-// FIXME(alexmos): This will go away once the Chromium side is updated to pass sandbox flags.
-WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebFrameClient* client)
-{
- return createLocalChild(name, WebSandboxFlags::None, client);
-}
-
WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client)
{
WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(client));

Powered by Google App Engine
This is Rietveld 408576698