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

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 842033003: Cleanup RemotePlatformLayer when disconnecting RemoteFrame. (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/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index d2001a5dfb27969921c85b632ab4003729352b22..19de1b34a56234f339bd8fecf2ff0bf87a6294db 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -30,6 +30,7 @@
#include "core/HTMLNames.h"
#include "core/fetch/ImageResource.h"
#include "core/frame/FrameView.h"
+#include "core/frame/RemoteFrame.h"
#include "core/html/HTMLCanvasElement.h"
#include "core/html/HTMLIFrameElement.h"
#include "core/html/HTMLMediaElement.h"
@@ -518,9 +519,10 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
if (WebLayer* layer = platformLayerForPlugin(renderer)) {
m_graphicsLayer->setContentsToPlatformLayer(layer);
} else if (renderer->node() && renderer->node()->isFrameOwnerElement() && toHTMLFrameOwnerElement(renderer->node())->contentFrame()) {
- WebLayer* layer = toHTMLFrameOwnerElement(renderer->node())->contentFrame()->remotePlatformLayer();
- if (layer)
+ if (toHTMLFrameOwnerElement(renderer->node())->contentFrame()->isRemoteFrame()) {
+ WebLayer* layer = toRemoteFrame(toHTMLFrameOwnerElement(renderer->node())->contentFrame())->remotePlatformLayer();
m_graphicsLayer->setContentsToPlatformLayer(layer);
+ }
} else if (renderer->isVideo()) {
HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node());
m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer());

Powered by Google App Engine
This is Rietveld 408576698