Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 18 matching lines...) Expand all Loading... | |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/html/track/vtt/VTTRegion.h" | 31 #include "core/html/track/vtt/VTTRegion.h" |
| 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/dom/TaskRunnerHelper.h" | |
| 39 #include "core/html/HTMLDivElement.h" | 40 #include "core/html/HTMLDivElement.h" |
| 40 #include "core/html/track/vtt/VTTParser.h" | 41 #include "core/html/track/vtt/VTTParser.h" |
| 41 #include "core/html/track/vtt/VTTScanner.h" | 42 #include "core/html/track/vtt/VTTScanner.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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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( |
| 95 TaskRunnerHelper::get(TaskType::UnspecedTimer, (Document*)nullptr), | |
|
maksims (do not use this acc)
2017/02/14 08:28:58
What about this solution? I've tested it and it se
foolip
2017/02/14 13:37:09
The cast is a little suspicious. Does just nullptr
maksims (do not use this acc)
2017/02/16 06:44:05
Check TaskRunnerHelper::get(). It's an overloaded
foolip
2017/02/16 07:46:09
From cs.chromium.org at a glance, I can't find any
maksims (do not use this acc)
2017/02/16 09:16:22
Done.
| |
| 96 this, | |
| 97 &VTTRegion::scrollTimerFired) {} | |
| 94 | 98 |
| 95 VTTRegion::~VTTRegion() {} | 99 VTTRegion::~VTTRegion() {} |
| 96 | 100 |
| 97 void VTTRegion::setId(const String& id) { | 101 void VTTRegion::setId(const String& id) { |
| 98 m_id = id; | 102 m_id = id; |
| 99 } | 103 } |
| 100 | 104 |
| 101 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) { | 105 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) { |
| 102 if (isNonPercentage(value, "width", exceptionState)) | 106 if (isNonPercentage(value, "width", exceptionState)) |
| 103 return; | 107 return; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 stopTimer(); | 413 stopTimer(); |
| 410 displayLastVTTCueBox(); | 414 displayLastVTTCueBox(); |
| 411 } | 415 } |
| 412 | 416 |
| 413 DEFINE_TRACE(VTTRegion) { | 417 DEFINE_TRACE(VTTRegion) { |
| 414 visitor->trace(m_cueContainer); | 418 visitor->trace(m_cueContainer); |
| 415 visitor->trace(m_regionDisplayTree); | 419 visitor->trace(m_regionDisplayTree); |
| 416 } | 420 } |
| 417 | 421 |
| 418 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |