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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 302213002: Convert page-level classes to handle RemoteFrames from FrameTree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 6 years, 7 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/page/SpatialNavigation.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index dd5459233f8db3b8a74d7e3dcdf3b9fa64af4f44..ede4d98cf27f8d31ef761b2fccdd2c1058828edc 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -167,9 +167,11 @@ void ScrollingCoordinator::updateAfterCompositingChange()
}
const FrameTree& tree = m_page->mainFrame()->tree();
- for (const LocalFrame* child = tree.firstChild(); child; child = child->tree().nextSibling()) {
- if (WebLayer* scrollLayer = toWebLayer(child->view()->layerForScrolling()))
- scrollLayer->setBounds(child->view()->contentsSize());
+ for (const Frame* child = tree.firstChild(); child; child = child->tree().nextSibling()) {
+ if (!child->isLocalFrame())
+ continue;
+ if (WebLayer* scrollLayer = toWebLayer(toLocalFrame(child)->view()->layerForScrolling()))
+ scrollLayer->setBounds(toLocalFrame(child)->view()->contentsSize());
}
}
@@ -391,16 +393,18 @@ static void makeLayerChildFrameMap(const LocalFrame* currentFrame, LayerFrameMap
{
map->clear();
const FrameTree& tree = currentFrame->tree();
- for (const LocalFrame* child = tree.firstChild(); child; child = child->tree().nextSibling()) {
- const RenderObject* ownerRenderer = child->ownerRenderer();
+ for (const Frame* child = tree.firstChild(); child; child = child->tree().nextSibling()) {
+ if (!child->isLocalFrame())
+ continue;
+ const RenderObject* ownerRenderer = toLocalFrame(child)->ownerRenderer();
if (!ownerRenderer)
continue;
const RenderLayer* containingLayer = ownerRenderer->enclosingLayer();
LayerFrameMap::iterator iter = map->find(containingLayer);
if (iter == map->end())
- map->add(containingLayer, Vector<const LocalFrame*>()).storedValue->value.append(child);
+ map->add(containingLayer, Vector<const LocalFrame*>()).storedValue->value.append(toLocalFrame(child));
else
- iter->value.append(child);
+ iter->value.append(toLocalFrame(child));
}
}
@@ -665,8 +669,9 @@ void ScrollingCoordinator::updateHaveWheelEventHandlers()
if (WebLayer* scrollLayer = toWebLayer(m_page->mainFrame()->view()->layerForScrolling())) {
unsigned wheelEventHandlerCount = 0;
- for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
- wheelEventHandlerCount += WheelController::from(*frame->document())->wheelEventHandlerCount();
+ for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (frame->isLocalFrame())
+ wheelEventHandlerCount += WheelController::from(*toLocalFrame(frame)->document())->wheelEventHandlerCount();
}
scrollLayer->setHaveWheelEventHandlers(wheelEventHandlerCount);
@@ -771,8 +776,10 @@ Region ScrollingCoordinator::computeShouldHandleScrollGestureOnMainThreadRegion(
}
const FrameTree& tree = frame->tree();
- for (LocalFrame* subFrame = tree.firstChild(); subFrame; subFrame = subFrame->tree().nextSibling())
- shouldHandleScrollGestureOnMainThreadRegion.unite(computeShouldHandleScrollGestureOnMainThreadRegion(subFrame, offset));
+ for (Frame* subFrame = tree.firstChild(); subFrame; subFrame = subFrame->tree().nextSibling()) {
+ if (subFrame->isLocalFrame())
+ shouldHandleScrollGestureOnMainThreadRegion.unite(computeShouldHandleScrollGestureOnMainThreadRegion(toLocalFrame(subFrame), offset));
+ }
return shouldHandleScrollGestureOnMainThreadRegion;
}
« no previous file with comments | « Source/core/page/SpatialNavigation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698