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

Unified Diff: Source/core/frame/RemoteFrame.cpp

Issue 842033003: Cleanup RemotePlatformLayer when disconnecting RemoteFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | Source/core/layout/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/RemoteFrame.cpp
diff --git a/Source/core/frame/RemoteFrame.cpp b/Source/core/frame/RemoteFrame.cpp
index 7b07fdca6504eb37b51d917e4a7b90034cf19509..b73d6272b1fa8ff03862f4d0f328c24ec2bc9d2c 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/layout/Layer.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,16 @@ RemoteSecurityContext* RemoteFrame::securityContext() const
return m_securityContext.get();
}
+void RemoteFrame::disconnectOwnerElement()
+{
+ // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement()
+ // because it must happen on WebFrame::swap() and Frame::detach().
+ if (m_remotePlatformLayer)
+ setRemotePlatformLayer(nullptr);
+
+ Frame::disconnectOwnerElement();
+}
+
void RemoteFrame::forwardInputEvent(Event* event)
{
remoteFrameClient()->forwardInputEvent(event);
@@ -108,4 +123,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
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | Source/core/layout/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698