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

Unified Diff: third_party/WebKit/Source/core/page/PageAnimator.cpp

Issue 2794803002: Suppress frame requests in InputMethodController::textInputType() (Closed)
Patch Set: InputMethodController::textInputType() Created 3 years, 9 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 | « third_party/WebKit/Source/core/page/PageAnimator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/PageAnimator.cpp
diff --git a/third_party/WebKit/Source/core/page/PageAnimator.cpp b/third_party/WebKit/Source/core/page/PageAnimator.cpp
index b1a1f1daa2ffbed00cf4c0e51f36a9a9e80897b8..e94db670320d88a2b39b702d4d17be859eac3891 100644
--- a/third_party/WebKit/Source/core/page/PageAnimator.cpp
+++ b/third_party/WebKit/Source/core/page/PageAnimator.cpp
@@ -15,10 +15,7 @@
namespace blink {
-PageAnimator::PageAnimator(Page& page)
- : m_page(page),
- m_servicingAnimations(false),
- m_updatingLayoutAndStyleForPainting(false) {}
+PageAnimator::PageAnimator(Page& page) : m_page(page) {}
PageAnimator* PageAnimator::create(Page& page) {
return new PageAnimator(page);
@@ -31,6 +28,8 @@ DEFINE_TRACE(PageAnimator) {
void PageAnimator::serviceScriptedAnimations(
double monotonicAnimationStartTime) {
AutoReset<bool> servicing(&m_servicingAnimations, true);
+ FrameRequestSuppressionScope suppressFrameRequests(this);
+
clock().updateTime(monotonicAnimationStartTime);
HeapVector<Member<Document>, 32> documents;
@@ -75,15 +74,31 @@ void PageAnimator::serviceScriptedAnimations(
DISABLE_CFI_PERF
void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) {
- if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting)
+ if (m_frameRequestSuppressionDepth > 0) {
return;
+ }
m_page->chromeClient().scheduleAnimation(frame->view());
}
void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) {
FrameView* view = rootFrame.view();
- AutoReset<bool> servicing(&m_updatingLayoutAndStyleForPainting, true);
+ FrameRequestSuppressionScope suppressFrameRequests(this);
+
view->updateAllLifecyclePhases();
}
+PageAnimator::FrameRequestSuppressionScope::FrameRequestSuppressionScope(
+ PageAnimator* pageAnimator)
+ : m_pageAnimator(pageAnimator) {
+ if (m_pageAnimator) {
+ m_pageAnimator->m_frameRequestSuppressionDepth++;
+ }
+}
+
+PageAnimator::FrameRequestSuppressionScope::~FrameRequestSuppressionScope() {
+ if (m_pageAnimator) {
+ m_pageAnimator->m_frameRequestSuppressionDepth--;
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/page/PageAnimator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698