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

Side by Side Diff: Source/core/layout/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, 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/RemoteFrame.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layout/compositing/CompositedLayerMapping.h" 28 #include "core/layout/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/layout/LayerStackingNodeIterator.h" 41 #include "core/layout/LayerStackingNodeIterator.h"
41 #include "core/layout/compositing/LayerCompositor.h" 42 #include "core/layout/compositing/LayerCompositor.h"
42 #include "core/page/Chrome.h" 43 #include "core/page/Chrome.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 Frame* frame = toHTMLFrameOwnerElement(renderer->node())->contentFrame() ;
522 if (layer) 523 if (frame->isRemoteFrame()) {
524 WebLayer* layer = toRemoteFrame(frame)->remotePlatformLayer();
523 m_graphicsLayer->setContentsToPlatformLayer(layer); 525 m_graphicsLayer->setContentsToPlatformLayer(layer);
526 }
524 } else if (renderer->isVideo()) { 527 } else if (renderer->isVideo()) {
525 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node()); 528 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node());
526 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer( )); 529 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer( ));
527 } else if (isAcceleratedCanvas(renderer)) { 530 } else if (isAcceleratedCanvas(renderer)) {
528 HTMLCanvasElement* canvas = toHTMLCanvasElement(renderer->node()); 531 HTMLCanvasElement* canvas = toHTMLCanvasElement(renderer->node());
529 if (CanvasRenderingContext* context = canvas->renderingContext()) 532 if (CanvasRenderingContext* context = canvas->renderingContext())
530 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer() ); 533 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer() );
531 layerConfigChanged = true; 534 layerConfigChanged = true;
532 } 535 }
533 if (renderer->isRenderPart()) 536 if (renderer->isRenderPart())
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2339 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2337 name = "Scrolling Block Selection Layer"; 2340 name = "Scrolling Block Selection Layer";
2338 } else { 2341 } else {
2339 ASSERT_NOT_REACHED(); 2342 ASSERT_NOT_REACHED();
2340 } 2343 }
2341 2344
2342 return name; 2345 return name;
2343 } 2346 }
2344 2347
2345 } // namespace blink 2348 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/RemoteFrame.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698