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

Unified Diff: Source/core/inspector/InspectorAnimationAgent.cpp

Issue 1137833004: Devtools Animations: Update timeline reset condition (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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/inspector/InspectorAnimationAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorAnimationAgent.cpp
diff --git a/Source/core/inspector/InspectorAnimationAgent.cpp b/Source/core/inspector/InspectorAnimationAgent.cpp
index 6f1b88412f644365f1bf1732683f30fff7ddfc53..11dde527f84bdf769fe23dd1b871c49be72bf6b9 100644
--- a/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -36,6 +36,7 @@ InspectorAnimationAgent::InspectorAnimationAgent(InspectorPageAgent* pageAgent,
: InspectorBaseAgent<InspectorAnimationAgent, InspectorFrontend::Animation>("Animation")
, m_pageAgent(pageAgent)
, m_domAgent(domAgent)
+ , m_latestStartTime(std::numeric_limits<double>::min())
{
}
@@ -301,15 +302,10 @@ void InspectorAnimationAgent::didCreateAnimation(Animation* player)
if (m_idToAnimation.get(playerId))
return;
- // Check threshold
- double latestStartTime = 0;
- for (const auto& p : m_idToAnimation.values())
- latestStartTime = max(latestStartTime, normalizedStartTime(*p));
-
- bool reset = false;
- const double threshold = 1000;
- if (normalizedStartTime(*player) - latestStartTime > threshold) {
- reset = true;
+ double threshold = 1000;
+ bool reset = normalizedStartTime(*player) - threshold > m_latestStartTime;
+ m_latestStartTime = normalizedStartTime(*player);
+ if (reset) {
m_idToAnimation.clear();
m_idToAnimationType.clear();
}
« no previous file with comments | « Source/core/inspector/InspectorAnimationAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698