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

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

Issue 2500723002: Add UTF-16 string literal constructors to String classes (Closed)
Patch Set: esprehn nit (cstr -> chars) Created 4 years, 1 month 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) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 AtomicString() {} 43 AtomicString() {}
44 AtomicString(const LChar* chars) 44 AtomicString(const LChar* chars)
45 : AtomicString(chars, 45 : AtomicString(chars,
46 chars ? strlen(reinterpret_cast<const char*>(chars)) : 0) { 46 chars ? strlen(reinterpret_cast<const char*>(chars)) : 0) {
47 } 47 }
48 AtomicString(const char* chars) 48 AtomicString(const char* chars)
49 : AtomicString(reinterpret_cast<const LChar*>(chars)) {} 49 : AtomicString(reinterpret_cast<const LChar*>(chars)) {}
50 AtomicString(const LChar* chars, unsigned length); 50 AtomicString(const LChar* chars, unsigned length);
51 AtomicString(const UChar* chars, unsigned length); 51 AtomicString(const UChar* chars, unsigned length);
52 AtomicString(const UChar* chars); 52 AtomicString(const UChar* chars);
53 AtomicString(const char16_t* chars)
54 : AtomicString(reinterpret_cast<const UChar*>(chars)) {}
53 55
54 template <size_t inlineCapacity> 56 template <size_t inlineCapacity>
55 explicit AtomicString(const Vector<UChar, inlineCapacity>& vector) 57 explicit AtomicString(const Vector<UChar, inlineCapacity>& vector)
56 : AtomicString(vector.data(), vector.size()) {} 58 : AtomicString(vector.data(), vector.size()) {}
57 59
58 // Constructing an AtomicString from a String / StringImpl can be expensive if 60 // Constructing an AtomicString from a String / StringImpl can be expensive if
59 // the StringImpl is not already atomic. 61 // the StringImpl is not already atomic.
60 explicit AtomicString(StringImpl* impl) : m_string(add(impl)) {} 62 explicit AtomicString(StringImpl* impl) : m_string(add(impl)) {}
61 explicit AtomicString(const String& s) : m_string(add(s.impl())) {} 63 explicit AtomicString(const String& s) : m_string(add(s.impl())) {}
62 64
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 using WTF::AtomicString; 297 using WTF::AtomicString;
296 using WTF::nullAtom; 298 using WTF::nullAtom;
297 using WTF::emptyAtom; 299 using WTF::emptyAtom;
298 using WTF::starAtom; 300 using WTF::starAtom;
299 using WTF::xmlAtom; 301 using WTF::xmlAtom;
300 using WTF::xmlnsAtom; 302 using WTF::xmlnsAtom;
301 using WTF::xlinkAtom; 303 using WTF::xlinkAtom;
302 304
303 #include "wtf/text/StringConcatenate.h" 305 #include "wtf/text/StringConcatenate.h"
304 #endif // AtomicString_h 306 #endif // AtomicString_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | third_party/WebKit/Source/wtf/text/WTFString.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698