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 bf33deae45f3d3d5ded33600b83432419aea4d32..eb6262143e8d937ecc35f9c403b4115153292952 100644 |
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h |
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h |
@@ -122,9 +122,10 @@ private: |
void* operator new(size_t, void* ptr) { return ptr; } |
void operator delete(void*); |
- // Used to construct static strings, which have an special refCount that can never hit zero. |
- // This means that the static string will never be destroyed, which is important because |
- // static strings will be shared across threads & ref-counted in a non-threadsafe manner. |
+ // Used to construct static strings, which have an special refCount that can |
+ // never hit zero. This means that the static string will never be |
+ // destroyed, which is important because static strings will be shared |
+ // across threads & ref-counted in a non-threadsafe manner. |
enum ConstructEmptyStringTag { ConstructEmptyString }; |
explicit StringImpl(ConstructEmptyStringTag) |
: m_refCount(1) |
@@ -134,9 +135,10 @@ private: |
, m_is8Bit(true) |
, m_isStatic(true) |
{ |
- // Ensure that the hash is computed so that AtomicStringHash can call existingHash() |
- // with impunity. The empty string is special because it is never entered into |
- // AtomicString's HashKey, but still needs to compare correctly. |
+ // Ensure that the hash is computed so that AtomicStringHash can call |
+ // existingHash() with impunity. The empty string is special because it |
+ // is never entered into AtomicString's HashKey, but still needs to |
+ // compare correctly. |
STRING_STATS_ADD_8BIT_STRING(m_length); |
hash(); |
} |
@@ -215,12 +217,13 @@ public: |
static PassRefPtr<StringImpl> createUninitialized(unsigned length, LChar*& data); |
static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data); |
- // Reallocate the StringImpl. The originalString must be only owned by the PassRefPtr. |
- // Just like the input pointer of realloc(), the originalString can't be used after this function. |
+ // Reallocate the StringImpl. The originalString must be only owned by the |
+ // PassRefPtr. Just like the input pointer of realloc(), the originalString |
+ // can't be used after this function. |
static PassRefPtr<StringImpl> reallocate(PassRefPtr<StringImpl> originalString, unsigned length); |
- // If this StringImpl has only one reference, we can truncate the string by updating |
- // its m_length property without actually re-allocating its buffer. |
+ // 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()); |
@@ -245,13 +248,15 @@ public: |
bool isStatic() const { return m_isStatic; } |
private: |
- // The high bits of 'hash' are always empty, but we prefer to store our flags |
- // in the low bits because it makes them slightly more efficient to access. |
- // So, we shift left and right when setting and getting our hash code. |
+ // The high bits of 'hash' are always empty, but we prefer to store our |
+ // flags in the low bits because it makes them slightly more efficient to |
+ // access. So, we shift left and right when setting and getting our hash |
+ // code. |
void setHash(unsigned hash) const |
{ |
ASSERT(!hasHash()); |
- // Multiple clients assume that StringHasher is the canonical string hash function. |
+ // Multiple clients assume that StringHasher is the canonical string |
+ // hash function. |
ASSERT(hash == (is8Bit() ? StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length) : StringHasher::computeHashAndMaskTop8Bits(characters16(), m_length))); |
m_hash = hash; |
ASSERT(hash); // Verify that 0 is a valid sentinel hash value. |
@@ -346,9 +351,10 @@ public: |
int64_t toInt64(bool* ok = 0); // ignores trailing garbage |
uint64_t toUInt64(bool* ok = 0); // ignores trailing garbage |
- // FIXME: Like the strict functions above, these give false for "ok" when there is trailing garbage. |
- // Like the non-strict functions above, these return the value when there is trailing garbage. |
- // It would be better if these were more consistent with the above functions instead. |
+ // FIXME: Like the strict functions above, these give false for "ok" when |
+ // there is trailing garbage. Like the non-strict functions above, these |
+ // return the value when there is trailing garbage. It would be better if |
+ // these were more consistent with the above functions instead. |
double toDouble(bool* ok = 0); |
float toFloat(bool* ok = 0); |
@@ -363,8 +369,8 @@ public: |
PassRefPtr<StringImpl> stripWhiteSpace(); |
PassRefPtr<StringImpl> stripWhiteSpace(IsWhiteSpaceFunctionPtr); |
- PassRefPtr<StringImpl> simplifyWhiteSpace(StripBehavior stripBehavior = StripExtraWhiteSpace); |
- PassRefPtr<StringImpl> simplifyWhiteSpace(IsWhiteSpaceFunctionPtr, StripBehavior stripBehavior = StripExtraWhiteSpace); |
+ PassRefPtr<StringImpl> simplifyWhiteSpace(StripBehavior = StripExtraWhiteSpace); |
+ PassRefPtr<StringImpl> simplifyWhiteSpace(IsWhiteSpaceFunctionPtr, StripBehavior = StripExtraWhiteSpace); |
PassRefPtr<StringImpl> removeCharacters(CharacterMatchFunctionPtr); |
template <typename CharType> |