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

Side by Side Diff: Source/core/platform/chromium/support/WebString.cpp

Issue 23456013: Expose latin1 methods in WebString (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 | « LayoutTests/TestExpectations ('k') | 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 WebString WebString::fromUTF8(const char* data, size_t length) 89 WebString WebString::fromUTF8(const char* data, size_t length)
90 { 90 {
91 return WTF::String::fromUTF8(data, length); 91 return WTF::String::fromUTF8(data, length);
92 } 92 }
93 93
94 WebString WebString::fromUTF8(const char* data) 94 WebString WebString::fromUTF8(const char* data)
95 { 95 {
96 return WTF::String::fromUTF8(data); 96 return WTF::String::fromUTF8(data);
97 } 97 }
98 98
99 std::string WebString::latin1() const
100 {
101 WebCString latin1 = WTF::String(m_private.get()).latin1();
102 return std::string(latin1.data(), latin1.length());
abarth-chromium 2013/08/31 18:04:18 WTF:: <--- This prefix isn't needed. Do you actu
davidben 2013/09/03 15:04:56 Removed. I was just going by the UTF-8 ones which
103 }
104
105 WebString WebString::fromLatin1(const char* data, size_t length)
106 {
107 return WTF::String(data, length);
abarth-chromium 2013/08/31 18:04:18 WTF:: <---- No need for this prefix.
davidben 2013/09/03 15:04:56 Done.
108 }
109
110 WebString WebString::fromLatin1(const char* data)
111 {
112 return WTF::String(data);
113 }
abarth-chromium 2013/08/31 18:04:18 Do you actually need this function? If not, we sh
davidben 2013/09/03 15:04:56 Removed.
114
99 bool WebString::equals(const WebString& s) const 115 bool WebString::equals(const WebString& s) const
100 { 116 {
101 return equal(m_private.get(), s.m_private.get()); 117 return equal(m_private.get(), s.m_private.get());
102 } 118 }
103 119
104 WebString::WebString(const WTF::String& s) 120 WebString::WebString(const WTF::String& s)
105 { 121 {
106 m_private = s.impl(); 122 m_private = s.impl();
107 } 123 }
108 124
(...skipping 23 matching lines...) Expand all
132 { 148 {
133 return WTF::AtomicString(m_private.get()); 149 return WTF::AtomicString(m_private.get());
134 } 150 }
135 151
136 void WebString::assign(WTF::StringImpl* p) 152 void WebString::assign(WTF::StringImpl* p)
137 { 153 {
138 m_private = p; 154 m_private = p;
139 } 155 }
140 156
141 } // namespace WebKit 157 } // namespace WebKit
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | public/platform/WebString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698