Index: Source/web/WebRemoteFrameImpl.cpp |
diff --git a/Source/web/WebRemoteFrameImpl.cpp b/Source/web/WebRemoteFrameImpl.cpp |
index 243653e6db2035b4655ef44a8a35df25d5004d20..67b7f14a2dffab9b438effb39fc032ab41409d50 100644 |
--- a/Source/web/WebRemoteFrameImpl.cpp |
+++ b/Source/web/WebRemoteFrameImpl.cpp |
@@ -40,16 +40,20 @@ public: |
virtual SandboxFlags sandboxFlags() const override; |
virtual void dispatchLoad() override; |
+ void setSandboxFlags(SandboxFlags); |
+ |
virtual void trace(Visitor*); |
private: |
explicit RemoteBridgeFrameOwner(PassRefPtrWillBeRawPtr<WebLocalFrameImpl>); |
RefPtrWillBeMember<WebLocalFrameImpl> m_frame; |
+ SandboxFlags m_sandboxFlags; |
dcheng
2015/01/09 22:46:12
Since this can't change after creation, let's mark
alexmos
2015/01/09 23:12:30
As we just discussed, the flags are mutable, with
|
}; |
RemoteBridgeFrameOwner::RemoteBridgeFrameOwner(PassRefPtrWillBeRawPtr<WebLocalFrameImpl> frame) |
: m_frame(frame) |
+ , m_sandboxFlags(0) |
{ |
} |
@@ -66,8 +70,12 @@ bool RemoteBridgeFrameOwner::isLocal() const |
SandboxFlags RemoteBridgeFrameOwner::sandboxFlags() const |
{ |
- // FIXME: Implement. Most likely grab it from m_frame. |
- return 0; |
+ return m_sandboxFlags; |
+} |
+ |
+void RemoteBridgeFrameOwner::setSandboxFlags(SandboxFlags flags) |
+{ |
+ m_sandboxFlags = flags; |
dcheng
2015/01/10 00:01:00
Nit: just inline this into the declaration.
alexmos
2015/01/10 00:51:54
Done. Inlined setSandboxFlags(), sandboxFlags(),
|
} |
void RemoteBridgeFrameOwner::dispatchLoad() |
@@ -794,11 +802,18 @@ 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)); |
- WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult result = |
- m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child)); |
+ OwnPtrWillBeRawPtr<RemoteBridgeFrameOwner> owner = RemoteBridgeFrameOwner::create(child); |
dcheng
2015/01/10 00:01:00
Nit: it's probably still nicer to pass this in the
alexmos
2015/01/10 00:51:54
Done.
|
+ owner->setSandboxFlags(static_cast<SandboxFlags>(sandboxFlags)); |
+ WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult result = m_ownersForChildren.add(child, owner.release()); |
appendChild(child); |
// FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may |
// result in the browser observing two navigations to about:blank (one from the initial |
@@ -854,6 +869,12 @@ void WebRemoteFrameImpl::setReplicatedOrigin(const WebSecurityOrigin& origin) co |
frame()->securityContext()->setReplicatedOrigin(origin); |
} |
+void WebRemoteFrameImpl::setReplicatedSandboxFlags(WebSandboxFlags flags) const |
+{ |
+ ASSERT(frame()); |
+ frame()->securityContext()->enforceSandboxFlags(static_cast<SandboxFlags>(flags)); |
+} |
+ |
void WebRemoteFrameImpl::didStartLoading() |
{ |
frame()->setIsLoading(true); |