| Index: third_party/WebKit/Source/wtf/text/StringImpl.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.cpp b/third_party/WebKit/Source/wtf/text/StringImpl.cpp
|
| index 641fbc9c72c4b7aeecf2ff0d48498bb7d27e2e20..a74a1c57be92e27f52d8906cffa53bcc41e82f14 100644
|
| --- a/third_party/WebKit/Source/wtf/text/StringImpl.cpp
|
| +++ b/third_party/WebKit/Source/wtf/text/StringImpl.cpp
|
| @@ -54,8 +54,10 @@ namespace WTF {
|
|
|
| using namespace Unicode;
|
|
|
| +#if !DCHECK_IS_ON()
|
| static_assert(sizeof(StringImpl) == 3 * sizeof(int),
|
| "StringImpl should stay small");
|
| +#endif
|
|
|
| #ifdef STRING_STATS
|
|
|
| @@ -324,6 +326,18 @@ bool StringImpl::isSafeToSendToAnotherThread() const {
|
| return false;
|
| }
|
|
|
| +#if DCHECK_IS_ON()
|
| +std::string StringImpl::asciiForDebugging() const {
|
| + const unsigned kMaxCheckLength = 64;
|
| + std::string debugString;
|
| + for (unsigned i = 0; i < length() && i < kMaxCheckLength; ++i) {
|
| + UChar c = (*this)[i];
|
| + debugString.push_back(isASCIIPrintable(c) ? c : '?');
|
| + }
|
| + return debugString;
|
| +}
|
| +#endif
|
| +
|
| PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length,
|
| LChar*& data) {
|
| if (!length) {
|
|
|