| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 std::string WebString::utf8(UTF8ConversionMode mode) const { | 83 std::string WebString::utf8(UTF8ConversionMode mode) const { |
| 84 StringUTF8Adaptor utf8(m_private.get(), | 84 StringUTF8Adaptor utf8(m_private.get(), |
| 85 static_cast<WTF::UTF8ConversionMode>(mode)); | 85 static_cast<WTF::UTF8ConversionMode>(mode)); |
| 86 return std::string(utf8.data(), utf8.length()); | 86 return std::string(utf8.data(), utf8.length()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 WebString WebString::fromUTF8(const char* data, size_t length) { | 89 WebString WebString::fromUTF8(const char* data, size_t length) { |
| 90 return String::fromUTF8(data, length); | 90 return String::fromUTF8(data, length); |
| 91 } | 91 } |
| 92 | 92 |
| 93 WebString WebString::fromUTF8(const char* data) { | |
| 94 return String::fromUTF8(data); | |
| 95 } | |
| 96 | |
| 97 WebString WebString::fromUTF16(const base::string16& s) { | 93 WebString WebString::fromUTF16(const base::string16& s) { |
| 98 WebString string; | 94 WebString string; |
| 99 string.assign(s.data(), s.length()); | 95 string.assign(s.data(), s.length()); |
| 100 return string; | 96 return string; |
| 101 } | 97 } |
| 102 | 98 |
| 103 WebString WebString::fromUTF16(const base::NullableString16& s) { | 99 WebString WebString::fromUTF16(const base::NullableString16& s) { |
| 104 WebString string; | 100 WebString string; |
| 105 if (s.is_null()) | 101 if (s.is_null()) |
| 106 string.reset(); | 102 string.reset(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 181 |
| 186 WebString::operator WTF::AtomicString() const { | 182 WebString::operator WTF::AtomicString() const { |
| 187 return WTF::AtomicString(m_private.get()); | 183 return WTF::AtomicString(m_private.get()); |
| 188 } | 184 } |
| 189 | 185 |
| 190 void WebString::assign(WTF::StringImpl* p) { | 186 void WebString::assign(WTF::StringImpl* p) { |
| 191 m_private = p; | 187 m_private = p; |
| 192 } | 188 } |
| 193 | 189 |
| 194 } // namespace blink | 190 } // namespace blink |
| OLD | NEW |