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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringImpl.h

Issue 2033293002: Implement StringImpl sharing for StringView::toString(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix preload scanner bug. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 ALWAYS_INLINE static PassRefPtr<StringImpl> create(const char* s) { return c reate(reinterpret_cast<const LChar*>(s)); } 217 ALWAYS_INLINE static PassRefPtr<StringImpl> create(const char* s) { return c reate(reinterpret_cast<const LChar*>(s)); }
218 218
219 static PassRefPtr<StringImpl> createUninitialized(unsigned length, LChar*& d ata); 219 static PassRefPtr<StringImpl> createUninitialized(unsigned length, LChar*& d ata);
220 static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& d ata); 220 static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& d ata);
221 221
222 unsigned length() const { return m_length; } 222 unsigned length() const { return m_length; }
223 bool is8Bit() const { return m_is8Bit; } 223 bool is8Bit() const { return m_is8Bit; }
224 224
225 ALWAYS_INLINE const LChar* characters8() const { ASSERT(is8Bit()); return re interpret_cast<const LChar*>(this + 1); } 225 ALWAYS_INLINE const LChar* characters8() const { ASSERT(is8Bit()); return re interpret_cast<const LChar*>(this + 1); }
226 ALWAYS_INLINE const UChar* characters16() const { ASSERT(!is8Bit()); return reinterpret_cast<const UChar*>(this + 1); } 226 ALWAYS_INLINE const UChar* characters16() const { ASSERT(!is8Bit()); return reinterpret_cast<const UChar*>(this + 1); }
227 ALWAYS_INLINE const void* bytes() const { return reinterpret_cast<const void *>(this + 1); }
227 228
228 template <typename CharType> 229 template <typename CharType>
229 ALWAYS_INLINE const CharType * getCharacters() const; 230 ALWAYS_INLINE const CharType * getCharacters() const;
230 231
231 size_t sizeInBytes() const; 232 size_t sizeInBytes() const;
232 233
233 bool isAtomic() const { return m_isAtomic; } 234 bool isAtomic() const { return m_isAtomic; }
234 void setIsAtomic(bool isAtomic) { m_isAtomic = isAtomic; } 235 void setIsAtomic(bool isAtomic) { m_isAtomic = isAtomic; }
235 236
236 bool isStatic() const { return m_isStatic; } 237 bool isStatic() const { return m_isStatic; }
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 783
783 using WTF::StringImpl; 784 using WTF::StringImpl;
784 using WTF::equal; 785 using WTF::equal;
785 using WTF::equalNonNull; 786 using WTF::equalNonNull;
786 using WTF::TextCaseSensitivity; 787 using WTF::TextCaseSensitivity;
787 using WTF::TextCaseSensitive; 788 using WTF::TextCaseSensitive;
788 using WTF::TextCaseASCIIInsensitive; 789 using WTF::TextCaseASCIIInsensitive;
789 using WTF::TextCaseInsensitive; 790 using WTF::TextCaseInsensitive;
790 791
791 #endif 792 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698