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

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

Issue 2335193005: Release the buffer in StringBuilder::toString() and toAtomicString(). (Closed)
Patch Set: Make m_string and m_buffer exclusive to each other. Created 4 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
Index: third_party/WebKit/Source/wtf/text/StringBuilder.h
diff --git a/third_party/WebKit/Source/wtf/text/StringBuilder.h b/third_party/WebKit/Source/wtf/text/StringBuilder.h
index 3b2c36556851c9456079033f7f69041c032140f4..3cc8108b8a3d236e2d9e807d3116343f9d36f34f 100644
--- a/third_party/WebKit/Source/wtf/text/StringBuilder.h
+++ b/third_party/WebKit/Source/wtf/text/StringBuilder.h
@@ -116,7 +116,6 @@ public:
return;
}
ensureBuffer16(1);
- m_string = String();
m_buffer16->append(c);
++m_length;
}
@@ -128,7 +127,6 @@ public:
return;
}
ensureBuffer8(1);
- m_string = String();
m_buffer8->append(c);
++m_length;
}
@@ -226,7 +224,7 @@ private:
void createBuffer8(unsigned addedSize);
void createBuffer16(unsigned addedSize);
-
+ void clearBuffer();
bool hasBuffer() const { return m_buffer; }
String m_string;

Powered by Google App Engine
This is Rietveld 408576698