| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "public/platform/WebString.h" | 31 #include "public/platform/WebString.h" |
| 32 | 32 |
| 33 #include "wtf/text/AtomicString.h" | 33 #include "wtf/text/AtomicString.h" |
| 34 #include "wtf/text/CString.h" | 34 #include "wtf/text/CString.h" |
| 35 #include "wtf/text/StringUTF8Adaptor.h" | 35 #include "wtf/text/StringUTF8Adaptor.h" |
| 36 #include "wtf/text/StringView.h" | |
| 37 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 38 | 37 |
| 39 namespace blink { | 38 namespace blink { |
| 40 | 39 |
| 41 void WebString::reset() | 40 void WebString::reset() |
| 42 { | 41 { |
| 43 m_private.reset(); | 42 m_private.reset(); |
| 44 } | 43 } |
| 45 | 44 |
| 46 void WebString::assign(const WebString& other) | 45 void WebString::assign(const WebString& other) |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 { | 126 { |
| 128 assign(s.impl()); | 127 assign(s.impl()); |
| 129 return *this; | 128 return *this; |
| 130 } | 129 } |
| 131 | 130 |
| 132 WebString::operator WTF::String() const | 131 WebString::operator WTF::String() const |
| 133 { | 132 { |
| 134 return m_private.get(); | 133 return m_private.get(); |
| 135 } | 134 } |
| 136 | 135 |
| 137 WebString::operator WTF::StringView() const | |
| 138 { | |
| 139 return StringView(m_private.get()); | |
| 140 } | |
| 141 | |
| 142 WebString::WebString(const WTF::AtomicString& s) | 136 WebString::WebString(const WTF::AtomicString& s) |
| 143 { | 137 { |
| 144 assign(s.getString()); | 138 assign(s.getString()); |
| 145 } | 139 } |
| 146 | 140 |
| 147 WebString& WebString::operator=(const WTF::AtomicString& s) | 141 WebString& WebString::operator=(const WTF::AtomicString& s) |
| 148 { | 142 { |
| 149 assign(s.getString()); | 143 assign(s.getString()); |
| 150 return *this; | 144 return *this; |
| 151 } | 145 } |
| 152 | 146 |
| 153 WebString::operator WTF::AtomicString() const | 147 WebString::operator WTF::AtomicString() const |
| 154 { | 148 { |
| 155 return WTF::AtomicString(m_private.get()); | 149 return WTF::AtomicString(m_private.get()); |
| 156 } | 150 } |
| 157 | 151 |
| 158 void WebString::assign(WTF::StringImpl* p) | 152 void WebString::assign(WTF::StringImpl* p) |
| 159 { | 153 { |
| 160 m_private = p; | 154 m_private = p; |
| 161 } | 155 } |
| 162 | 156 |
| 163 } // namespace blink | 157 } // namespace blink |
| OLD | NEW |