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

Side by Side Diff: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp

Issue 2692853016: Change PaintLayer::m_layoutObject to a reference. (Closed)
Patch Set: Added TODO Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/ScriptController.h" 5 #include "bindings/core/v8/ScriptController.h"
6 #include "bindings/core/v8/ScriptSourceCode.h" 6 #include "bindings/core/v8/ScriptSourceCode.h"
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 testing::runPendingTasks(); 75 testing::runPendingTasks();
76 return displayItems; 76 return displayItems;
77 } 77 }
78 78
79 // Number of rectangles that make up the root layer's touch handler region. 79 // Number of rectangles that make up the root layer's touch handler region.
80 size_t touchHandlerRegionSize() { 80 size_t touchHandlerRegionSize() {
81 size_t result = 0; 81 size_t result = 0;
82 PaintLayer* layer = 82 PaintLayer* layer =
83 webView().mainFrameImpl()->frame()->contentLayoutObject()->layer(); 83 webView().mainFrameImpl()->frame()->contentLayoutObject()->layer();
84 GraphicsLayer* ownGraphicsLayer = 84 GraphicsLayer* ownGraphicsLayer =
85 layer->graphicsLayerBacking(layer->layoutObject()); 85 layer->graphicsLayerBacking(&layer->layoutObject());
86 if (ownGraphicsLayer) { 86 if (ownGraphicsLayer) {
87 result += 87 result +=
88 ownGraphicsLayer->platformLayer()->touchEventHandlerRegion().size(); 88 ownGraphicsLayer->platformLayer()->touchEventHandlerRegion().size();
89 } 89 }
90 GraphicsLayer* childGraphicsLayer = layer->graphicsLayerBacking(); 90 GraphicsLayer* childGraphicsLayer = layer->graphicsLayerBacking();
91 if (childGraphicsLayer && childGraphicsLayer != ownGraphicsLayer) { 91 if (childGraphicsLayer && childGraphicsLayer != ownGraphicsLayer) {
92 result += 92 result +=
93 childGraphicsLayer->platformLayer()->touchEventHandlerRegion().size(); 93 childGraphicsLayer->platformLayer()->touchEventHandlerRegion().size();
94 } 94 }
95 return result; 95 return result;
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 compositeFrame(); 1045 compositeFrame();
1046 EXPECT_TRUE(frameDocument->view()->canThrottleRendering()); 1046 EXPECT_TRUE(frameDocument->view()->canThrottleRendering());
1047 1047
1048 // Setting display:none unthrottles the frame. 1048 // Setting display:none unthrottles the frame.
1049 frameElement->setAttribute(styleAttr, "display: none"); 1049 frameElement->setAttribute(styleAttr, "display: none");
1050 compositeFrame(); 1050 compositeFrame();
1051 EXPECT_FALSE(frameDocument->view()->canThrottleRendering()); 1051 EXPECT_FALSE(frameDocument->view()->canThrottleRendering());
1052 } 1052 }
1053 1053
1054 } // namespace blink 1054 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698