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

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

Issue 2796233002: Rewrite references to "wtf/" to "platform/wtf/" in platform/exported. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/platform/URLConversion.h" 5 #include "public/platform/URLConversion.h"
6 6
7 #include "platform/wtf/text/StringUTF8Adaptor.h"
8 #include "platform/wtf/text/WTFString.h"
7 #include "public/platform/WebString.h" 9 #include "public/platform/WebString.h"
8 #include "url/gurl.h" 10 #include "url/gurl.h"
9 #include "wtf/text/StringUTF8Adaptor.h"
10 #include "wtf/text/WTFString.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 GURL WebStringToGURL(const WebString& webString) { 14 GURL WebStringToGURL(const WebString& webString) {
15 if (webString.isEmpty()) 15 if (webString.isEmpty())
16 return GURL(); 16 return GURL();
17 17
18 String str = webString; 18 String str = webString;
19 if (str.is8Bit()) { 19 if (str.is8Bit()) {
20 // Ensure the (possibly Latin-1) 8-bit string is UTF-8 for GURL. 20 // Ensure the (possibly Latin-1) 8-bit string is UTF-8 for GURL.
21 StringUTF8Adaptor utf8(str); 21 StringUTF8Adaptor utf8(str);
22 return GURL(utf8.asStringPiece()); 22 return GURL(utf8.asStringPiece());
23 } 23 }
24 24
25 // GURL can consume UTF-16 directly. 25 // GURL can consume UTF-16 directly.
26 return GURL(base::StringPiece16(str.characters16(), str.length())); 26 return GURL(base::StringPiece16(str.characters16(), str.length()));
27 } 27 }
28 28
29 } // namespace blink 29 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698