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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebString.cpp

Issue 2659023002: Re-add WebString::equals that takes const char* only (Closed)
Patch Set: removes ::fromUTF8(const char*) too Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/public/platform/WebString.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/public/platform/WebString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698