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

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

Issue 2033503002: Add StringView::toAtomicString(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. 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 WTF_StringView_h 5 #ifndef WTF_StringView_h
6 #define WTF_StringView_h 6 #define WTF_StringView_h
7 7
8 #include "wtf/Allocator.h" 8 #include "wtf/Allocator.h"
9 #if DCHECK_IS_ON() 9 #if DCHECK_IS_ON()
10 #include "wtf/RefPtr.h" 10 #include "wtf/RefPtr.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 const UChar* characters16() const 108 const UChar* characters16() const
109 { 109 {
110 ASSERT(!is8Bit()); 110 ASSERT(!is8Bit());
111 return m_data.characters16; 111 return m_data.characters16;
112 } 112 }
113 113
114 const void* bytes() const { return m_data.bytes; } 114 const void* bytes() const { return m_data.bytes; }
115 115
116 String toString() const; 116 String toString() const;
117 AtomicString toAtomicString() const;
117 118
118 private: 119 private:
119 void set(StringImpl&, unsigned offset, unsigned length); 120 void set(StringImpl&, unsigned offset, unsigned length);
120 121
121 #if DCHECK_IS_ON() 122 #if DCHECK_IS_ON()
122 RefPtr<StringImpl> m_impl; 123 RefPtr<StringImpl> m_impl;
123 #endif 124 #endif
124 union DataUnion { 125 union DataUnion {
125 const LChar* characters8; 126 const LChar* characters8;
126 const UChar* characters16; 127 const UChar* characters16;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 inline bool operator!=(const StringView& a, const StringView& b) 203 inline bool operator!=(const StringView& a, const StringView& b)
203 { 204 {
204 return !(a == b); 205 return !(a == b);
205 } 206 }
206 207
207 } // namespace WTF 208 } // namespace WTF
208 209
209 using WTF::StringView; 210 using WTF::StringView;
210 211
211 #endif 212 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp ('k') | third_party/WebKit/Source/wtf/text/StringView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698