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

Unified Diff: Source/wtf/text/StringImpl.cpp

Issue 21262003: Remove String::adopt(Vector<UChar>) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo Created 7 years, 5 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/wtf/text/StringImpl.h ('k') | Source/wtf/text/WTFString.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringImpl.cpp
diff --git a/Source/wtf/text/StringImpl.cpp b/Source/wtf/text/StringImpl.cpp
index 16a53ba3c0225a4bc75a0bdae99116a14f3215cd..f4fdbde3e2b105b21d9ded561149bed515f09d89 100644
--- a/Source/wtf/text/StringImpl.cpp
+++ b/Source/wtf/text/StringImpl.cpp
@@ -258,18 +258,6 @@ StringImpl::~StringImpl()
if (isAtomic())
AtomicString::remove(this);
-
- BufferOwnership ownership = bufferOwnership();
-
- if (ownership == BufferInternal)
- return;
- if (ownership == BufferOwned) {
- // We use m_data8, but since it is a union with m_data16 this works either way.
- ASSERT(m_data8);
- fastFree(const_cast<LChar*>(m_data8));
- return;
- }
- ASSERT_NOT_REACHED();
}
PassRefPtr<StringImpl> StringImpl::createFromLiteral(const char* characters, unsigned length)
@@ -326,8 +314,8 @@ PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length, UChar*&
PassRefPtr<StringImpl> StringImpl::reallocate(PassRefPtr<StringImpl> originalString, unsigned length, LChar*& data)
{
ASSERT(originalString->is8Bit());
+ ASSERT(!originalString->isASCIILiteral());
ASSERT(originalString->hasOneRef());
- ASSERT(originalString->bufferOwnership() == BufferInternal);
if (!length) {
data = 0;
@@ -347,8 +335,8 @@ PassRefPtr<StringImpl> StringImpl::reallocate(PassRefPtr<StringImpl> originalStr
PassRefPtr<StringImpl> StringImpl::reallocate(PassRefPtr<StringImpl> originalString, unsigned length, UChar*& data)
{
ASSERT(!originalString->is8Bit());
+ ASSERT(!originalString->isASCIILiteral());
ASSERT(originalString->hasOneRef());
- ASSERT(originalString->bufferOwnership() == BufferInternal);
if (!length) {
data = 0;
« no previous file with comments | « Source/wtf/text/StringImpl.h ('k') | Source/wtf/text/WTFString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698