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

Side by Side Diff: third_party/WebKit/public/platform/WebString.h

Issue 1768063002: Introduce String::fromUTF8Lenient() and use it for cache_name in CacheStorage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated jsbell's comment Created 4 years, 9 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 | « third_party/WebKit/Source/wtf/text/WTFStringTest.cpp ('k') | no next file » | 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 BLINK_COMMON_EXPORT std::string utf8() const; 88 BLINK_COMMON_EXPORT std::string utf8() const;
89 89
90 BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data, size_t lengt h); 90 BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data, size_t lengt h);
91 BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data); 91 BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data);
92 92
93 static WebString fromUTF8(const std::string& s) 93 static WebString fromUTF8(const std::string& s)
94 { 94 {
95 return fromUTF8(s.data(), s.length()); 95 return fromUTF8(s.data(), s.length());
96 } 96 }
97 97
98 BLINK_COMMON_EXPORT static WebString fromUTF8Lenient(const char* data, size_ t length);
99
100 static WebString fromUTF8Lenient(const std::string& s)
101 {
102 return fromUTF8Lenient(s.data(), s.length());
103 }
104
98 BLINK_COMMON_EXPORT std::string latin1() const; 105 BLINK_COMMON_EXPORT std::string latin1() const;
99 106
100 BLINK_COMMON_EXPORT static WebString fromLatin1(const WebLChar* data, size_t length); 107 BLINK_COMMON_EXPORT static WebString fromLatin1(const WebLChar* data, size_t length);
101 108
102 static WebString fromLatin1(const std::string& s) 109 static WebString fromLatin1(const std::string& s)
103 { 110 {
104 return fromLatin1(reinterpret_cast<const WebLChar*>(s.data()), s.length( )); 111 return fromLatin1(reinterpret_cast<const WebLChar*>(s.data()), s.length( ));
105 } 112 }
106 113
107 template <int N> WebString(const char (&data)[N]) 114 template <int N> WebString(const char (&data)[N])
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 206 }
200 207
201 inline bool operator!=(const WebString& a, const WebString& b) 208 inline bool operator!=(const WebString& a, const WebString& b)
202 { 209 {
203 return !(a == b); 210 return !(a == b);
204 } 211 }
205 212
206 } // namespace blink 213 } // namespace blink
207 214
208 #endif 215 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/WTFStringTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698