diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/track/vtt')
6 files changed, 12 insertions, 105 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader.h b/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader.h index 6827e3ce49d..faee892d111 100644 --- a/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader.h +++ b/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader.h @@ -31,7 +31,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_BUFFERED_LINE_READER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_BUFFERED_LINE_READER_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/text/segmented_string.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -50,6 +49,8 @@ class CORE_EXPORT BufferedLineReader { public: BufferedLineReader() : end_of_stream_(false), maybe_skip_lf_(false) {} + BufferedLineReader(const BufferedLineReader&) = delete; + BufferedLineReader& operator=(const BufferedLineReader&) = delete; // Append data to the internal buffer. void Append(const String& data) { @@ -81,8 +82,6 @@ class CORE_EXPORT BufferedLineReader { StringBuilder line_buffer_; bool end_of_stream_; bool maybe_skip_lf_; - - DISALLOW_COPY_AND_ASSIGN(BufferedLineReader); }; } // namespace blink diff --git a/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader_test.cc b/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader_test.cc index 9e06b5e2d4e..aefb9050c2d 100644 --- a/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader_test.cc +++ b/chromium/third_party/blink/renderer/core/html/track/vtt/buffered_line_reader_test.cc @@ -30,7 +30,7 @@ #include "third_party/blink/renderer/core/html/track/vtt/buffered_line_reader.h" -#include "base/stl_util.h" +#include "base/cxx17_backports.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/platform/wtf/text/character_names.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" diff --git a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc index cbc075ffed8..ef7e216900f 100644 --- a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc +++ b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc @@ -29,8 +29,7 @@ #include "third_party/blink/renderer/core/html/track/vtt/vtt_cue.h" -#include "base/stl_util.h" -#include "third_party/blink/renderer/bindings/core/v8/double_or_auto_keyword.h" +#include "base/cxx17_backports.h" #include "third_party/blink/renderer/bindings/core/v8/v8_union_autokeyword_double.h" #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css_value_keywords.h" @@ -74,13 +73,6 @@ static_assert(base::size(kDisplayAlignmentMap) == VTTCue::kNumberOfAlignments, "displayAlignmentMap should have the same number of elements as " "VTTCue::NumberOfAlignments"); -#if !defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) -static const String& AutoKeyword() { - DEFINE_STATIC_LOCAL(const String, auto_string, ("auto")); - return auto_string; -} -#endif // !defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - static const String& StartKeyword() { DEFINE_STATIC_LOCAL(const String, start, ("start")); return start; @@ -323,8 +315,6 @@ bool VTTCue::LineIsAuto() const { return std::isnan(line_position_); } -#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - V8UnionAutoKeywordOrDouble* VTTCue::line() const { if (LineIsAuto()) { return MakeGarbageCollected<V8UnionAutoKeywordOrDouble>( @@ -359,44 +349,10 @@ void VTTCue::setLine(const V8UnionAutoKeywordOrDouble* position) { CueDidChange(); } -#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - -void VTTCue::line(DoubleOrAutoKeyword& result) const { - if (LineIsAuto()) - result.SetAutoKeyword(AutoKeyword()); - else - result.SetDouble(line_position_); -} - -void VTTCue::setLine(const DoubleOrAutoKeyword& position) { - // http://dev.w3.org/html5/webvtt/#dfn-vttcue-line - // On setting, the WebVTT cue line must be set to the new value; if the new - // value is the string "auto", then it must be interpreted as the special - // value auto. ("auto" is translated to NaN.) - double line_position; - if (position.IsAutoKeyword()) { - if (LineIsAuto()) - return; - line_position = std::numeric_limits<double>::quiet_NaN(); - } else { - DCHECK(position.IsDouble()); - line_position = position.GetAsDouble(); - if (line_position_ == line_position) - return; - } - CueWillChange(); - line_position_ = line_position; - CueDidChange(); -} - -#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - bool VTTCue::TextPositionIsAuto() const { return std::isnan(text_position_); } -#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - V8UnionAutoKeywordOrDouble* VTTCue::position() const { if (TextPositionIsAuto()) { return MakeGarbageCollected<V8UnionAutoKeywordOrDouble>( @@ -435,43 +391,6 @@ void VTTCue::setPosition(const V8UnionAutoKeywordOrDouble* position, CueDidChange(); } -#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - -void VTTCue::position(DoubleOrAutoKeyword& result) const { - if (TextPositionIsAuto()) - result.SetAutoKeyword(AutoKeyword()); - else - result.SetDouble(text_position_); -} - -void VTTCue::setPosition(const DoubleOrAutoKeyword& position, - ExceptionState& exception_state) { - // http://dev.w3.org/html5/webvtt/#dfn-vttcue-position - // On setting, if the new value is negative or greater than 100, then an - // IndexSizeError exception must be thrown. Otherwise, the WebVTT cue - // position must be set to the new value; if the new value is the string - // "auto", then it must be interpreted as the special value auto. - double text_position; - if (position.IsAutoKeyword()) { - if (TextPositionIsAuto()) - return; - text_position = std::numeric_limits<double>::quiet_NaN(); - } else { - DCHECK(position.IsDouble()); - if (IsInvalidPercentage(position.GetAsDouble(), exception_state)) - return; - text_position = position.GetAsDouble(); - if (text_position_ == text_position) - return; - } - - CueWillChange(); - text_position_ = text_position; - CueDidChange(); -} - -#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - void VTTCue::setSize(double size, ExceptionState& exception_state) { // http://dev.w3.org/html5/webvtt/#dfn-vttcue-size // On setting, if the new value is negative or greater than 100, then throw @@ -1205,8 +1124,10 @@ void VTTCue::ParseSettings(const VTTRegionMap* region_map, break; } case kRegionId: - if (region_map) - region_ = region_map->at(input.ExtractString(value_run)); + if (region_map) { + auto it = region_map->find(input.ExtractString(value_run)); + region_ = it != region_map->end() ? it->value : nullptr; + } break; case kNone: break; diff --git a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.h b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.h index aefe50f7552..04cab19c06d 100644 --- a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.h +++ b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue.h @@ -38,7 +38,6 @@ namespace blink { class Document; -class DoubleOrAutoKeyword; class ExecutionContext; class V8UnionAutoKeywordOrDouble; class VTTCue; @@ -119,22 +118,12 @@ class CORE_EXPORT VTTCue final : public TextTrackCue { bool snapToLines() const { return snap_to_lines_; } void setSnapToLines(bool); -#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) V8UnionAutoKeywordOrDouble* line() const; void setLine(const V8UnionAutoKeywordOrDouble* position); -#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - void line(DoubleOrAutoKeyword&) const; - void setLine(const DoubleOrAutoKeyword&); -#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) -#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) V8UnionAutoKeywordOrDouble* position() const; void setPosition(const V8UnionAutoKeywordOrDouble* position, ExceptionState& exception_state); -#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) - void position(DoubleOrAutoKeyword&) const; - void setPosition(const DoubleOrAutoKeyword&, ExceptionState&); -#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION) double size() const { return cue_size_; } void setSize(double, ExceptionState&); diff --git a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h index 1a548cad887..c0b4a8e28d3 100644 --- a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h +++ b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h @@ -30,7 +30,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_SCANNER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_SCANNER_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/text/parsing_utilities.h" @@ -54,6 +53,8 @@ class CORE_EXPORT VTTScanner { public: explicit VTTScanner(const String& line); + VTTScanner(const VTTScanner&) = delete; + VTTScanner& operator=(const VTTScanner&) = delete; typedef const LChar* Position; @@ -162,8 +163,6 @@ class CORE_EXPORT VTTScanner { const UChar* characters16; } end_; bool is_8bit_; - - DISALLOW_COPY_AND_ASSIGN(VTTScanner); }; inline wtf_size_t VTTScanner::Run::length() const { diff --git a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_tokenizer.h b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_tokenizer.h index e10ae68710c..0b12beb7f84 100644 --- a/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_tokenizer.h +++ b/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_tokenizer.h @@ -31,7 +31,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_TOKENIZER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_TOKENIZER_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/html/parser/input_stream_preprocessor.h" #include "third_party/blink/renderer/core/html/track/vtt/vtt_token.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -43,6 +42,8 @@ class VTTTokenizer { public: explicit VTTTokenizer(const String& input); + VTTTokenizer(const VTTTokenizer&) = delete; + VTTTokenizer& operator=(const VTTTokenizer&) = delete; bool NextToken(VTTToken&); @@ -53,8 +54,6 @@ class VTTTokenizer { // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream InputStreamPreprocessor<VTTTokenizer> input_stream_preprocessor_; - - DISALLOW_COPY_AND_ASSIGN(VTTTokenizer); }; } // namespace blink |