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 "modules/mediasource/TrackDefault.h" | 5 #include "modules/mediasource/TrackDefault.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "core/html/track/AudioTrack.h" | 8 #include "core/html/track/AudioTrack.h" |
9 #include "core/html/track/TextTrack.h" | 9 #include "core/html/track/TextTrack.h" |
10 #include "core/html/track/VideoTrack.h" | 10 #include "core/html/track/VideoTrack.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // If any string in |kinds| contains a value that is not listed in
the | 67 // If any string in |kinds| contains a value that is not listed in
the |
68 // text track kind list, then throw a TypeError and abort these | 68 // text track kind list, then throw a TypeError and abort these |
69 // steps. | 69 // steps. |
70 for (const String& kind : kinds) { | 70 for (const String& kind : kinds) { |
71 if (!TextTrack::isValidKindKeyword(kind)) { | 71 if (!TextTrack::isValidKindKeyword(kind)) { |
72 exceptionState.throwTypeError("Invalid text track default kind '
" + kind + "'"); | 72 exceptionState.throwTypeError("Invalid text track default kind '
" + kind + "'"); |
73 return nullptr; | 73 return nullptr; |
74 } | 74 } |
75 } | 75 } |
76 } else { | 76 } else { |
77 ASSERT_NOT_REACHED(); // IDL enforcement should prevent this case. | 77 NOTREACHED(); // IDL enforcement should prevent this case. |
78 return nullptr; | 78 return nullptr; |
79 } | 79 } |
80 | 80 |
81 // 3. Set the type attribute on this new object to |type|. | 81 // 3. Set the type attribute on this new object to |type|. |
82 // 4. Set the language attribute on this new object to |language|. | 82 // 4. Set the language attribute on this new object to |language|. |
83 // 5. Set the label attribute on this new object to |label|. | 83 // 5. Set the label attribute on this new object to |label|. |
84 // 6. Set the kinds attribute on this new object to |kinds|. | 84 // 6. Set the kinds attribute on this new object to |kinds|. |
85 // 7. Set the byteStreamTrackID attribute on this new object to | 85 // 7. Set the byteStreamTrackID attribute on this new object to |
86 // |byteStreamTrackID|. | 86 // |byteStreamTrackID|. |
87 // These steps are done as constructor initializers. | 87 // These steps are done as constructor initializers. |
88 return new TrackDefault(type, language, label, kinds, byteStreamTrackID); | 88 return new TrackDefault(type, language, label, kinds, byteStreamTrackID); |
89 } | 89 } |
90 | 90 |
91 TrackDefault::~TrackDefault() | 91 TrackDefault::~TrackDefault() |
92 { | 92 { |
93 } | 93 } |
94 | 94 |
95 TrackDefault::TrackDefault(const AtomicString& type, const String& language, con
st String& label, const Vector<String>& kinds, const String& byteStreamTrackID) | 95 TrackDefault::TrackDefault(const AtomicString& type, const String& language, con
st String& label, const Vector<String>& kinds, const String& byteStreamTrackID) |
96 : m_type(type) | 96 : m_type(type) |
97 , m_byteStreamTrackID(byteStreamTrackID) | 97 , m_byteStreamTrackID(byteStreamTrackID) |
98 , m_language(language) | 98 , m_language(language) |
99 , m_label(label) | 99 , m_label(label) |
100 , m_kinds(kinds) | 100 , m_kinds(kinds) |
101 { | 101 { |
102 } | 102 } |
103 | 103 |
104 } // namespace blink | 104 } // namespace blink |
OLD | NEW |