summaryrefslogtreecommitdiffstats
path: root/net/websockets
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-25 02:25:06 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-25 02:25:06 +0000
commitd8eb842474ce559113a9b0ead0610973985bf693 (patch)
tree817d637b7bfffa8bebe3d1de0af0aea05d72a8a7 /net/websockets
parent928930d76cb018b8a496dbdf7166178ef8fab1bf (diff)
downloadchromium_src-d8eb842474ce559113a9b0ead0610973985bf693.zip
chromium_src-d8eb842474ce559113a9b0ead0610973985bf693.tar.gz
chromium_src-d8eb842474ce559113a9b0ead0610973985bf693.tar.bz2
net: Append base:: in the StringPrintf calls.
(Note: This is a TODO in string_util.h) BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3390026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r--net/websockets/websocket_handshake.cc3
-rw-r--r--net/websockets/websocket_handshake_unittest.cc7
-rw-r--r--net/websockets/websocket_net_log_params.h3
-rw-r--r--net/websockets/websocket_throttle.cc24
4 files changed, 21 insertions, 16 deletions
diff --git a/net/websockets/websocket_handshake.cc b/net/websockets/websocket_handshake.cc
index a9f0c35..480e395 100644
--- a/net/websockets/websocket_handshake.cc
+++ b/net/websockets/websocket_handshake.cc
@@ -13,6 +13,7 @@
#include "base/ref_counted.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
@@ -280,7 +281,7 @@ void WebSocketHandshake::Parameter::GenerateSecWebSocketKey(
*number = rand_(0, max);
uint32 product = *number * space;
- std::string s = StringPrintf("%u", product);
+ std::string s = base::StringPrintf("%u", product);
int n = rand_(1, 12);
for (int i = 0; i < n; i++) {
int pos = rand_(0, s.length());
diff --git a/net/websockets/websocket_handshake_unittest.cc b/net/websockets/websocket_handshake_unittest.cc
index e392cfc..df3914e 100644
--- a/net/websockets/websocket_handshake_unittest.cc
+++ b/net/websockets/websocket_handshake_unittest.cc
@@ -8,9 +8,10 @@
#include "base/scoped_ptr.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "net/websockets/websocket_handshake.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
namespace net {
@@ -86,9 +87,9 @@ class WebSocketHandshakeTest : public testing::Test {
std::string s;
for (int i = 0; i < len; i++) {
if (isprint(buf[i]))
- s += StringPrintf("%c", buf[i]);
+ s += base::StringPrintf("%c", buf[i]);
else
- s += StringPrintf("\\x%02x", buf[i]);
+ s += base::StringPrintf("\\x%02x", buf[i]);
}
return s;
}
diff --git a/net/websockets/websocket_net_log_params.h b/net/websockets/websocket_net_log_params.h
index b11cefd..a504186 100644
--- a/net/websockets/websocket_net_log_params.h
+++ b/net/websockets/websocket_net_log_params.h
@@ -13,6 +13,7 @@
#include "base/ref_counted.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/values.h"
#include "net/base/net_log.h"
@@ -37,7 +38,7 @@ class NetLogWebSocketHandshakeParameter : public NetLog::EventParameters {
i = i + 1;
for (; i < lines.size(); ++i) {
for (size_t j = 0; j < lines[i].length(); ++j) {
- key += StringPrintf("\\x%02x", lines[i][j] & 0xff);
+ key += base::StringPrintf("\\x%02x", lines[i][j] & 0xff);
}
key += "\\x0a";
}
diff --git a/net/websockets/websocket_throttle.cc b/net/websockets/websocket_throttle.cc
index 426fe79..614990e 100644
--- a/net/websockets/websocket_throttle.cc
+++ b/net/websockets/websocket_throttle.cc
@@ -12,6 +12,7 @@
#include "base/singleton.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "net/base/io_buffer.h"
#include "net/base/sys_addrinfo.h"
#include "net/socket_stream/socket_stream.h"
@@ -24,23 +25,24 @@ static std::string AddrinfoToHashkey(const struct addrinfo* addrinfo) {
case AF_INET: {
const struct sockaddr_in* const addr =
reinterpret_cast<const sockaddr_in*>(addrinfo->ai_addr);
- return StringPrintf("%d:%s",
- addrinfo->ai_family,
- base::HexEncode(&addr->sin_addr, 4).c_str());
+ return base::StringPrintf("%d:%s",
+ addrinfo->ai_family,
+ base::HexEncode(&addr->sin_addr, 4).c_str());
}
case AF_INET6: {
const struct sockaddr_in6* const addr6 =
reinterpret_cast<const sockaddr_in6*>(addrinfo->ai_addr);
- return StringPrintf("%d:%s",
- addrinfo->ai_family,
- base::HexEncode(&addr6->sin6_addr,
- sizeof(addr6->sin6_addr)).c_str());
+ return base::StringPrintf(
+ "%d:%s",
+ addrinfo->ai_family,
+ base::HexEncode(&addr6->sin6_addr,
+ sizeof(addr6->sin6_addr)).c_str());
}
default:
- return StringPrintf("%d:%s",
- addrinfo->ai_family,
- base::HexEncode(addrinfo->ai_addr,
- addrinfo->ai_addrlen).c_str());
+ return base::StringPrintf("%d:%s",
+ addrinfo->ai_family,
+ base::HexEncode(addrinfo->ai_addr,
+ addrinfo->ai_addrlen).c_str());
}
}