Index: Source/core/frame/RemoteFrame.cpp |
diff --git a/Source/core/frame/RemoteFrame.cpp b/Source/core/frame/RemoteFrame.cpp |
index 7b07fdca6504eb37b51d917e4a7b90034cf19509..9e92ada976dceb63462e2827f70721a768e73c9c 100644 |
--- a/Source/core/frame/RemoteFrame.cpp |
+++ b/Source/core/frame/RemoteFrame.cpp |
@@ -11,7 +11,11 @@ |
#include "core/frame/RemoteFrameClient.h" |
#include "core/frame/RemoteFrameView.h" |
#include "core/html/HTMLFrameOwnerElement.h" |
+#include "core/rendering/RenderLayer.h" |
+#include "core/rendering/RenderPart.h" |
+#include "platform/graphics/GraphicsLayer.h" |
#include "platform/weborigin/SecurityPolicy.h" |
+#include "public/platform/WebLayer.h" |
namespace blink { |
@@ -20,6 +24,7 @@ inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram |
, m_securityContext(RemoteSecurityContext::create()) |
, m_domWindow(RemoteDOMWindow::create(*this)) |
, m_windowProxyManager(WindowProxyManager::create(*this)) |
+ , m_remotePlatformLayer(nullptr) |
{ |
} |
@@ -79,6 +84,13 @@ RemoteSecurityContext* RemoteFrame::securityContext() const |
return m_securityContext.get(); |
} |
+void RemoteFrame::disconnectOwnerElement() |
+{ |
+ if (owner() && owner()->isLocal()) |
dcheng
2015/02/03 22:08:37
Why do we do this work here instead of, say, Remot
lfg
2015/02/03 22:54:50
It needs to run on both WebFrame::swap(), as well
dcheng
2015/02/04 00:02:23
Can we add a comment to this effect? It's not imme
|
+ setRemotePlatformLayer(nullptr); |
+ Frame::disconnectOwnerElement(); |
+} |
+ |
void RemoteFrame::forwardInputEvent(Event* event) |
{ |
remoteFrameClient()->forwardInputEvent(event); |
@@ -108,4 +120,18 @@ RemoteFrameClient* RemoteFrame::remoteFrameClient() const |
return static_cast<RemoteFrameClient*>(client()); |
} |
+void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) |
+{ |
+ if (m_remotePlatformLayer) |
+ GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
+ m_remotePlatformLayer = layer; |
+ if (m_remotePlatformLayer) |
+ GraphicsLayer::registerContentsLayer(layer); |
+ |
+ ASSERT(owner()); |
+ toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
+ if (RenderPart* renderer = ownerRenderer()) |
+ renderer->layer()->updateSelfPaintingLayer(); |
+} |
+ |
} // namespace blink |