Reviewed by Trey.
<rdar://problem/
3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
* khtml/misc/stringit.h:
(khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
stableUnicode() method to get the unicode pointer.
* kwq/KWQString.h:
* kwq/KWQString.mm:
(QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
It does not leave around a zombie internal data handle but rather destroys it right away,
and leaves the object pointing to the new handle (which it can then deref). This makes
the code more clear.
(QString::~QString): Simplify.
(QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
is internal to a string besides this one. This guarantees that if you get the unicode()
pointer, it won't go bad so long as this string is still alive.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7060
268f45cc-cd09-0410-ab3c-
d52691b4dbfc