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

Unified Diff: Source/core/css/parser/CSSToken.cpp

Issue 123053002: Add very basic CSS3 Syntax compatible tokenizer Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add CSSToken file Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/CSSToken.cpp
diff --git a/Source/platform/PlatformThreadData.cpp b/Source/core/css/parser/CSSToken.cpp
similarity index 65%
copy from Source/platform/PlatformThreadData.cpp
copy to Source/core/css/parser/CSSToken.cpp
index b23dbed9d8e0a82d135e81fc75b4aef15f82d420..b10d9a4d5793a046a0392290cd19b7139dda1507 100644
--- a/Source/platform/PlatformThreadData.cpp
+++ b/Source/core/css/parser/CSSToken.cpp
@@ -29,35 +29,54 @@
*/
#include "config.h"
-#include "platform/PlatformThreadData.h"
-
-#include "platform/ThreadTimers.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/ThreadSpecific.h"
+#include "core/css/parser/CSSToken.h"
namespace WebCore {
-static ThreadSpecific<PlatformThreadData>* s_data;
+CSSToken::CSSToken(CSSTokenType type)
+ : m_type(type)
+{
+}
+
+// Just a helper used for Delim tokens.
+CSSToken::CSSToken(CSSTokenType type, UChar c)
+ : m_type(type)
+ , m_delimeter(c)
+{
+ ASSERT(m_type == DelimToken);
+}
+
+CSSToken::CSSToken(CSSTokenType type, String value)
+ : m_type(type)
+ , m_value(value)
+{
+}
-PlatformThreadData::PlatformThreadData()
- : m_threadTimers(adoptPtr(new ThreadTimers))
+CSSToken::CSSToken(CSSTokenType type, String name, HashTokenType hashType)
+ : m_type(type)
+ , m_value(name)
+ , m_hashTokenType(hashType)
{
+ ASSERT(m_type == HashToken);
}
-PlatformThreadData::~PlatformThreadData()
+CSSToken::CSSToken(CSSTokenType type, String value, double, NumericValueType)
{
+ ASSERT(type == NumberToken);
+ m_type = type;
}
-void PlatformThreadData::destroy()
+void CSSToken::convertToDimensionWithUnit(String unit)
{
- m_threadTimers.clear();
+ ASSERT(m_type == NumberToken);
+ m_type = DimensionToken;
+ m_unit = unit;
}
-PlatformThreadData& PlatformThreadData::current()
+void CSSToken::convertToPercentage()
{
- if (!s_data)
- s_data = new ThreadSpecific<PlatformThreadData>;
- return **s_data;
+ ASSERT(m_type == NumberToken);
+ m_type = PercentageToken;
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698