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

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

Issue 92783002: Move code that applies to audio and video tracks into TrackBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@tmp
Patch Set: Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
acolwell GONE FROM CHROMIUM 2013/11/28 03:02:17 Since this is a new file to Blink, I believe this
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 4 *
4 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
6 * met: 7 * met:
7 * 8 *
8 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 11 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer 12 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the 13 * in the documentation and/or other materials provided with the
13 * distribution. 14 * distribution.
14 * * Neither the name of Google Inc. nor the names of its 15 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from 16 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission. 17 * this software without specific prior written permission.
17 * 18 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 30 */
30 31
31 #include "config.h" 32 #include "config.h"
32 #include "platform/PlatformThreadData.h" 33 #include "core/html/track/TrackBase.h"
33 34
34 #include "platform/ThreadTimers.h" 35 #include "core/html/HTMLMediaElement.h"
35 #include "wtf/PassOwnPtr.h"
36 #include "wtf/ThreadSpecific.h"
37 36
38 namespace WebCore { 37 namespace WebCore {
39 38
40 static ThreadSpecific<PlatformThreadData>* s_data; 39 TrackBase::TrackBase(Type type, const AtomicString& label, const AtomicString& l anguage, const AtomicString& id)
41 40 : m_type(type)
42 PlatformThreadData::PlatformThreadData() 41 , m_mediaElement(0)
43 : m_threadTimers(adoptPtr(new ThreadTimers)) 42 , m_label(label)
43 , m_language(language)
44 , m_id(id)
44 { 45 {
45 } 46 }
46 47
47 PlatformThreadData::~PlatformThreadData() 48 TrackBase::~TrackBase()
48 { 49 {
49 } 50 }
50 51
51 void PlatformThreadData::destroy() 52 void TrackBase::setKind(const AtomicString& kind)
52 { 53 {
53 m_threadTimers.clear(); 54 String oldKind = m_kind;
54 }
55 55
56 PlatformThreadData& PlatformThreadData::current() 56 if (isValidKind(kind))
57 { 57 m_kind = kind;
58 if (!s_data) 58 else
59 s_data = new ThreadSpecific<PlatformThreadData>; 59 m_kind = defaultKind();
60 return **s_data;
61 } 60 }
62 61
63 } // namespace WebCore 62 } // namespace WebCore
63
OLDNEW
« Source/core/html/track/TrackBase.h ('K') | « Source/core/html/track/TrackBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698