summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/dump_cache/url_to_filename_encoder_unittest.cc22
-rw-r--r--net/tools/fetch/fetch_server.cc3
-rw-r--r--net/tools/flip_server/acceptor_thread.cc4
-rw-r--r--net/tools/flip_server/flip_in_mem_edsm_server.cc26
-rw-r--r--net/tools/flip_server/spdy_interface.cc11
-rw-r--r--net/tools/flip_server/streamer_interface.cc8
-rw-r--r--net/tools/quic/end_to_end_test.cc4
-rw-r--r--net/tools/quic/quic_client.cc4
-rw-r--r--net/tools/quic/test_tools/quic_test_client.cc2
9 files changed, 30 insertions, 54 deletions
diff --git a/net/tools/dump_cache/url_to_filename_encoder_unittest.cc b/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
index 23bbc6d..2e09e0b 100644
--- a/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
+++ b/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
@@ -57,8 +57,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
void Validate(const string& in_word, const string& gold_word) {
string escaped_word, url;
- UrlToFilenameEncoder::EncodeSegment(
- std::string(), in_word, '/', &escaped_word);
+ UrlToFilenameEncoder::EncodeSegment("", in_word, '/', &escaped_word);
EXPECT_EQ(gold_word, escaped_word);
CheckSegmentLength(escaped_word);
CheckValidChars(escaped_word, '\\');
@@ -68,8 +67,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
void ValidateAllSegmentsSmall(const string& in_word) {
string escaped_word, url;
- UrlToFilenameEncoder::EncodeSegment(
- std::string(), in_word, '/', &escaped_word);
+ UrlToFilenameEncoder::EncodeSegment("", in_word, '/', &escaped_word);
CheckSegmentLength(escaped_word);
CheckValidChars(escaped_word, '\\');
UrlToFilenameEncoder::Decode(escaped_word, '/', &url);
@@ -108,13 +106,13 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
void ValidateUrlOldNew(const string& url, const string& gold_old_filename,
const string& gold_new_filename) {
- ValidateUrl(url, std::string(), true, gold_old_filename);
- ValidateUrl(url, std::string(), false, gold_new_filename);
+ ValidateUrl(url, "", true, gold_old_filename);
+ ValidateUrl(url, "", false, gold_new_filename);
}
void ValidateEncodeSame(const string& url1, const string& url2) {
- string filename1 = UrlToFilenameEncoder::Encode(url1, std::string(), false);
- string filename2 = UrlToFilenameEncoder::Encode(url2, std::string(), false);
+ string filename1 = UrlToFilenameEncoder::Encode(url1, "", false);
+ string filename2 = UrlToFilenameEncoder::Encode(url2, "", false);
EXPECT_EQ(filename1, filename2);
}
@@ -123,7 +121,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
};
TEST_F(UrlToFilenameEncoderTest, DoesNotEscape) {
- ValidateNoChange(std::string());
+ ValidateNoChange("");
ValidateNoChange("abcdefg");
ValidateNoChange("abcdefghijklmnopqrstuvwxyz");
ValidateNoChange("ZYXWVUT");
@@ -195,8 +193,7 @@ TEST_F(UrlToFilenameEncoderTest, EncodeUrlCorrectly) {
// From bug: Double slash preserved.
ValidateUrl("http://www.foo.com/u?site=http://www.google.com/index.html",
- std::string(),
- false,
+ "", false,
"www.foo.com" + dir_sep_ + "u" + escape_ + "3Fsite=http" +
escape_ + "3A" + dir_sep_ + escape_ + "2Fwww.google.com" +
dir_sep_ + "index.html" + escape_);
@@ -329,8 +326,7 @@ TEST_F(UrlToFilenameEncoderTest, BackslashSeparator) {
string long_word;
string escaped_word;
long_word.append(UrlToFilenameEncoder::kMaximumSubdirectoryLength + 1, 'x');
- UrlToFilenameEncoder::EncodeSegment(
- std::string(), long_word, '\\', &escaped_word);
+ UrlToFilenameEncoder::EncodeSegment("", long_word, '\\', &escaped_word);
// check that one backslash, plus the escape ",-", and the ending , got added.
EXPECT_EQ(long_word.size() + 4, escaped_word.size());
diff --git a/net/tools/fetch/fetch_server.cc b/net/tools/fetch/fetch_server.cc
index 34c7c83..830cd18 100644
--- a/net/tools/fetch/fetch_server.cc
+++ b/net/tools/fetch/fetch_server.cc
@@ -36,8 +36,7 @@ int main(int argc, char**argv) {
// Do work here.
MessageLoop loop;
- HttpServer server(std::string(),
- 80); // TODO(mbelshe): make port configurable
+ HttpServer server("", 80); // TODO(mbelshe): make port configurable
MessageLoop::current()->Run();
if (parsed_command_line.HasSwitch("stats")) {
diff --git a/net/tools/flip_server/acceptor_thread.cc b/net/tools/flip_server/acceptor_thread.cc
index ed8a3ec..b16d181 100644
--- a/net/tools/flip_server/acceptor_thread.cc
+++ b/net/tools/flip_server/acceptor_thread.cc
@@ -105,9 +105,7 @@ void SMAcceptorThread::HandleConnection(int server_fd,
NULL,
&epoll_server_,
server_fd,
- std::string(),
- std::string(),
- remote_ip,
+ "", "", remote_ip,
use_ssl_);
if (server_connection->initialized())
active_server_connections_.push_back(server_connection);
diff --git a/net/tools/flip_server/flip_in_mem_edsm_server.cc b/net/tools/flip_server/flip_in_mem_edsm_server.cc
index 15fb9644..8ba1505 100644
--- a/net/tools/flip_server/flip_in_mem_edsm_server.cc
+++ b/net/tools/flip_server/flip_in_mem_edsm_server.cc
@@ -335,16 +335,11 @@ int main (int argc, char**argv)
std::string value = cl.GetSwitchValueASCII("spdy-server");
std::vector<std::string> valueArgs = split(value, ',');
while (valueArgs.size() < 4)
- valueArgs.push_back(std::string());
+ valueArgs.push_back("");
g_proxy_config.AddAcceptor(net::FLIP_HANDLER_SPDY_SERVER,
- valueArgs[0],
- valueArgs[1],
- valueArgs[2],
- valueArgs[3],
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ valueArgs[0], valueArgs[1],
+ valueArgs[2], valueArgs[3],
+ "", "", "", "",
0,
FLAGS_accept_backlog_size,
FLAGS_disable_nagle,
@@ -361,16 +356,11 @@ int main (int argc, char**argv)
std::string value = cl.GetSwitchValueASCII("http-server");
std::vector<std::string> valueArgs = split(value, ',');
while (valueArgs.size() < 4)
- valueArgs.push_back(std::string());
+ valueArgs.push_back("");
g_proxy_config.AddAcceptor(net::FLIP_HANDLER_HTTP_SERVER,
- valueArgs[0],
- valueArgs[1],
- valueArgs[2],
- valueArgs[3],
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ valueArgs[0], valueArgs[1],
+ valueArgs[2], valueArgs[3],
+ "", "", "", "",
0,
FLAGS_accept_backlog_size,
FLAGS_disable_nagle,
diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc
index 649e99e..1c34e79 100644
--- a/net/tools/flip_server/spdy_interface.cc
+++ b/net/tools/flip_server/spdy_interface.cc
@@ -112,14 +112,9 @@ SMInterface* SpdySM::FindOrMakeNewSMConnectionInterface(
}
sm_http_interface->InitSMInterface(this, server_idx);
- sm_http_interface->InitSMConnection(NULL,
- sm_http_interface,
- epoll_server_,
- -1,
- server_ip,
- server_port,
- std::string(),
- false);
+ sm_http_interface->InitSMConnection(NULL, sm_http_interface,
+ epoll_server_, -1,
+ server_ip, server_port, "", false);
return sm_http_interface;
}
diff --git a/net/tools/flip_server/streamer_interface.cc b/net/tools/flip_server/streamer_interface.cc
index b1612e7..9e6e6c8 100644
--- a/net/tools/flip_server/streamer_interface.cc
+++ b/net/tools/flip_server/streamer_interface.cc
@@ -131,13 +131,11 @@ int StreamerSM::PostAcceptHook() {
}
// The Streamer interface is used to stream HTTPS connections, so we
// will always use the https_server_ip/port here.
- sm_other_interface_->InitSMConnection(NULL,
- sm_other_interface_,
- epoll_server_,
- -1,
+ sm_other_interface_->InitSMConnection(NULL, sm_other_interface_,
+ epoll_server_, -1,
acceptor_->https_server_ip_,
acceptor_->https_server_port_,
- std::string(),
+ "",
false);
return 1;
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index cb14db8..e98c4ea 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -234,7 +234,7 @@ TEST_F(EndToEndTest, SeparateFinPacket) {
client_->SendMessage(request);
- client_->SendData(std::string(), true);
+ client_->SendData("", true);
client_->WaitForResponse();
EXPECT_EQ(kFooResponseBody, client_->response_body());
@@ -243,7 +243,7 @@ TEST_F(EndToEndTest, SeparateFinPacket) {
request.AddBody("foo", true);
client_->SendMessage(request);
- client_->SendData(std::string(), true);
+ client_->SendData("", true);
client_->WaitForResponse();
EXPECT_EQ(kFooResponseBody, client_->response_body());
EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code());
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc
index 8acb85a..4a61ab4 100644
--- a/net/tools/quic/quic_client.cc
+++ b/net/tools/quic/quic_client.cc
@@ -43,8 +43,8 @@ QuicClient::QuicClient(IPEndPoint server_address,
QuicClient::~QuicClient() {
if (connected()) {
- session()->connection()
- ->SendConnectionClosePacket(QUIC_PEER_GOING_AWAY, std::string());
+ session()->connection()->SendConnectionClosePacket(
+ QUIC_PEER_GOING_AWAY, "");
}
}
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index 843af2f..53bc057 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -85,7 +85,7 @@ string QuicTestClient::SendCustomSynchronousRequest(
string QuicTestClient::SendSynchronousRequest(const string& uri) {
if (SendRequest(uri) == 0) {
DLOG(ERROR) << "Failed to the request for uri:" << uri;
- return std::string();
+ return "";
}
WaitForResponse();
return response_;