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

Unified Diff: Source/core/html/track/vtt/VTTToken.h

Issue 75243004: Replace character vectors with StringBuilders in the WebVTT tokenizer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase after symbolnames changed 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
« no previous file with comments | « Source/core/html/track/vtt/VTTParser.cpp ('k') | Source/core/html/track/vtt/VTTTokenizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/vtt/VTTToken.h
diff --git a/Source/core/html/track/vtt/VTTToken.h b/Source/core/html/track/vtt/VTTToken.h
index 3757a1a359b108a970e35ed7fe2e7bea3822b243..fe3cf07d77bca2ec9702777d882b7876efcb8dd2 100644
--- a/Source/core/html/track/vtt/VTTToken.h
+++ b/Source/core/html/track/vtt/VTTToken.h
@@ -31,6 +31,8 @@
#ifndef VTTToken_h
#define VTTToken_h
+#include "wtf/text/StringBuilder.h"
+
namespace WebCore {
class VTTTokenTypes {
@@ -49,7 +51,6 @@ class VTTToken {
WTF_MAKE_FAST_ALLOCATED;
public:
typedef VTTTokenTypes Type;
- typedef WTF::Vector<UChar, 1024> DataVector; // FIXME: Is this too large for WebVTT?
VTTToken() { clear(); }
@@ -62,12 +63,12 @@ public:
Type::Type type() const { return m_type; }
- const DataVector& name() const
+ StringBuilder& name()
{
return m_data;
}
- const DataVector& characters() const
+ StringBuilder& characters()
{
ASSERT(m_type == Type::Character || m_type == Type::TimestampTag);
return m_data;
@@ -93,10 +94,10 @@ public:
m_data.append(character);
}
- void appendToCharacter(const Vector<LChar, 32>& characters)
+ void appendToCharacter(const StringBuilder& characters)
{
ASSERT(m_type == Type::Character);
- m_data.appendVector(characters);
+ m_data.append(characters);
}
void beginEmptyStartTag()
@@ -150,7 +151,7 @@ public:
m_currentBuffer.clear();
}
- const DataVector& classes() const
+ StringBuilder& classes()
{
return m_classes;
}
@@ -168,7 +169,7 @@ public:
m_currentBuffer.clear();
}
- const DataVector& annotation() const
+ StringBuilder& annotation()
{
return m_annotation;
}
@@ -191,10 +192,10 @@ private:
}
Type::Type m_type;
- DataVector m_data;
- DataVector m_annotation;
- DataVector m_classes;
- DataVector m_currentBuffer;
+ StringBuilder m_data;
+ StringBuilder m_annotation;
+ StringBuilder m_classes;
+ StringBuilder m_currentBuffer;
};
}
« no previous file with comments | « Source/core/html/track/vtt/VTTParser.cpp ('k') | Source/core/html/track/vtt/VTTTokenizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698