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

Side by Side Diff: net/base/net_util.cc

Issue 193072: Move StringPiece into the base namespace. It is colliding (Closed)
Patch Set: take 2 Created 11 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 | « net/base/net_module.cc ('k') | net/base/registry_controlled_domain.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 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <algorithm> 5 #include <algorithm>
6 #include <map> 6 #include <map>
7 #include <unicode/ucnv.h> 7 #include <unicode/ucnv.h>
8 #include <unicode/uidna.h> 8 #include <unicode/uidna.h>
9 #include <unicode/ulocdata.h> 9 #include <unicode/ulocdata.h>
10 #include <unicode/uniset.h> 10 #include <unicode/uniset.h>
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 } 911 }
912 912
913 std::string CanonicalizeHost(const std::wstring& host, 913 std::string CanonicalizeHost(const std::wstring& host,
914 url_canon::CanonHostInfo* host_info) { 914 url_canon::CanonHostInfo* host_info) {
915 std::string converted_host; 915 std::string converted_host;
916 WideToUTF8(host.c_str(), host.length(), &converted_host); 916 WideToUTF8(host.c_str(), host.length(), &converted_host);
917 return CanonicalizeHost(converted_host, host_info); 917 return CanonicalizeHost(converted_host, host_info);
918 } 918 }
919 919
920 std::string GetDirectoryListingHeader(const string16& title) { 920 std::string GetDirectoryListingHeader(const string16& title) {
921 static const StringPiece header(NetModule::GetResource(IDR_DIR_HEADER_HTML)); 921 static const base::StringPiece header(
922 NetModule::GetResource(IDR_DIR_HEADER_HTML));
922 // This can be null in unit tests. 923 // This can be null in unit tests.
923 DLOG_IF(WARNING, header.empty()) << 924 DLOG_IF(WARNING, header.empty()) <<
924 "Missing resource: directory listing header"; 925 "Missing resource: directory listing header";
925 926
926 std::string result; 927 std::string result;
927 if (!header.empty()) 928 if (!header.empty())
928 result.assign(header.data(), header.size()); 929 result.assign(header.data(), header.size());
929 930
930 result.append("<script>start("); 931 result.append("<script>start(");
931 string_escape::JsonDoubleQuote(title, true, &result); 932 string_escape::JsonDoubleQuote(title, true, &result);
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 if (length > 0) 1354 if (length > 0)
1354 ports.insert(StringToInt(WideToASCII( 1355 ports.insert(StringToInt(WideToASCII(
1355 allowed_ports.substr(last, length)))); 1356 allowed_ports.substr(last, length))));
1356 last = i + 1; 1357 last = i + 1;
1357 } 1358 }
1358 } 1359 }
1359 explicitly_allowed_ports = ports; 1360 explicitly_allowed_ports = ports;
1360 } 1361 }
1361 1362
1362 } // namespace net 1363 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_module.cc ('k') | net/base/registry_controlled_domain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698