summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ftp/ftp_auth_cache_unittest.cc11
-rw-r--r--net/http/http_cache.cc3
-rw-r--r--net/http/http_network_transaction.cc5
-rw-r--r--net/http/partial_data.cc7
-rw-r--r--net/proxy/proxy_config.cc6
-rw-r--r--net/proxy/proxy_config_service_linux.cc3
-rw-r--r--net/spdy/spdy_session.cc3
-rw-r--r--net/test/test_server.cc4
-rw-r--r--net/tools/fetch/http_listen_socket.cc12
-rw-r--r--net/url_request/url_request_unittest.cc8
-rw-r--r--net/websockets/websocket_handshake.cc4
11 files changed, 40 insertions, 26 deletions
diff --git a/net/ftp/ftp_auth_cache_unittest.cc b/net/ftp/ftp_auth_cache_unittest.cc
index 005de89..3971b32 100644
--- a/net/ftp/ftp_auth_cache_unittest.cc
+++ b/net/ftp/ftp_auth_cache_unittest.cc
@@ -4,6 +4,7 @@
#include "net/ftp/ftp_auth_cache.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -132,12 +133,14 @@ TEST(FtpAuthCacheTest, OnlyRemoveMatching) {
TEST(FtpAuthCacheTest, EvictOldEntries) {
FtpAuthCache cache;
- for (size_t i = 0; i < FtpAuthCache::kMaxEntries; i++)
- cache.Add(GURL("ftp://host" + IntToString(i)), kUsername, kPassword);
+ for (size_t i = 0; i < FtpAuthCache::kMaxEntries; i++) {
+ cache.Add(GURL("ftp://host" + base::IntToString(i)),
+ kUsername, kPassword);
+ }
// No entries should be evicted before reaching the limit.
for (size_t i = 0; i < FtpAuthCache::kMaxEntries; i++) {
- EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + IntToString(i))));
+ EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + base::IntToString(i))));
}
// Adding one entry should cause eviction of the first entry.
@@ -146,7 +149,7 @@ TEST(FtpAuthCacheTest, EvictOldEntries) {
// Remaining entries should not get evicted.
for (size_t i = 1; i < FtpAuthCache::kMaxEntries; i++) {
- EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + IntToString(i))));
+ EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + base::IntToString(i))));
}
EXPECT_TRUE(cache.Lookup(GURL("ftp://last_host")));
}
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index dbd6bf1..ad72bea 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -19,6 +19,7 @@
#include "base/ref_counted.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -466,7 +467,7 @@ std::string HttpCache::GenerateCacheKey(const HttpRequestInfo* request) {
(*playback_cache_map_)[url] = generation + 1;
// The key into the cache is GENERATION # + METHOD + URL.
- std::string result = IntToString(generation);
+ std::string result = base::IntToString(generation);
result.append(request->method);
result.append(url);
return result;
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index a9d557f..f54db4f 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -15,6 +15,7 @@
#include "base/stats_counters.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "build/build_config.h"
#include "googleurl/src/gurl.h"
#include "net/base/connection_type_histograms.h"
@@ -650,7 +651,7 @@ int HttpNetworkTransaction::DoResolveProxy() {
if (g_host_mapping_rules && g_host_mapping_rules->RewriteHost(&endpoint_)) {
url_canon::Replacements<char> replacements;
- const std::string port_str = IntToString(endpoint_.port());
+ const std::string port_str = base::IntToString(endpoint_.port());
replacements.SetPort(port_str.c_str(),
url_parse::Component(0, port_str.size()));
replacements.SetHost(endpoint_.host().c_str(),
@@ -677,7 +678,7 @@ int HttpNetworkTransaction::DoResolveProxy() {
url_canon::Replacements<char> replacements;
replacements.SetScheme("https",
url_parse::Component(0, strlen("https")));
- const std::string port_str = IntToString(endpoint_.port());
+ const std::string port_str = base::IntToString(endpoint_.port());
replacements.SetPort(port_str.c_str(),
url_parse::Component(0, port_str.size()));
alternate_endpoint_url =
diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc
index 49d68d2..8964903 100644
--- a/net/http/partial_data.cc
+++ b/net/http/partial_data.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -6,6 +6,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/disk_cache.h"
@@ -25,9 +26,9 @@ void AddRangeHeader(int64 start, int64 end, HttpRequestHeaders* headers) {
DCHECK(start >= 0 || end >= 0);
std::string my_start, my_end;
if (start >= 0)
- my_start = Int64ToString(start);
+ my_start = base::Int64ToString(start);
if (end >= 0)
- my_end = Int64ToString(end);
+ my_end = base::Int64ToString(end);
headers->SetHeader(
HttpRequestHeaders::kRange,
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index 6e73101..f27fbc4 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -1,9 +1,11 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// 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/proxy/proxy_config.h"
+#include "base/logging.h"
+#include "base/string_number_conversions.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "net/proxy/proxy_info.h"
@@ -176,7 +178,7 @@ std::ostream& operator<<(std::ostream& out,
type = "TYPE_SINGLE_PROXY";
break;
default:
- type = IntToString(rules.type);
+ type = base::IntToString(rules.type);
break;
}
return out << " {\n"
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index e33a487..c2f9a94 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -20,6 +20,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/string_number_conversions.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "base/task.h"
@@ -903,7 +904,7 @@ bool ProxyConfigServiceLinux::Delegate::GetProxyFromGConf(
gconf_getter_->GetInt((key + "port").c_str(), &port);
if (port != 0) {
// If a port is set and non-zero:
- host += ":" + IntToString(port);
+ host += ":" + base::IntToString(port);
}
host = FixupProxyHostScheme(
is_socks ? ProxyServer::SCHEME_SOCKS4 : ProxyServer::SCHEME_HTTP,
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 5d6fb02..9f2b82f 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -11,6 +11,7 @@
#include "base/rand_util.h"
#include "base/stats_counters.h"
#include "base/stl_util-inl.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/time.h"
#include "base/values.h"
@@ -613,7 +614,7 @@ void SpdySession::OnWriteComplete(int result) {
LOG(INFO) << "Spdy write complete (result=" << result << ")"
<< (stream ? std::string(" for stream ") +
- IntToString(stream->stream_id()) : "");
+ base::IntToString(stream->stream_id()) : "");
if (result >= 0) {
// It should not be possible to have written more bytes than our
diff --git a/net/test/test_server.cc b/net/test/test_server.cc
index 3432368..683cde2 100644
--- a/net/test/test_server.cc
+++ b/net/test/test_server.cc
@@ -21,7 +21,7 @@
#include "base/leak_annotations.h"
#include "base/logging.h"
#include "base/path_service.h"
-#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "net/base/cert_test_util.h"
#include "net/base/host_resolver.h"
@@ -134,7 +134,7 @@ bool TestServerLauncher::Start(Protocol protocol,
return false;
}
- std::string port_str = IntToString(port);
+ std::string port_str = base::IntToString(port);
// Get path to python server script
FilePath testserver_path;
diff --git a/net/tools/fetch/http_listen_socket.cc b/net/tools/fetch/http_listen_socket.cc
index d0d6b97..fd788c8 100644
--- a/net/tools/fetch/http_listen_socket.cc
+++ b/net/tools/fetch/http_listen_socket.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// 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.
@@ -9,7 +9,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "net/tools/fetch/http_server_request_info.h"
#include "net/tools/fetch/http_server_response_info.h"
@@ -37,8 +37,10 @@ void HttpListenSocket::Accept() {
}
}
-HttpListenSocket* HttpListenSocket::Listen(const std::string& ip, int port,
- HttpListenSocket::Delegate* delegate) {
+HttpListenSocket* HttpListenSocket::Listen(
+ const std::string& ip,
+ int port,
+ HttpListenSocket::Delegate* delegate) {
SOCKET s = ListenSocket::Listen(ip, port);
if (s == ListenSocket::kInvalidSocket) {
// TODO (ibrar): error handling
@@ -227,7 +229,7 @@ void HttpListenSocket::Respond(HttpServerResponseInfo* info,
response += "Content-type: " + info->content_type + "\r\n";
if (info->content_length > 0)
- response += "Content-length: " + IntToString(info->content_length) +
+ response += "Content-length: " + base::IntToString(info->content_length) +
"\r\n";
if (info->connection_close)
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index b232db4..48f5351 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -22,7 +22,7 @@
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/string_piece.h"
-#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "net/base/cookie_monster.h"
#include "net/base/cookie_policy.h"
#include "net/base/load_flags.h"
@@ -172,7 +172,7 @@ TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) {
{
URLRequest r(GURL("https://www.redirect.com/"), &d);
std::string proxy("localhost:");
- proxy.append(IntToString(kHTTPDefaultPort));
+ proxy.append(base::IntToString(kHTTPDefaultPort));
r.set_context(new TestURLRequestContext(proxy));
r.Start();
@@ -197,7 +197,7 @@ TEST_F(URLRequestTestHTTP, UnexpectedServerAuthTest) {
{
URLRequest r(GURL("https://www.server-auth.com/"), &d);
std::string proxy("localhost:");
- proxy.append(IntToString(kHTTPDefaultPort));
+ proxy.append(base::IntToString(kHTTPDefaultPort));
r.set_context(new TestURLRequestContext(proxy));
r.Start();
@@ -1761,7 +1761,7 @@ TEST_F(URLRequestTestHTTP, Post307RedirectPost) {
req.set_upload(CreateSimpleUploadData(kData).get());
net::HttpRequestHeaders headers;
headers.SetHeader(net::HttpRequestHeaders::kContentLength,
- UintToString(arraysize(kData) - 1));
+ base::UintToString(arraysize(kData) - 1));
req.SetExtraRequestHeaders(headers);
req.Start();
MessageLoop::current()->Run();
diff --git a/net/websockets/websocket_handshake.cc b/net/websockets/websocket_handshake.cc
index 5adfa67..e6f0aa8 100644
--- a/net/websockets/websocket_handshake.cc
+++ b/net/websockets/websocket_handshake.cc
@@ -7,9 +7,11 @@
#include <algorithm>
#include <vector>
+#include "base/logging.h"
#include "base/md5.h"
#include "base/rand_util.h"
#include "base/ref_counted.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
@@ -134,7 +136,7 @@ std::string WebSocketHandshake::GetHostFieldValue() const {
(secure &&
port != kSecureWebSocketPort && port != url_parse::PORT_UNSPECIFIED)) {
host += ":";
- host += IntToString(port);
+ host += base::IntToString(port);
}
}
return host;