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

Unified Diff: Source/web/WebRemoteFrameImpl.cpp

Issue 793493003: Prepare to replicate sandbox flags for OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 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);

Powered by Google App Engine
This is Rietveld 408576698