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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/rendering/compositing/CompositedLayerMapping.h" 28 #include "core/rendering/compositing/CompositedLayerMapping.h"
29 29
30 #include "core/HTMLNames.h" 30 #include "core/HTMLNames.h"
31 #include "core/fetch/ImageResource.h" 31 #include "core/fetch/ImageResource.h"
32 #include "core/frame/FrameView.h" 32 #include "core/frame/FrameView.h"
33 #include "core/frame/RemoteFrame.h"
33 #include "core/html/HTMLCanvasElement.h" 34 #include "core/html/HTMLCanvasElement.h"
34 #include "core/html/HTMLIFrameElement.h" 35 #include "core/html/HTMLIFrameElement.h"
35 #include "core/html/HTMLMediaElement.h" 36 #include "core/html/HTMLMediaElement.h"
36 #include "core/html/HTMLVideoElement.h" 37 #include "core/html/HTMLVideoElement.h"
37 #include "core/html/canvas/CanvasRenderingContext.h" 38 #include "core/html/canvas/CanvasRenderingContext.h"
38 #include "core/inspector/InspectorInstrumentation.h" 39 #include "core/inspector/InspectorInstrumentation.h"
39 #include "core/inspector/InspectorNodeIds.h" 40 #include "core/inspector/InspectorNodeIds.h"
40 #include "core/page/Chrome.h" 41 #include "core/page/Chrome.h"
41 #include "core/page/ChromeClient.h" 42 #include "core/page/ChromeClient.h"
42 #include "core/page/Page.h" 43 #include "core/page/Page.h"
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 if (isDirectlyCompositedImage()) { 512 if (isDirectlyCompositedImage()) {
512 updateImageContents(); 513 updateImageContents();
513 } else if (m_graphicsLayer->hasContentsLayer()) { 514 } else if (m_graphicsLayer->hasContentsLayer()) {
514 m_graphicsLayer->setContentsToImage(0); 515 m_graphicsLayer->setContentsToImage(0);
515 } 516 }
516 } 517 }
517 518
518 if (WebLayer* layer = platformLayerForPlugin(renderer)) { 519 if (WebLayer* layer = platformLayerForPlugin(renderer)) {
519 m_graphicsLayer->setContentsToPlatformLayer(layer); 520 m_graphicsLayer->setContentsToPlatformLayer(layer);
520 } else if (renderer->node() && renderer->node()->isFrameOwnerElement() && to HTMLFrameOwnerElement(renderer->node())->contentFrame()) { 521 } else if (renderer->node() && renderer->node()->isFrameOwnerElement() && to HTMLFrameOwnerElement(renderer->node())->contentFrame()) {
521 WebLayer* layer = toHTMLFrameOwnerElement(renderer->node())->contentFram e()->remotePlatformLayer(); 522 if (toHTMLFrameOwnerElement(renderer->node())->contentFrame()->isRemoteF rame()) {
522 if (layer) 523 WebLayer* layer = toRemoteFrame(toHTMLFrameOwnerElement(renderer->no de())->contentFrame())->remotePlatformLayer();
523 m_graphicsLayer->setContentsToPlatformLayer(layer); 524 m_graphicsLayer->setContentsToPlatformLayer(layer);
525 }
524 } else if (renderer->isVideo()) { 526 } else if (renderer->isVideo()) {
525 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node()); 527 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node());
526 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer( )); 528 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer( ));
527 } else if (isAcceleratedCanvas(renderer)) { 529 } else if (isAcceleratedCanvas(renderer)) {
528 HTMLCanvasElement* canvas = toHTMLCanvasElement(renderer->node()); 530 HTMLCanvasElement* canvas = toHTMLCanvasElement(renderer->node());
529 if (CanvasRenderingContext* context = canvas->renderingContext()) 531 if (CanvasRenderingContext* context = canvas->renderingContext())
530 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer() ); 532 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer() );
531 layerConfigChanged = true; 533 layerConfigChanged = true;
532 } 534 }
533 if (renderer->isRenderPart()) 535 if (renderer->isRenderPart())
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2336 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2335 name = "Scrolling Block Selection Layer"; 2337 name = "Scrolling Block Selection Layer";
2336 } else { 2338 } else {
2337 ASSERT_NOT_REACHED(); 2339 ASSERT_NOT_REACHED();
2338 } 2340 }
2339 2341
2340 return name; 2342 return name;
2341 } 2343 }
2342 2344
2343 } // namespace blink 2345 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698