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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« Source/core/html/track/TrackBase.h ('K') | « Source/core/html/track/TrackBase.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TrackBase.cpp
diff --git a/Source/platform/PlatformThreadData.cpp b/Source/core/html/track/TrackBase.cpp
similarity index 72%
copy from Source/platform/PlatformThreadData.cpp
copy to Source/core/html/track/TrackBase.cpp
index b23dbed9d8e0a82d135e81fc75b4aef15f82d420..9b86af0bd850764105f99c9e895c1cb5393655b2 100644
--- a/Source/platform/PlatformThreadData.cpp
+++ b/Source/core/html/track/TrackBase.cpp
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * 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
+ * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,35 +30,34 @@
*/
#include "config.h"
-#include "platform/PlatformThreadData.h"
+#include "core/html/track/TrackBase.h"
-#include "platform/ThreadTimers.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/ThreadSpecific.h"
+#include "core/html/HTMLMediaElement.h"
namespace WebCore {
-static ThreadSpecific<PlatformThreadData>* s_data;
-
-PlatformThreadData::PlatformThreadData()
- : m_threadTimers(adoptPtr(new ThreadTimers))
+TrackBase::TrackBase(Type type, const AtomicString& label, const AtomicString& language, const AtomicString& id)
+ : m_type(type)
+ , m_mediaElement(0)
+ , m_label(label)
+ , m_language(language)
+ , m_id(id)
{
}
-PlatformThreadData::~PlatformThreadData()
+TrackBase::~TrackBase()
{
}
-void PlatformThreadData::destroy()
+void TrackBase::setKind(const AtomicString& kind)
{
- m_threadTimers.clear();
-}
+ String oldKind = m_kind;
-PlatformThreadData& PlatformThreadData::current()
-{
- if (!s_data)
- s_data = new ThreadSpecific<PlatformThreadData>;
- return **s_data;
+ if (isValidKind(kind))
+ m_kind = kind;
+ else
+ m_kind = defaultKind();
}
} // namespace WebCore
+
« 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