Chromium Code Reviews| Index: Source/web/WebRemoteFrameImpl.cpp |
| diff --git a/Source/web/WebRemoteFrameImpl.cpp b/Source/web/WebRemoteFrameImpl.cpp |
| index 49ce2431793d0f8c85e78c01a857d425bf28daec..c626fe63de20a67549b4ae6648243cc627aec7bb 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; |
| }; |
| 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; |
| } |
| void RemoteBridgeFrameOwner::dispatchLoad() |
| @@ -789,11 +797,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, WebSandboxNone, 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)); |
| + OwnPtr<RemoteBridgeFrameOwner> owner = RemoteBridgeFrameOwner::create(child); |
|
dcheng
2015/01/08 22:50:45
OwnPtrWillBeRawPtr
alexmos
2015/01/09 19:49:56
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 |
| @@ -849,6 +864,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); |