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

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/String16WTF.h

Issue 2025503002: Revert of Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef String16WTF_h 5 #ifndef String16WTF_h
6 #define String16WTF_h 6 #define String16WTF_h
7 7
8 #include "platform/Decimal.h" 8 #include "platform/Decimal.h"
9 #include "public/platform/WebString.h" 9 #include "public/platform/WebString.h"
10 #include "wtf/text/StringBuilder.h" 10 #include "wtf/text/StringBuilder.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 bool endsWith(const String16& s) const { return m_impl.endsWith(s); } 66 bool endsWith(const String16& s) const { return m_impl.endsWith(s); }
67 bool endsWith(UChar character) const { return m_impl.endsWith(character); } 67 bool endsWith(UChar character) const { return m_impl.endsWith(character); }
68 68
69 private: 69 private:
70 WTF::String m_impl; 70 WTF::String m_impl;
71 }; 71 };
72 72
73 class String16Builder { 73 class String16Builder {
74 public: 74 public:
75 String16Builder() { } 75 String16Builder() { }
76 void append(const String16& str) { m_impl.append(StringView(str)); }; 76 void append(const String16& str) { m_impl.append(str); };
77 void append(UChar c) { m_impl.append(c); }; 77 void append(UChar c) { m_impl.append(c); };
78 void append(LChar c) { m_impl.append(c); }; 78 void append(LChar c) { m_impl.append(c); };
79 void append(char c) { m_impl.append(c); }; 79 void append(char c) { m_impl.append(c); };
80 void append(const UChar* c, size_t size) { m_impl.append(c, size); }; 80 void append(const UChar* c, size_t size) { m_impl.append(c, size); };
81 void append(const char* characters, unsigned length) { m_impl.append(charact ers, length); } 81 void append(const char* characters, unsigned length) { m_impl.append(charact ers, length); }
82 void appendNumber(int number) { m_impl.appendNumber(number); } 82 void appendNumber(int number) { m_impl.appendNumber(number); }
83 String16 toString() { return m_impl.toString(); } 83 String16 toString() { return m_impl.toString(); }
84 void reserveCapacity(unsigned newCapacity) { m_impl.reserveCapacity(newCapac ity); } 84 void reserveCapacity(unsigned newCapacity) { m_impl.reserveCapacity(newCapac ity); }
85 85
86 private: 86 private:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 template<> 131 template<>
132 struct HashTraits<String16> : SimpleClassHashTraits<String16> { 132 struct HashTraits<String16> : SimpleClassHashTraits<String16> {
133 static const bool hasIsEmptyValueFunction = true; 133 static const bool hasIsEmptyValueFunction = true;
134 static bool isEmptyValue(const String16& a) { return a.impl().isNull(); } 134 static bool isEmptyValue(const String16& a) { return a.impl().isNull(); }
135 }; 135 };
136 136
137 } // namespace WTF 137 } // namespace WTF
138 138
139 #endif // !defined(String16WTF_h) 139 #endif // !defined(String16WTF_h)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebString.cpp ('k') | third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698