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

Side by Side Diff: third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp

Issue 2684633005: Move VTTRegion Timers to TaskRunnerTimer (Closed)
Patch Set: Move VTTRegion Timers to TaskRunnerTimer Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 32
33 #include "bindings/core/v8/ExceptionMessages.h" 33 #include "bindings/core/v8/ExceptionMessages.h"
34 #include "bindings/core/v8/ExceptionState.h" 34 #include "bindings/core/v8/ExceptionState.h"
35 #include "core/dom/ClientRect.h" 35 #include "core/dom/ClientRect.h"
36 #include "core/dom/DOMTokenList.h" 36 #include "core/dom/DOMTokenList.h"
37 #include "core/dom/ElementTraversal.h" 37 #include "core/dom/ElementTraversal.h"
38 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
39 #include "core/html/HTMLDivElement.h" 39 #include "core/html/HTMLDivElement.h"
40 #include "core/html/track/vtt/VTTParser.h" 40 #include "core/html/track/vtt/VTTParser.h"
41 #include "core/html/track/vtt/VTTScanner.h" 41 #include "core/html/track/vtt/VTTScanner.h"
42 #include "public/platform/Platform.h"
42 #include "wtf/MathExtras.h" 43 #include "wtf/MathExtras.h"
43 44
44 #define VTT_LOG_LEVEL 3 45 #define VTT_LOG_LEVEL 3
45 46
46 namespace blink { 47 namespace blink {
47 48
48 // The following values default values are defined within the WebVTT Regions 49 // The following values default values are defined within the WebVTT Regions
49 // Spec. 50 // Spec.
50 // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html 51 // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html
51 52
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 85
85 VTTRegion::VTTRegion() 86 VTTRegion::VTTRegion()
86 : m_id(emptyString), 87 : m_id(emptyString),
87 m_width(defaultWidth), 88 m_width(defaultWidth),
88 m_lines(defaultHeightInLines), 89 m_lines(defaultHeightInLines),
89 m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), 90 m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)),
90 m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), 91 m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)),
91 m_scroll(defaultScroll), 92 m_scroll(defaultScroll),
92 m_currentTop(0), 93 m_currentTop(0),
93 m_scrollTimer(this, &VTTRegion::scrollTimerFired) {} 94 m_scrollTimer(Platform::current()->currentThread()->getWebTaskRunner(),
95 this,
96 &VTTRegion::scrollTimerFired) {}
94 97
95 VTTRegion::~VTTRegion() {} 98 VTTRegion::~VTTRegion() {}
96 99
97 void VTTRegion::setId(const String& id) { 100 void VTTRegion::setId(const String& id) {
98 m_id = id; 101 m_id = id;
99 } 102 }
100 103
101 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) { 104 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) {
102 if (isNonPercentage(value, "width", exceptionState)) 105 if (isNonPercentage(value, "width", exceptionState))
103 return; 106 return;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 stopTimer(); 412 stopTimer();
410 displayLastVTTCueBox(); 413 displayLastVTTCueBox();
411 } 414 }
412 415
413 DEFINE_TRACE(VTTRegion) { 416 DEFINE_TRACE(VTTRegion) {
414 visitor->trace(m_cueContainer); 417 visitor->trace(m_cueContainer);
415 visitor->trace(m_regionDisplayTree); 418 visitor->trace(m_regionDisplayTree);
416 } 419 }
417 420
418 } // namespace blink 421 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698