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

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

Issue 1391153004: Make StringImpl's content immutable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug fix: StringBuffer::release returns m_data directly Created 5 years, 2 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: third_party/WebKit/Source/wtf/text/StringBuffer.h
diff --git a/third_party/WebKit/Source/wtf/text/StringBuffer.h b/third_party/WebKit/Source/wtf/text/StringBuffer.h
index 5e780e63d8090594318186c60f3d38fd1bacda0e..f38e0cf3b74bce9f400574e87fe36f8be01f557d 100644
--- a/third_party/WebKit/Source/wtf/text/StringBuffer.h
+++ b/third_party/WebKit/Source/wtf/text/StringBuffer.h
@@ -70,7 +70,7 @@ void StringBuffer<CharType>::shrink(unsigned newLength)
ASSERT(m_data);
if (m_data->length() == newLength)
return;
- m_data->truncateAssumingIsolated(newLength);
+ m_data = m_data->substring(0, newLength);
}
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698