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

Unified Diff: third_party/WebKit/Source/wtf/text/StringImpl.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/StringImpl.h
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h
index 5681b234d3b9d8251b1f97cceba8f63211807751..521d59a2f7e82806e65347aa2242d978ae6bd50f 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -218,15 +218,6 @@ public:
static PassRefPtr<StringImpl> createUninitialized(unsigned length, LChar*& data);
static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data);
- // If this StringImpl has only one reference, we can truncate the string by
- // updating its m_length property without actually re-allocating its buffer.
- void truncateAssumingIsolated(unsigned length)
- {
- ASSERT(hasOneRef());
- ASSERT(length <= m_length);
- m_length = length;
- }
-
unsigned length() const { return m_length; }
bool is8Bit() const { return m_is8Bit; }
@@ -452,11 +443,11 @@ private:
private:
unsigned m_refCount;
- unsigned m_length;
+ const unsigned m_length;
mutable unsigned m_hash : 24;
unsigned m_isAtomic : 1;
- unsigned m_is8Bit : 1;
- unsigned m_isStatic : 1;
+ const unsigned m_is8Bit : 1;
+ const unsigned m_isStatic : 1;
};
template <>
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.cpp ('k') | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698