summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 00:35:36 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 00:35:36 +0000
commit76eb0247d08fa6c503517ec1a0cb8e6566cd39c7 (patch)
treee14c2632fab2f76df22827fe0c7908fd54240699 /net
parent7f8aff5b10859950cf9a6996a5d3d288ea3c75f4 (diff)
downloadchromium_src-76eb0247d08fa6c503517ec1a0cb8e6566cd39c7.zip
chromium_src-76eb0247d08fa6c503517ec1a0cb8e6566cd39c7.tar.gz
chromium_src-76eb0247d08fa6c503517ec1a0cb8e6566cd39c7.tar.bz2
base: Move SplitString functions into the base namespace and update the callers.
BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3750001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/host_mapping_rules.cc2
-rw-r--r--net/base/mime_util.cc2
-rw-r--r--net/base/net_util.cc2
-rw-r--r--net/ftp/ftp_directory_listing_parser_ls.cc2
-rw-r--r--net/ftp/ftp_directory_listing_parser_mlsd.cc8
-rw-r--r--net/ftp/ftp_directory_listing_parser_netware.cc2
-rw-r--r--net/ftp/ftp_directory_listing_parser_vms.cc14
-rw-r--r--net/ftp/ftp_directory_listing_parser_vms_unittest.cc2
-rw-r--r--net/ftp/ftp_directory_listing_parser_windows.cc6
-rw-r--r--net/http/http_network_layer.cc2
-rw-r--r--net/http/http_stream_factory.cc2
-rw-r--r--net/tools/hresolv/hresolv.cc2
-rw-r--r--net/websockets/websocket_job_unittest.cc2
13 files changed, 24 insertions, 24 deletions
diff --git a/net/base/host_mapping_rules.cc b/net/base/host_mapping_rules.cc
index a1ec12d0..effea59 100644
--- a/net/base/host_mapping_rules.cc
+++ b/net/base/host_mapping_rules.cc
@@ -69,7 +69,7 @@ bool HostMappingRules::AddRuleFromString(const std::string& rule_string) {
std::string trimmed;
TrimWhitespaceASCII(rule_string, TRIM_ALL, &trimmed);
std::vector<std::string> parts;
- SplitString(trimmed, ' ', &parts);
+ base::SplitString(trimmed, ' ', &parts);
// Test for EXCLUSION rule.
if (parts.size() == 2 && LowerCaseEqualsASCII(parts[0], "exclude")) {
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 62f164b..a580997 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -430,7 +430,7 @@ void MimeUtil::ParseCodecString(const std::string& codecs,
bool strip) {
std::string no_quote_codecs;
TrimString(codecs, "\"", &no_quote_codecs);
- SplitString(no_quote_codecs, ',', codecs_out);
+ base::SplitString(no_quote_codecs, ',', codecs_out);
if (!strip)
return;
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index ddc1da7..9afae4c 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1904,7 +1904,7 @@ bool ParseCIDRBlock(const std::string& cidr_literal,
// <IPv6-literal> "/" <number of bits>
std::vector<std::string> parts;
- SplitString(cidr_literal, '/', &parts);
+ base::SplitString(cidr_literal, '/', &parts);
if (parts.size() != 2)
return false;
diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc
index 038af11..b8061a3 100644
--- a/net/ftp/ftp_directory_listing_parser_ls.cc
+++ b/net/ftp/ftp_directory_listing_parser_ls.cc
@@ -99,7 +99,7 @@ bool FtpDirectoryListingParserLs::ConsumeLine(const string16& line) {
received_nonempty_line_ = true;
std::vector<string16> columns;
- SplitString(CollapseWhitespace(line, false), ' ', &columns);
+ base::SplitString(CollapseWhitespace(line, false), ' ', &columns);
// Some FTP servers put a "total n" line at the beginning of the listing
// (n is an integer). Allow such a line, but only once, and only if it's
diff --git a/net/ftp/ftp_directory_listing_parser_mlsd.cc b/net/ftp/ftp_directory_listing_parser_mlsd.cc
index 6d49634..dc6dace 100644
--- a/net/ftp/ftp_directory_listing_parser_mlsd.cc
+++ b/net/ftp/ftp_directory_listing_parser_mlsd.cc
@@ -1,6 +1,6 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#include "net/ftp/ftp_directory_listing_parser_mlsd.h"
@@ -60,7 +60,7 @@ bool FtpDirectoryListingParserMlsd::ConsumeLine(const string16& line) {
string16 facts_string = line.substr(0, first_space_pos - 1);
string16 filename = line.substr(first_space_pos + 1);
std::vector<string16> facts_split;
- SplitString(facts_string, ';', &facts_split);
+ base::SplitString(facts_string, ';', &facts_split);
const char* keys[] = {
"modify",
diff --git a/net/ftp/ftp_directory_listing_parser_netware.cc b/net/ftp/ftp_directory_listing_parser_netware.cc
index 40f6505..3cd0c8f 100644
--- a/net/ftp/ftp_directory_listing_parser_netware.cc
+++ b/net/ftp/ftp_directory_listing_parser_netware.cc
@@ -48,7 +48,7 @@ bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) {
}
std::vector<string16> columns;
- SplitString(CollapseWhitespace(line, false), ' ', &columns);
+ base::SplitString(CollapseWhitespace(line, false), ' ', &columns);
if (columns.size() != 8)
return false;
diff --git a/net/ftp/ftp_directory_listing_parser_vms.cc b/net/ftp/ftp_directory_listing_parser_vms.cc
index 7148aee..3702a14 100644
--- a/net/ftp/ftp_directory_listing_parser_vms.cc
+++ b/net/ftp/ftp_directory_listing_parser_vms.cc
@@ -21,7 +21,7 @@ bool ParseVmsFilename(const string16& raw_filename, string16* parsed_filename,
// On VMS, the files and directories are versioned. The version number is
// separated from the file name by a semicolon. Example: ANNOUNCE.TXT;2.
std::vector<string16> listing_parts;
- SplitString(raw_filename, ';', &listing_parts);
+ base::SplitString(raw_filename, ';', &listing_parts);
if (listing_parts.size() != 2)
return false;
int version_number;
@@ -35,7 +35,7 @@ bool ParseVmsFilename(const string16& raw_filename, string16* parsed_filename,
// case-insensitive, but generally uses uppercase characters. This may look
// awkward, so we convert them to lower case.
std::vector<string16> filename_parts;
- SplitString(listing_parts[0], '.', &filename_parts);
+ base::SplitString(listing_parts[0], '.', &filename_parts);
if (filename_parts.size() != 2)
return false;
if (EqualsASCII(filename_parts[1], "DIR")) {
@@ -60,7 +60,7 @@ bool ParseVmsFilesize(const string16& input, int64* size) {
}
std::vector<string16> parts;
- SplitString(input, '/', &parts);
+ base::SplitString(input, '/', &parts);
if (parts.size() != 2)
return false;
@@ -101,7 +101,7 @@ bool LooksLikeVmsFileProtectionListing(const string16& input) {
// We expect four parts of the file protection listing: for System, Owner,
// Group, and World.
std::vector<string16> parts;
- SplitString(input.substr(1, input.length() - 2), ',', &parts);
+ base::SplitString(input.substr(1, input.length() - 2), ',', &parts);
if (parts.size() != 4)
return false;
@@ -125,7 +125,7 @@ bool VmsDateListingToTime(const std::vector<string16>& columns,
// Date should be in format DD-MMM-YYYY.
std::vector<string16> date_parts;
- SplitString(columns[1], '-', &date_parts);
+ base::SplitString(columns[1], '-', &date_parts);
if (date_parts.size() != 3)
return false;
if (!base::StringToInt(date_parts[0], &time_exploded.day_of_month))
@@ -146,7 +146,7 @@ bool VmsDateListingToTime(const std::vector<string16>& columns,
if (time_column.length() != 5)
return false;
std::vector<string16> time_parts;
- SplitString(time_column, ':', &time_parts);
+ base::SplitString(time_column, ':', &time_parts);
if (time_parts.size() != 2)
return false;
if (!base::StringToInt(time_parts[0], &time_exploded.hour))
@@ -229,7 +229,7 @@ FtpDirectoryListingEntry FtpDirectoryListingParserVms::PopEntry() {
bool FtpDirectoryListingParserVms::ConsumeEntryLine(const string16& line) {
std::vector<string16> columns;
- SplitString(CollapseWhitespace(line, false), ' ', &columns);
+ base::SplitString(CollapseWhitespace(line, false), ' ', &columns);
if (columns.size() == 1) {
if (!last_filename_.empty())
diff --git a/net/ftp/ftp_directory_listing_parser_vms_unittest.cc b/net/ftp/ftp_directory_listing_parser_vms_unittest.cc
index ab5366f..eb1554d 100644
--- a/net/ftp/ftp_directory_listing_parser_vms_unittest.cc
+++ b/net/ftp/ftp_directory_listing_parser_vms_unittest.cc
@@ -106,7 +106,7 @@ TEST_F(FtpDirectoryListingParserVmsTest, Bad) {
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, bad_cases[i]));
std::vector<std::string> lines;
- SplitString(bad_cases[i], '|', &lines);
+ base::SplitString(bad_cases[i], '|', &lines);
net::FtpDirectoryListingParserVms parser;
bool failed = false;
for (std::vector<std::string>::const_iterator i = lines.begin();
diff --git a/net/ftp/ftp_directory_listing_parser_windows.cc b/net/ftp/ftp_directory_listing_parser_windows.cc
index 2ff3cd2..d2bbdaa 100644
--- a/net/ftp/ftp_directory_listing_parser_windows.cc
+++ b/net/ftp/ftp_directory_listing_parser_windows.cc
@@ -21,7 +21,7 @@ bool WindowsDateListingToTime(const std::vector<string16>& columns,
// Date should be in format MM-DD-YY[YY].
std::vector<string16> date_parts;
- SplitString(columns[0], '-', &date_parts);
+ base::SplitString(columns[0], '-', &date_parts);
if (date_parts.size() != 3)
return false;
if (!base::StringToInt(date_parts[0], &time_exploded.month))
@@ -43,7 +43,7 @@ bool WindowsDateListingToTime(const std::vector<string16>& columns,
if (columns[1].length() != 7)
return false;
std::vector<string16> time_parts;
- SplitString(columns[1].substr(0, 5), ':', &time_parts);
+ base::SplitString(columns[1].substr(0, 5), ':', &time_parts);
if (time_parts.size() != 2)
return false;
if (!base::StringToInt(time_parts[0], &time_exploded.hour))
@@ -77,7 +77,7 @@ FtpDirectoryListingParserWindows::FtpDirectoryListingParserWindows() {
bool FtpDirectoryListingParserWindows::ConsumeLine(const string16& line) {
std::vector<string16> columns;
- SplitString(CollapseWhitespace(line, false), ' ', &columns);
+ base::SplitString(CollapseWhitespace(line, false), ' ', &columns);
// We may receive file names containing spaces, which can make the number of
// columns arbitrarily large. We will handle that later. For now just make
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc
index a773ac46..cf93500 100644
--- a/net/http/http_network_layer.cc
+++ b/net/http/http_network_layer.cc
@@ -195,7 +195,7 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) {
static const char kNpnProtosHttpOnly[] = "\x08http/1.1\x07http1.1";
std::vector<std::string> spdy_options;
- SplitString(mode, ',', &spdy_options);
+ base::SplitString(mode, ',', &spdy_options);
bool use_alt_protocols = true;
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index f471a4f..9378357 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -77,7 +77,7 @@ void HttpStreamFactory::ProcessAlternateProtocol(
const std::string& alternate_protocol_str,
const HostPortPair& http_host_port_pair) {
std::vector<std::string> port_protocol_vector;
- SplitString(alternate_protocol_str, ':', &port_protocol_vector);
+ base::SplitString(alternate_protocol_str, ':', &port_protocol_vector);
if (port_protocol_vector.size() != 2) {
DLOG(WARNING) << HttpAlternateProtocols::kHeader
<< " header has too many tokens: "
diff --git a/net/tools/hresolv/hresolv.cc b/net/tools/hresolv/hresolv.cc
index c5c1976..b5af4ae 100644
--- a/net/tools/hresolv/hresolv.cc
+++ b/net/tools/hresolv/hresolv.cc
@@ -382,7 +382,7 @@ bool ReadHostsAndTimesFromFile(const FilePath& path,
std::vector<std::string> lines;
// TODO(cbentzel): This should probably handle CRLF-style separators as well.
// Maybe it's worth adding functionality like this to base tools.
- SplitString(file_contents, '\n', &lines);
+ base::SplitString(file_contents, '\n', &lines);
std::vector<std::string>::const_iterator line_end = lines.end();
int previous_timestamp = 0;
for (std::vector<std::string>::const_iterator it = lines.begin();
diff --git a/net/websockets/websocket_job_unittest.cc b/net/websockets/websocket_job_unittest.cc
index 9fde6c9..53d4a625 100644
--- a/net/websockets/websocket_job_unittest.cc
+++ b/net/websockets/websocket_job_unittest.cc
@@ -328,7 +328,7 @@ TEST_F(WebSocketJobTest, SlowHandshake) {
"8jKS'y:G*Co,Wxa-";
std::vector<std::string> lines;
- SplitString(kHandshakeResponseMessage, '\n', &lines);
+ base::SplitString(kHandshakeResponseMessage, '\n', &lines);
for (size_t i = 0; i < lines.size() - 2; i++) {
std::string line = lines[i] + "\r\n";
SCOPED_TRACE("Line: " + line);