OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "core/inspector/InspectorAnimationAgent.h" | 5 #include "core/inspector/InspectorAnimationAgent.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "bindings/core/v8/V8BindingForCore.h" | 8 #include "bindings/core/v8/V8BindingForCore.h" |
9 #include "core/animation/Animation.h" | 9 #include "core/animation/Animation.h" |
10 #include "core/animation/AnimationEffectReadOnly.h" | 10 #include "core/animation/AnimationEffectReadOnly.h" |
11 #include "core/animation/AnimationEffectTiming.h" | 11 #include "core/animation/AnimationEffectTiming.h" |
12 #include "core/animation/ComputedTimingProperties.h" | 12 #include "core/animation/ComputedTimingProperties.h" |
13 #include "core/animation/EffectModel.h" | 13 #include "core/animation/EffectModel.h" |
14 #include "core/animation/ElementAnimation.h" | 14 #include "core/animation/ElementAnimation.h" |
15 #include "core/animation/KeyframeEffectModel.h" | 15 #include "core/animation/KeyframeEffectModel.h" |
16 #include "core/animation/KeyframeEffectReadOnly.h" | 16 #include "core/animation/KeyframeEffectReadOnly.h" |
17 #include "core/animation/StringKeyframe.h" | 17 #include "core/animation/StringKeyframe.h" |
18 #include "core/css/CSSKeyframeRule.h" | 18 #include "core/css/CSSKeyframeRule.h" |
19 #include "core/css/CSSKeyframesRule.h" | 19 #include "core/css/CSSKeyframesRule.h" |
20 #include "core/css/CSSRuleList.h" | 20 #include "core/css/CSSRuleList.h" |
21 #include "core/css/CSSStyleRule.h" | 21 #include "core/css/CSSStyleRule.h" |
22 #include "core/css/resolver/StyleResolver.h" | 22 #include "core/css/resolver/StyleResolver.h" |
23 #include "core/dom/DOMNodeIds.h" | 23 #include "core/dom/DOMNodeIds.h" |
24 #include "core/frame/LocalFrame.h" | 24 #include "core/frame/LocalFrame.h" |
| 25 #include "core/inspector/AddStringToDigestor.h" |
25 #include "core/inspector/InspectedFrames.h" | 26 #include "core/inspector/InspectedFrames.h" |
26 #include "core/inspector/InspectorCSSAgent.h" | 27 #include "core/inspector/InspectorCSSAgent.h" |
27 #include "core/inspector/InspectorStyleSheet.h" | 28 #include "core/inspector/InspectorStyleSheet.h" |
28 #include "core/inspector/V8InspectorString.h" | 29 #include "core/inspector/V8InspectorString.h" |
29 #include "platform/Decimal.h" | 30 #include "platform/Decimal.h" |
30 #include "platform/animation/TimingFunction.h" | 31 #include "platform/animation/TimingFunction.h" |
31 #include "platform/wtf/text/Base64.h" | 32 #include "platform/wtf/text/Base64.h" |
32 | 33 |
33 namespace AnimationAgentState { | 34 namespace AnimationAgentState { |
34 static const char animationAgentEnabled[] = "animationAgentEnabled"; | 35 static const char animationAgentEnabled[] = "animationAgentEnabled"; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 CSSPropertyAnimationDelay, CSSPropertyAnimationDirection, | 448 CSSPropertyAnimationDelay, CSSPropertyAnimationDirection, |
448 CSSPropertyAnimationDuration, CSSPropertyAnimationFillMode, | 449 CSSPropertyAnimationDuration, CSSPropertyAnimationFillMode, |
449 CSSPropertyAnimationIterationCount, CSSPropertyAnimationName, | 450 CSSPropertyAnimationIterationCount, CSSPropertyAnimationName, |
450 CSSPropertyAnimationTimingFunction}; | 451 CSSPropertyAnimationTimingFunction}; |
451 | 452 |
452 static CSSPropertyID g_transition_properties[] = { | 453 static CSSPropertyID g_transition_properties[] = { |
453 CSSPropertyTransitionDelay, CSSPropertyTransitionDuration, | 454 CSSPropertyTransitionDelay, CSSPropertyTransitionDuration, |
454 CSSPropertyTransitionProperty, CSSPropertyTransitionTimingFunction, | 455 CSSPropertyTransitionProperty, CSSPropertyTransitionTimingFunction, |
455 }; | 456 }; |
456 | 457 |
457 static void AddStringToDigestor(WebCryptoDigestor* digestor, | |
458 const String& string) { | |
459 digestor->Consume( | |
460 reinterpret_cast<const unsigned char*>(string.Ascii().data()), | |
461 string.length()); | |
462 } | |
463 | |
464 String InspectorAnimationAgent::CreateCSSId(blink::Animation& animation) { | 458 String InspectorAnimationAgent::CreateCSSId(blink::Animation& animation) { |
465 String type = | 459 String type = |
466 id_to_animation_type_.at(String::Number(animation.SequenceNumber())); | 460 id_to_animation_type_.at(String::Number(animation.SequenceNumber())); |
467 DCHECK_NE(type, AnimationType::WebAnimation); | 461 DCHECK_NE(type, AnimationType::WebAnimation); |
468 | 462 |
469 KeyframeEffectReadOnly* effect = ToKeyframeEffectReadOnly(animation.effect()); | 463 KeyframeEffectReadOnly* effect = ToKeyframeEffectReadOnly(animation.effect()); |
470 Vector<CSSPropertyID> css_properties; | 464 Vector<CSSPropertyID> css_properties; |
471 if (type == AnimationType::CSSAnimation) { | 465 if (type == AnimationType::CSSAnimation) { |
472 for (CSSPropertyID property : g_animation_properties) | 466 for (CSSPropertyID property : g_animation_properties) |
473 css_properties.push_back(property); | 467 css_properties.push_back(property); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 558 |
565 DEFINE_TRACE(InspectorAnimationAgent) { | 559 DEFINE_TRACE(InspectorAnimationAgent) { |
566 visitor->Trace(inspected_frames_); | 560 visitor->Trace(inspected_frames_); |
567 visitor->Trace(css_agent_); | 561 visitor->Trace(css_agent_); |
568 visitor->Trace(id_to_animation_); | 562 visitor->Trace(id_to_animation_); |
569 visitor->Trace(id_to_animation_clone_); | 563 visitor->Trace(id_to_animation_clone_); |
570 InspectorBaseAgent::Trace(visitor); | 564 InspectorBaseAgent::Trace(visitor); |
571 } | 565 } |
572 | 566 |
573 } // namespace blink | 567 } // namespace blink |
OLD | NEW |