OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All |
3 * Rights Reserved. | 3 * Rights Reserved. |
4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. | 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. |
5 * (http://www.torchmobile.com/) | 5 * (http://www.torchmobile.com/) |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "core/frame/FrameConsole.h" | 35 #include "core/frame/FrameConsole.h" |
36 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
37 #include "core/frame/FrameView.h" | 37 #include "core/frame/FrameView.h" |
38 #include "core/frame/RemoteFrame.h" | 38 #include "core/frame/RemoteFrame.h" |
39 #include "core/frame/RemoteFrameView.h" | 39 #include "core/frame/RemoteFrameView.h" |
40 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
41 #include "core/frame/VisualViewport.h" | 41 #include "core/frame/VisualViewport.h" |
42 #include "core/html/HTMLMediaElement.h" | 42 #include "core/html/HTMLMediaElement.h" |
43 #include "core/inspector/ConsoleMessageStorage.h" | 43 #include "core/inspector/ConsoleMessageStorage.h" |
44 #include "core/inspector/InspectorInstrumentation.h" | 44 #include "core/inspector/InspectorInstrumentation.h" |
45 #include "core/layout/LayoutView.h" | |
45 #include "core/layout/TextAutosizer.h" | 46 #include "core/layout/TextAutosizer.h" |
46 #include "core/page/AutoscrollController.h" | 47 #include "core/page/AutoscrollController.h" |
47 #include "core/page/ChromeClient.h" | 48 #include "core/page/ChromeClient.h" |
48 #include "core/page/ContextMenuController.h" | 49 #include "core/page/ContextMenuController.h" |
49 #include "core/page/DragController.h" | 50 #include "core/page/DragController.h" |
50 #include "core/page/FocusController.h" | 51 #include "core/page/FocusController.h" |
51 #include "core/page/PointerLockController.h" | 52 #include "core/page/PointerLockController.h" |
52 #include "core/page/ScopedPageSuspender.h" | 53 #include "core/page/ScopedPageSuspender.h" |
53 #include "core/page/ValidationMessageClient.h" | 54 #include "core/page/ValidationMessageClient.h" |
54 #include "core/page/scrolling/ScrollingCoordinator.h" | 55 #include "core/page/scrolling/ScrollingCoordinator.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 : ViewportDescription(); | 158 : ViewportDescription(); |
158 } | 159 } |
159 | 160 |
160 ScrollingCoordinator* Page::scrollingCoordinator() { | 161 ScrollingCoordinator* Page::scrollingCoordinator() { |
161 if (!m_scrollingCoordinator && m_settings->acceleratedCompositingEnabled()) | 162 if (!m_scrollingCoordinator && m_settings->acceleratedCompositingEnabled()) |
162 m_scrollingCoordinator = ScrollingCoordinator::create(this); | 163 m_scrollingCoordinator = ScrollingCoordinator::create(this); |
163 | 164 |
164 return m_scrollingCoordinator.get(); | 165 return m_scrollingCoordinator.get(); |
165 } | 166 } |
166 | 167 |
167 String Page::mainThreadScrollingReasonsAsText() { | 168 String Page::mainThreadScrollingReasonsAsText(Frame* frame) { |
168 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 169 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
169 return scrollingCoordinator->mainThreadScrollingReasonsAsText(); | 170 // TODO(pdr): This walk should be unified with ScrollingCoordinator's |
pdr.
2016/12/07 22:25:29
Can you do this TODO in this patch? Basically, pul
| |
171 // mainThreadScrollingReasons(). | |
172 MainThreadScrollingReasons reasons = 0; | |
173 for (Frame* frame = mainFrame(); frame; | |
174 frame = frame->tree().traverseNext()) { | |
175 if (!frame->isLocalFrame()) | |
176 continue; | |
177 // TODO(alexmos,kenrb): For OOPIF, local roots that are different from | |
178 // the main frame can't be used in the calculation, since they use | |
179 // different compositors with unrelated state, which breaks some of the | |
180 // calculations below. | |
181 if (toLocalFrame(frame)->localFrameRoot() != mainFrame()) | |
182 continue; | |
183 if (const auto* frameView = toLocalFrame(frame)->view()) { | |
184 if (const auto* scrollNode = frameView->scroll()) | |
185 reasons |= scrollNode->mainThreadScrollingReasons(); | |
186 for (LayoutObject* object = frameView->layoutView(); object; | |
187 object = object->nextInPreOrder()) { | |
188 if (const auto* properties = object->paintProperties()) { | |
189 if (const auto* scrollNode = properties->scroll()) | |
190 reasons |= scrollNode->mainThreadScrollingReasons(); | |
191 } | |
192 } | |
193 } | |
194 } | |
195 return String( | |
196 MainThreadScrollingReason::mainThreadScrollingReasonsAsText(reasons) | |
197 .c_str()); | |
198 } else { | |
199 if (auto* scrollingCoordinator = this->scrollingCoordinator()) | |
200 return scrollingCoordinator->mainThreadScrollingReasonsAsText(frame); | |
201 } | |
170 | 202 |
171 return String(); | 203 return String(); |
172 } | 204 } |
173 | 205 |
174 ClientRectList* Page::nonFastScrollableRects(const LocalFrame* frame) { | 206 ClientRectList* Page::nonFastScrollableRects(const LocalFrame* frame) { |
175 if (ScrollingCoordinator* scrollingCoordinator = | 207 if (ScrollingCoordinator* scrollingCoordinator = |
176 this->scrollingCoordinator()) { | 208 this->scrollingCoordinator()) { |
177 // Hits in compositing/iframes/iframe-composited-scrolling.html | 209 // Hits in compositing/iframes/iframe-composited-scrolling.html |
178 DisableCompositingQueryAsserts disabler; | 210 DisableCompositingQueryAsserts disabler; |
179 scrollingCoordinator->updateAfterCompositingChangeIfNeeded(); | 211 scrollingCoordinator->updateAfterCompositingChangeIfNeeded(); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 : chromeClient(nullptr), | 571 : chromeClient(nullptr), |
540 contextMenuClient(nullptr), | 572 contextMenuClient(nullptr), |
541 editorClient(nullptr), | 573 editorClient(nullptr), |
542 spellCheckerClient(nullptr) {} | 574 spellCheckerClient(nullptr) {} |
543 | 575 |
544 Page::PageClients::~PageClients() {} | 576 Page::PageClients::~PageClients() {} |
545 | 577 |
546 template class CORE_TEMPLATE_EXPORT Supplement<Page>; | 578 template class CORE_TEMPLATE_EXPORT Supplement<Page>; |
547 | 579 |
548 } // namespace blink | 580 } // namespace blink |
OLD | NEW |