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

Unified Diff: Source/wtf/text/StringBuffer.h

Issue 24043003: SerializedScriptValue's Writer calls realloc a lot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/bindings/v8/SerializedScriptValue.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringBuffer.h
diff --git a/Source/wtf/text/StringBuffer.h b/Source/wtf/text/StringBuffer.h
index 25be1ff5379328c3b6cb36456bc3e4ec643a1249..1b3b55dc8e7e0a1f9178e71a6e4b0055fb111e1c 100644
--- a/Source/wtf/text/StringBuffer.h
+++ b/Source/wtf/text/StringBuffer.h
@@ -73,7 +73,7 @@ public:
shrink(newLength);
}
- unsigned length() const { return m_data->length(); }
+ unsigned length() const { return m_data ? m_data->length() : 0; }
CharType* characters() { return length() ? const_cast<CharType*>(m_data->getCharacters<CharType>()) : 0; }
CharType& operator[](unsigned i) { ASSERT_WITH_SECURITY_IMPLICATION(i < length()); return characters()[i]; }
« no previous file with comments | « Source/bindings/v8/SerializedScriptValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698