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

Side by Side Diff: Source/core/html/track/InbandTextTrack.cpp

Issue 60203008: Remove the mode getter/setter for in-band text tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « Source/core/html/track/InbandTextTrack.h ('k') | Source/core/html/track/TextTrack.h » ('j') | 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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 break; 68 break;
69 } 69 }
70 } 70 }
71 71
72 InbandTextTrack::~InbandTextTrack() 72 InbandTextTrack::~InbandTextTrack()
73 { 73 {
74 // Make sure m_private was cleared by trackRemoved() before destruction. 74 // Make sure m_private was cleared by trackRemoved() before destruction.
75 ASSERT(!m_private); 75 ASSERT(!m_private);
76 } 76 }
77 77
78 void InbandTextTrack::setMode(const AtomicString& mode)
79 {
80 TextTrack::setMode(mode);
81
82 if (!m_private)
83 return;
84
85 if (mode == TextTrack::disabledKeyword())
86 m_private->setMode(InbandTextTrackPrivate::Disabled);
87 else if (mode == TextTrack::hiddenKeyword())
88 m_private->setMode(InbandTextTrackPrivate::Hidden);
89 else if (mode == TextTrack::showingKeyword())
90 m_private->setMode(InbandTextTrackPrivate::Showing);
91 else
92 ASSERT_NOT_REACHED();
93 }
94
95 size_t InbandTextTrack::inbandTrackIndex() 78 size_t InbandTextTrack::inbandTrackIndex()
96 { 79 {
97 ASSERT(m_private); 80 ASSERT(m_private);
98 return m_private->textTrackIndex(); 81 return m_private->textTrackIndex();
99 } 82 }
100 83
101 void InbandTextTrack::trackRemoved() 84 void InbandTextTrack::trackRemoved()
102 { 85 {
103 ASSERT(m_private); 86 ASSERT(m_private);
104 m_private->setClient(0); 87 m_private->setClient(0);
105 m_private = 0; 88 m_private = 0;
106 clearClient(); 89 clearClient();
107 } 90 }
108 91
109 void InbandTextTrack::addWebVTTCue(InbandTextTrackPrivate* trackPrivate, double start, double end, const String& id, const String& content, const String& settin gs) 92 void InbandTextTrack::addWebVTTCue(InbandTextTrackPrivate* trackPrivate, double start, double end, const String& id, const String& content, const String& settin gs)
110 { 93 {
111 ASSERT_UNUSED(trackPrivate, trackPrivate == m_private); 94 ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
112 95
113 RefPtr<TextTrackCue> cue = TextTrackCue::create(document(), start, end, cont ent); 96 RefPtr<TextTrackCue> cue = TextTrackCue::create(document(), start, end, cont ent);
114 cue->setId(id); 97 cue->setId(id);
115 cue->setCueSettings(settings); 98 cue->setCueSettings(settings);
116 99
117 if (hasCue(cue.get())) 100 if (hasCue(cue.get()))
118 return; 101 return;
119 102
120 addCue(cue); 103 addCue(cue);
121 } 104 }
122 105
123 } // namespace WebCore 106 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/track/InbandTextTrack.h ('k') | Source/core/html/track/TextTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698