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

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

Issue 1973343002: Clean up HTMLTrackElement.kind invalid/missing value default handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/VideoTrack.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 // 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/html/track/VideoTrack.h" 5 #include "core/html/track/VideoTrack.h"
6 6
7 #include "core/html/HTMLMediaElement.h" 7 #include "core/html/HTMLMediaElement.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 VideoTrack::VideoTrack(const String& id, const AtomicString& kind, const AtomicS tring& label, const AtomicString& language, bool selected) 11 VideoTrack::VideoTrack(const String& id, const AtomicString& kind, const AtomicS tring& label, const AtomicString& language, bool selected)
12 : TrackBase(WebMediaPlayer::VideoTrack, label, language, id) 12 : TrackBase(WebMediaPlayer::VideoTrack, kind, label, language, id)
13 , m_selected(selected) 13 , m_selected(selected)
14 { 14 {
15 setKind(kind);
16 } 15 }
17 16
18 VideoTrack::~VideoTrack() 17 VideoTrack::~VideoTrack()
19 { 18 {
20 } 19 }
21 20
22 DEFINE_TRACE(VideoTrack) 21 DEFINE_TRACE(VideoTrack)
23 { 22 {
24 TrackBase::trace(visitor); 23 TrackBase::trace(visitor);
25 } 24 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 67 }
69 68
70 const AtomicString& VideoTrack::commentaryKeyword() 69 const AtomicString& VideoTrack::commentaryKeyword()
71 { 70 {
72 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("commentary")); 71 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("commentary"));
73 return keyword; 72 return keyword;
74 } 73 }
75 74
76 bool VideoTrack::isValidKindKeyword(const String& kind) 75 bool VideoTrack::isValidKindKeyword(const String& kind)
77 { 76 {
78 return (kind == alternativeKeyword()) 77 return kind == alternativeKeyword()
79 || (kind == captionsKeyword()) 78 || kind == captionsKeyword()
80 || (kind == mainKeyword()) 79 || kind == mainKeyword()
81 || (kind == signKeyword()) 80 || kind == signKeyword()
82 || (kind == subtitlesKeyword()) 81 || kind == subtitlesKeyword()
83 || (kind == commentaryKeyword()) 82 || kind == commentaryKeyword()
84 || (kind == emptyAtom); 83 || kind == emptyAtom;
85 }
86
87 AtomicString VideoTrack::invalidValueDefaultKind() const
88 {
89 return emptyAtom;
90 } 84 }
91 85
92 } // namespace blink 86 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/track/VideoTrack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698