summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/base/dns_util.cc6
-rw-r--r--net/base/host_mapping_rules_unittest.cc2
-rw-r--r--net/base/mime_sniffer_unittest.cc33
-rw-r--r--net/base/mime_util.cc2
-rw-r--r--net/base/mime_util_unittest.cc10
-rw-r--r--net/base/net_util.cc4
-rw-r--r--net/base/net_util_unittest.cc84
-rw-r--r--net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc8
-rw-r--r--net/base/sdch_filter_unittest.cc2
-rw-r--r--net/cookies/canonical_cookie_unittest.cc14
-rw-r--r--net/cookies/cookie_monster_unittest.cc87
-rw-r--r--net/cookies/cookie_store_test_helpers.cc2
-rw-r--r--net/cookies/cookie_store_unittest.h96
-rw-r--r--net/cookies/parsed_cookie.cc2
-rw-r--r--net/cookies/parsed_cookie_unittest.cc18
-rw-r--r--net/dns/host_resolver_impl_unittest.cc22
-rw-r--r--net/dns/mapped_host_resolver_unittest.cc4
-rw-r--r--net/dns/mock_host_resolver.cc36
-rw-r--r--net/dns/single_request_host_resolver_unittest.cc2
-rw-r--r--net/ftp/ftp_util.cc2
-rw-r--r--net/http/http_auth.cc6
-rw-r--r--net/http/http_auth_cache_unittest.cc21
-rw-r--r--net/http/http_auth_filter_unittest.cc25
-rw-r--r--net/http/http_auth_gssapi_posix_unittest.cc2
-rw-r--r--net/http/http_auth_handler_digest.cc8
-rw-r--r--net/http/http_auth_unittest.cc2
-rw-r--r--net/http/http_cache.cc6
-rw-r--r--net/http/http_network_transaction.cc2
-rw-r--r--net/http/http_network_transaction_spdy2_unittest.cc23
-rw-r--r--net/http/http_network_transaction_spdy3_unittest.cc23
-rw-r--r--net/http/http_proxy_client_socket_pool_spdy2_unittest.cc58
-rw-r--r--net/http/http_proxy_client_socket_pool_spdy3_unittest.cc58
-rw-r--r--net/http/http_security_headers_unittest.cc6
-rw-r--r--net/http/http_server_properties_impl_unittest.cc8
-rw-r--r--net/http/http_stream_factory_impl_unittest.cc21
-rw-r--r--net/http/http_util_unittest.cc24
-rw-r--r--net/http/http_vary_data.cc2
-rw-r--r--net/http/http_vary_data_unittest.cc2
-rw-r--r--net/proxy/dhcp_proxy_script_fetcher.cc2
-rw-r--r--net/proxy/proxy_resolver_v8_tracing_unittest.cc6
-rw-r--r--net/proxy/proxy_service_unittest.cc12
-rw-r--r--net/quic/quic_http_stream_test.cc6
-rw-r--r--net/quic/quic_packet_creator_test.cc2
-rw-r--r--net/quic/quic_packet_generator_test.cc2
-rw-r--r--net/server/http_server.cc2
-rw-r--r--net/server/http_server_request_info.cc2
-rw-r--r--net/socket/client_socket_pool_base_unittest.cc6
-rw-r--r--net/socket/deterministic_socket_data_unittest.cc5
-rw-r--r--net/socket/ssl_client_socket_pool_unittest.cc90
-rw-r--r--net/socket/transport_client_socket_pool_unittest.cc15
-rw-r--r--net/spdy/spdy_framer_test.cc6
-rw-r--r--net/spdy/spdy_http_utils.cc5
-rw-r--r--net/spdy/spdy_session_spdy2_unittest.cc6
-rw-r--r--net/spdy/spdy_session_spdy3_unittest.cc6
-rw-r--r--net/spdy/spdy_stream.cc2
-rw-r--r--net/spdy/spdy_stream_test_util.cc2
-rw-r--r--net/spdy/spdy_write_queue_unittest.cc3
-rw-r--r--net/ssl/server_bound_cert_service.cc13
-rw-r--r--net/test/base_test_server.cc4
-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
-rw-r--r--net/udp/udp_socket_unittest.cc4
-rw-r--r--net/url_request/url_fetcher_impl_unittest.cc61
-rw-r--r--net/url_request/url_request_throttler_simulation_unittest.cc10
-rw-r--r--net/url_request/url_request_throttler_test_support.cc2
-rw-r--r--net/url_request/url_request_throttler_unittest.cc29
-rw-r--r--net/url_request/url_request_unittest.cc60
-rw-r--r--net/websockets/websocket_net_log_params_unittest.cc2
75 files changed, 463 insertions, 719 deletions
diff --git a/net/base/dns_util.cc b/net/base/dns_util.cc
index b94eff8..816095b 100644
--- a/net/base/dns_util.cc
+++ b/net/base/dns_util.cc
@@ -62,16 +62,16 @@ std::string DNSDomainToString(const base::StringPiece& domain) {
for (unsigned i = 0; i < domain.size() && domain[i]; i += domain[i] + 1) {
#if CHAR_MIN < 0
if (domain[i] < 0)
- return std::string();
+ return "";
#endif
if (domain[i] > 63)
- return std::string();
+ return "";
if (i)
ret += ".";
if (static_cast<unsigned>(domain[i]) + i + 1 > domain.size())
- return std::string();
+ return "";
domain.substr(i + 1, domain[i]).AppendToString(&ret);
}
diff --git a/net/base/host_mapping_rules_unittest.cc b/net/base/host_mapping_rules_unittest.cc
index 8d8f7b1..9ecd4b7 100644
--- a/net/base/host_mapping_rules_unittest.cc
+++ b/net/base/host_mapping_rules_unittest.cc
@@ -72,7 +72,7 @@ TEST(HostMappingRulesTest, ParseInvalidRules) {
HostMappingRules rules;
EXPECT_FALSE(rules.AddRuleFromString("xyz"));
- EXPECT_FALSE(rules.AddRuleFromString(std::string()));
+ EXPECT_FALSE(rules.AddRuleFromString(""));
EXPECT_FALSE(rules.AddRuleFromString(" "));
EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE"));
EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE foo bar"));
diff --git a/net/base/mime_sniffer_unittest.cc b/net/base/mime_sniffer_unittest.cc
index 7865350..a4bde0f 100644
--- a/net/base/mime_sniffer_unittest.cc
+++ b/net/base/mime_sniffer_unittest.cc
@@ -304,14 +304,13 @@ TEST(MimeSnifferTest, FlashTest) {
TEST(MimeSnifferTest, XMLTest) {
// An easy feed to identify.
EXPECT_EQ("application/atom+xml",
- SniffMimeType("<?xml?><feed", std::string(), "text/xml"));
+ SniffMimeType("<?xml?><feed", "", "text/xml"));
// Don't sniff out of plain text.
EXPECT_EQ("text/plain",
- SniffMimeType("<?xml?><feed", std::string(), "text/plain"));
+ SniffMimeType("<?xml?><feed", "", "text/plain"));
// Simple RSS.
EXPECT_EQ("application/rss+xml",
- SniffMimeType(
- "<?xml version='1.0'?>\r\n<rss", std::string(), "text/xml"));
+ SniffMimeType("<?xml version='1.0'?>\r\n<rss", "", "text/xml"));
// The top of CNN's RSS feed, which we'd like to recognize as RSS.
static const char kCNNRSS[] =
@@ -324,43 +323,39 @@ TEST(MimeSnifferTest, XMLTest) {
"version=\"2.0\">";
// CNN's RSS
EXPECT_EQ("application/rss+xml",
- SniffMimeType(kCNNRSS, std::string(), "text/xml"));
- EXPECT_EQ("text/plain", SniffMimeType(kCNNRSS, std::string(), "text/plain"));
+ SniffMimeType(kCNNRSS, "", "text/xml"));
+ EXPECT_EQ("text/plain",
+ SniffMimeType(kCNNRSS, "", "text/plain"));
// Don't sniff random XML as something different.
EXPECT_EQ("text/xml",
- SniffMimeType("<?xml?><notafeed", std::string(), "text/xml"));
+ SniffMimeType("<?xml?><notafeed", "", "text/xml"));
// Don't sniff random plain-text as something different.
EXPECT_EQ("text/plain",
- SniffMimeType("<?xml?><notafeed", std::string(), "text/plain"));
+ SniffMimeType("<?xml?><notafeed", "", "text/plain"));
// Positive test for the two instances we upgrade to XHTML.
EXPECT_EQ("application/xhtml+xml",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "text/xml"));
+ "", "text/xml"));
EXPECT_EQ("application/xhtml+xml",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "application/xml"));
+ "", "application/xml"));
// Following our behavior with HTML, don't call other mime types XHTML.
EXPECT_EQ("text/plain",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "text/plain"));
+ "", "text/plain"));
EXPECT_EQ("application/rss+xml",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "application/rss+xml"));
+ "", "application/rss+xml"));
// Don't sniff other HTML-looking bits as HTML.
EXPECT_EQ("text/xml",
- SniffMimeType("<html><head>", std::string(), "text/xml"));
+ SniffMimeType("<html><head>", "", "text/xml"));
EXPECT_EQ("text/xml",
SniffMimeType("<foo><html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "text/xml"));
+ "", "text/xml"));
}
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index b3053a6..21a05bf 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -967,7 +967,7 @@ const std::string GetIANAMediaType(const std::string& mime_type) {
return kIanaMediaTypes[i].name;
}
}
- return std::string();
+ return "";
}
CertificateMimeType GetCertificateMimeTypeForMimeType(
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc
index 565f9de..ee6663b 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -93,11 +93,11 @@ TEST(MimeUtilTest, MatchesMimeType) {
"application/html+xml"));
EXPECT_TRUE(MatchesMimeType("application/*+xml", "application/+xml"));
EXPECT_TRUE(MatchesMimeType("aaa*aaa", "aaaaaa"));
- EXPECT_TRUE(MatchesMimeType("*", std::string()));
+ EXPECT_TRUE(MatchesMimeType("*", ""));
EXPECT_FALSE(MatchesMimeType("video/", "video/x-mpeg"));
- EXPECT_FALSE(MatchesMimeType(std::string(), "video/x-mpeg"));
- EXPECT_FALSE(MatchesMimeType(std::string(), std::string()));
- EXPECT_FALSE(MatchesMimeType("video/x-mpeg", std::string()));
+ EXPECT_FALSE(MatchesMimeType("", "video/x-mpeg"));
+ EXPECT_FALSE(MatchesMimeType("", ""));
+ EXPECT_FALSE(MatchesMimeType("video/x-mpeg", ""));
EXPECT_FALSE(MatchesMimeType("application/*+xml", "application/xml"));
EXPECT_FALSE(MatchesMimeType("application/*+xml",
"application/html+xmlz"));
@@ -219,7 +219,7 @@ TEST(MimeUtilTest, TestIsMimeType) {
TEST(MimeUtilTest, TestToIANAMediaType) {
EXPECT_EQ("", GetIANAMediaType("texting/driving"));
EXPECT_EQ("", GetIANAMediaType("ham/sandwich"));
- EXPECT_EQ("", GetIANAMediaType(std::string()));
+ EXPECT_EQ("", GetIANAMediaType(""));
EXPECT_EQ("", GetIANAMediaType("/application/hamsandwich"));
EXPECT_EQ("application", GetIANAMediaType("application/poodle-wrestler"));
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 18d00fe..066812c 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1433,7 +1433,7 @@ std::string NetAddressToString(const struct sockaddr* sa,
if (!GetIPAddressFromSockAddr(sa, sock_addr_len, &address,
&address_len, NULL)) {
NOTREACHED();
- return std::string();
+ return "";
}
return IPAddressToString(address, address_len);
}
@@ -1446,7 +1446,7 @@ std::string NetAddressToStringWithPort(const struct sockaddr* sa,
if (!GetIPAddressFromSockAddr(sa, sock_addr_len, &address,
&address_len, &port)) {
NOTREACHED();
- return std::string();
+ return "";
}
return IPAddressToStringWithPort(address, address_len, port);
}
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
index ab8a236..8512d09 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -2596,14 +2596,10 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// View-source case.
- formatted =
- FormatUrl(GURL("view-source:http://user:passwd@host:81/path?query#ref"),
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("view-source:http://user:passwd@host:81/path?query#ref"),
+ "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, &parsed,
+ NULL, NULL);
EXPECT_EQ(WideToUTF16(L"view-source:http://host:81/path?query#ref"),
formatted);
EXPECT_EQ(WideToUTF16(L"view-source:http"),
@@ -2622,13 +2618,9 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// omit http case.
- formatted = FormatUrl(GURL("http://host:8000/a?b=c#d"),
- std::string(),
- kFormatUrlOmitHTTP,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("http://host:8000/a?b=c#d"),
+ "", kFormatUrlOmitHTTP, UnescapeRule::NORMAL, &parsed, NULL, NULL);
EXPECT_EQ(WideToUTF16(L"host:8000/a?b=c#d"), formatted);
EXPECT_FALSE(parsed.scheme.is_valid());
EXPECT_FALSE(parsed.username.is_valid());
@@ -2645,13 +2637,9 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// omit http starts with ftp case.
- formatted = FormatUrl(GURL("http://ftp.host:8000/a?b=c#d"),
- std::string(),
- kFormatUrlOmitHTTP,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("http://ftp.host:8000/a?b=c#d"),
+ "", kFormatUrlOmitHTTP, UnescapeRule::NORMAL, &parsed, NULL, NULL);
EXPECT_EQ(WideToUTF16(L"http://ftp.host:8000/a?b=c#d"), formatted);
EXPECT_TRUE(parsed.scheme.is_valid());
EXPECT_FALSE(parsed.username.is_valid());
@@ -2670,13 +2658,9 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// omit http starts with 'f' case.
- formatted = FormatUrl(GURL("http://f/"),
- std::string(),
- kFormatUrlOmitHTTP,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("http://f/"),
+ "", kFormatUrlOmitHTTP, UnescapeRule::NORMAL, &parsed, NULL, NULL);
EXPECT_EQ(WideToUTF16(L"f/"), formatted);
EXPECT_FALSE(parsed.scheme.is_valid());
EXPECT_FALSE(parsed.username.is_valid());
@@ -2698,13 +2682,9 @@ TEST(NetUtilTest, FormatUrlRoundTripPathASCII) {
GURL url(std::string("http://www.google.com/") +
static_cast<char>(test_char));
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
EXPECT_EQ(url.spec(), GURL(formatted).spec());
}
}
@@ -2719,13 +2699,9 @@ TEST(NetUtilTest, FormatUrlRoundTripPathEscaped) {
GURL url(original_url);
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
EXPECT_EQ(url.spec(), GURL(formatted).spec());
}
}
@@ -2737,13 +2713,9 @@ TEST(NetUtilTest, FormatUrlRoundTripQueryASCII) {
GURL url(std::string("http://www.google.com/?") +
static_cast<char>(test_char));
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
EXPECT_EQ(url.spec(), GURL(formatted).spec());
}
}
@@ -2762,13 +2734,9 @@ TEST(NetUtilTest, FormatUrlRoundTripQueryEscaped) {
GURL url(original_url);
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
if (test_char &&
strchr(kUnescapedCharacters, static_cast<char>(test_char))) {
@@ -3068,7 +3036,7 @@ TEST(NetUtilTest, ParseIPLiteralToNumber_FailParse) {
EXPECT_FALSE(ParseIPLiteralToNumber("bad value", &number));
EXPECT_FALSE(ParseIPLiteralToNumber("bad:value", &number));
- EXPECT_FALSE(ParseIPLiteralToNumber(std::string(), &number));
+ EXPECT_FALSE(ParseIPLiteralToNumber("", &number));
EXPECT_FALSE(ParseIPLiteralToNumber("192.168.0.1:30", &number));
EXPECT_FALSE(ParseIPLiteralToNumber(" 192.168.0.1 ", &number));
EXPECT_FALSE(ParseIPLiteralToNumber("[::1]", &number));
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc b/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
index 8ad8a55..7ae5da4 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
+++ b/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
@@ -79,7 +79,7 @@ TEST_F(RegistryControlledDomainTest, TestGetDomainAndRegistry) {
EXPECT_EQ("baz.com", GetDomainFromURL("http://baz.com")); // none
EXPECT_EQ("baz.com.", GetDomainFromURL("http://baz.com.")); // none
- EXPECT_EQ("", GetDomainFromURL(std::string()));
+ EXPECT_EQ("", GetDomainFromURL(""));
EXPECT_EQ("", GetDomainFromURL("http://"));
EXPECT_EQ("", GetDomainFromURL("file:///C:/file.html"));
EXPECT_EQ("", GetDomainFromURL("http://foo.com.."));
@@ -108,7 +108,7 @@ TEST_F(RegistryControlledDomainTest, TestGetDomainAndRegistry) {
EXPECT_EQ("baz.com", GetDomainFromHost("baz.com")); // none
EXPECT_EQ("baz.com.", GetDomainFromHost("baz.com.")); // none
- EXPECT_EQ("", GetDomainFromHost(std::string()));
+ EXPECT_EQ("", GetDomainFromHost(""));
EXPECT_EQ("", GetDomainFromHost("foo.com.."));
EXPECT_EQ("", GetDomainFromHost("..."));
EXPECT_EQ("", GetDomainFromHost("192.168.0.1"));
@@ -143,7 +143,7 @@ TEST_F(RegistryControlledDomainTest, TestGetRegistryLength) {
EXPECT_EQ(3U, GetRegistryLengthFromURL("http://baz.com", true)); // none
EXPECT_EQ(4U, GetRegistryLengthFromURL("http://baz.com.", true)); // none
- EXPECT_EQ(std::string::npos, GetRegistryLengthFromURL(std::string(), false));
+ EXPECT_EQ(std::string::npos, GetRegistryLengthFromURL("", false));
EXPECT_EQ(std::string::npos, GetRegistryLengthFromURL("http://", false));
EXPECT_EQ(std::string::npos,
GetRegistryLengthFromURL("file:///C:/file.html", false));
@@ -177,7 +177,7 @@ TEST_F(RegistryControlledDomainTest, TestGetRegistryLength) {
EXPECT_EQ(3U, GetRegistryLengthFromHost("baz.com", true)); // none
EXPECT_EQ(4U, GetRegistryLengthFromHost("baz.com.", true)); // none
- EXPECT_EQ(std::string::npos, GetRegistryLengthFromHost(std::string(), false));
+ EXPECT_EQ(std::string::npos, GetRegistryLengthFromHost("", false));
EXPECT_EQ(0U, GetRegistryLengthFromHost("foo.com..", false));
EXPECT_EQ(0U, GetRegistryLengthFromHost("..", false));
EXPECT_EQ(0U, GetRegistryLengthFromHost("192.168.0.1", false));
diff --git a/net/base/sdch_filter_unittest.cc b/net/base/sdch_filter_unittest.cc
index 1cc70cb..2e0f5ec 100644
--- a/net/base/sdch_filter_unittest.cc
+++ b/net/base/sdch_filter_unittest.cc
@@ -1346,7 +1346,7 @@ TEST_F(SdchFilterTest, PathMatch) {
// Make sure less that sufficient prefix match is false.
EXPECT_FALSE(PathMatch("/sear", "/search"));
EXPECT_FALSE(PathMatch("/", "/search"));
- EXPECT_FALSE(PathMatch(std::string(), "/search"));
+ EXPECT_FALSE(PathMatch("", "/search"));
// Add examples with several levels of direcories in the restriction.
EXPECT_FALSE(PathMatch("/search/something", "search/s"));
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 161b27f..d7c25d188 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -55,16 +55,8 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_EQ("/test", cookie.Path());
EXPECT_FALSE(cookie.IsSecure());
- CanonicalCookie cookie2(url,
- "A",
- "2",
- std::string(),
- std::string(),
- current_time,
- base::Time(),
- current_time,
- false,
- false);
+ CanonicalCookie cookie2(url, "A", "2", "", "", current_time, base::Time(),
+ current_time, false, false);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
EXPECT_EQ("A", cookie2.Name());
EXPECT_EQ("2", cookie2.Value());
@@ -295,7 +287,7 @@ TEST(CanonicalCookieTest, IsOnPath) {
EXPECT_TRUE(cookie->IsOnPath("/test/bar.html"));
// Test the empty string edge case.
- EXPECT_FALSE(cookie->IsOnPath(std::string()));
+ EXPECT_FALSE(cookie->IsOnPath(""));
cookie.reset(
CanonicalCookie::Create(GURL("http://www.example.com/test/foo.html"),
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index b3688c3..116d486 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -233,44 +233,20 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
base::Time(), false, false));
// Host cookies
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_1,
- "host_1",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_2",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_3,
- "host_3",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_1,
+ "host_1", "X", "", "/",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_2", "X", "", "/",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_3,
+ "host_3", "X", "", "/",
+ base::Time(), false, false));
// Http_only cookie
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "httpo_check",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- true));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "httpo_check", "X", "", "/",
+ base::Time(), false, true));
// Secure cookies
EXPECT_TRUE(this->SetCookieWithDetails(cm,
@@ -278,14 +254,9 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
"sec_dom", "X", ".math.harvard.edu",
"/", base::Time(), true, false));
EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2_secure,
- "sec_host",
- "X",
- std::string(),
- "/",
- base::Time(),
- true,
- false));
+ url_top_level_domain_plus_2_secure,
+ "sec_host", "X", "", "/",
+ base::Time(), true, false));
// Domain path cookies
EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
@@ -298,24 +269,14 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
base::Time(), false, false));
// Host path cookies
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_path_1",
- "X",
- std::string(),
- "/dir1",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_path_2",
- "X",
- std::string(),
- "/dir1/dir2",
- base::Time(),
- false,
- false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_path_1", "X",
+ "", "/dir1",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_path_2", "X",
+ "", "/dir1/dir2",
+ base::Time(), false, false));
EXPECT_EQ(13U, this->GetAllCookies(cm).size());
}
@@ -2244,7 +2205,7 @@ TEST_F(CookieMonsterTest, PersisentCookieStorageTest) {
EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[0].type);
// Remove it.
EXPECT_TRUE(SetCookie(cm, url_google_,"A=B; max-age=0"));
- this->MatchCookieLines(std::string(), GetCookies(cm, url_google_));
+ this->MatchCookieLines("", GetCookies(cm, url_google_));
ASSERT_EQ(2u, store->commands().size());
EXPECT_EQ(CookieStoreCommand::REMOVE, store->commands()[1].type);
diff --git a/net/cookies/cookie_store_test_helpers.cc b/net/cookies/cookie_store_test_helpers.cc
index 6ae4357d..e499538 100644
--- a/net/cookies/cookie_store_test_helpers.cc
+++ b/net/cookies/cookie_store_test_helpers.cc
@@ -90,7 +90,7 @@ std::string DelayedCookieMonster::GetCookiesWithOptions(
const GURL& url,
const CookieOptions& options) {
ADD_FAILURE();
- return std::string();
+ return "";
}
void DelayedCookieMonster::DeleteCookie(const GURL& url,
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index 0d2d7ed..134a193 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -275,10 +275,9 @@ TYPED_TEST_P(CookieStoreTest, DomainTest) {
// Test domain enforcement, should fail on a sub-domain or something too deep.
EXPECT_FALSE(this->SetCookie(cs, this->url_google_, "I=J; domain=.izzle"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://a.izzle")));
- EXPECT_FALSE(this->SetCookie(
- cs, this->url_google_, "K=L; domain=.bla.www.google.izzle"));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://a.izzle")));
+ EXPECT_FALSE(this->SetCookie(cs, this->url_google_,
+ "K=L; domain=.bla.www.google.izzle"));
this->MatchCookieLines("C=D; E=F; G=H",
this->GetCookies(cs, GURL("http://bla.www.google.izzle")));
this->MatchCookieLines("A=B; C=D; E=F; G=H",
@@ -293,8 +292,7 @@ TYPED_TEST_P(CookieStoreTest, DomainWithTrailingDotTest) {
"a=1; domain=.www.google.com."));
EXPECT_FALSE(this->SetCookie(cs, this->url_google_,
"b=2; domain=.www.google.com.."));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
// Test that cookies can bet set on higher level domains.
@@ -368,7 +366,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidDomainTest) {
EXPECT_FALSE(this->SetCookie(cs, url_foobar,
"o=15; domain=.foo.bar.com#sup"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_foobar));
+ this->MatchCookieLines("", this->GetCookies(cs, url_foobar));
}
{
@@ -379,7 +377,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidDomainTest) {
GURL url_foocom("http://foo.com.com");
EXPECT_FALSE(this->SetCookie(cs, url_foocom,
"a=1; domain=.foo.com.com.com"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_foocom));
+ this->MatchCookieLines("", this->GetCookies(cs, url_foocom));
}
}
@@ -404,8 +402,8 @@ TYPED_TEST_P(CookieStoreTest, DomainWithoutLeadingDotTest) {
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
this->MatchCookieLines("a=1",
this->GetCookies(cs, GURL("http://sub.www.google.com")));
- this->MatchCookieLines(
- std::string(), this->GetCookies(cs, GURL("http://something-else.com")));
+ this->MatchCookieLines("",
+ this->GetCookies(cs, GURL("http://something-else.com")));
}
}
@@ -431,11 +429,11 @@ TYPED_TEST_P(CookieStoreTest, TestIpAddress) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
EXPECT_FALSE(this->SetCookie(cs, url_ip, "b=2; domain=.1.2.3.4"));
EXPECT_FALSE(this->SetCookie(cs, url_ip, "c=3; domain=.3.4"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_ip));
+ this->MatchCookieLines("", this->GetCookies(cs, url_ip));
// It should be allowed to set a cookie if domain= matches the IP address
// exactly. This matches IE/Firefox, even though it seems a bit wrong.
EXPECT_FALSE(this->SetCookie(cs, url_ip, "b=2; domain=1.2.3.3"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_ip));
+ this->MatchCookieLines("", this->GetCookies(cs, url_ip));
EXPECT_TRUE(this->SetCookie(cs, url_ip, "b=2; domain=1.2.3.4"));
this->MatchCookieLines("b=2", this->GetCookies(cs, url_ip));
}
@@ -453,12 +451,10 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
// Make sure it doesn't show up for a normal .com, it should be a host
// not a domain cookie.
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com/")));
if (TypeParam::supports_non_dotted_domains) {
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://.com/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://.com/")));
}
}
@@ -469,8 +465,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
if (TypeParam::supports_trailing_dots) {
EXPECT_TRUE(this->SetCookie(cs, url, "a=1"));
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com./")));
} else {
EXPECT_FALSE(this->SetCookie(cs, url, "a=1"));
@@ -482,7 +477,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://a.b");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.b"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=b"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
+ this->MatchCookieLines("", this->GetCookies(cs, url));
}
{ // Same test as above, but explicitly on a known TLD (com).
@@ -490,7 +485,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://google.com");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.com"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=com"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
+ this->MatchCookieLines("", this->GetCookies(cs, url));
}
{ // Make sure can't set cookie on TLD which is dotted.
@@ -498,12 +493,11 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://google.co.uk");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.co.uk"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=.uk"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("", this->GetCookies(cs, url));
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://something-else.co.uk")));
- this->MatchCookieLines(
- std::string(), this->GetCookies(cs, GURL("http://something-else.uk")));
+ this->MatchCookieLines("",
+ this->GetCookies(cs, GURL("http://something-else.uk")));
}
{ // Intranet URLs should only be able to set host cookies.
@@ -539,11 +533,9 @@ TYPED_TEST_P(CookieStoreTest, TestHostEndsWithDot) {
}
// Make sure there weren't any side effects.
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com/")));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://.com/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://.com/")));
}
TYPED_TEST_P(CookieStoreTest, InvalidScheme) {
@@ -560,7 +552,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidScheme_Read) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
EXPECT_TRUE(this->SetCookie(cs, GURL(kUrlGoogle), kValidDomainCookieLine));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, GURL(kUrlFtp)));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(kUrlFtp)));
}
TYPED_TEST_P(CookieStoreTest, PathTest) {
@@ -573,9 +565,8 @@ TYPED_TEST_P(CookieStoreTest, PathTest) {
this->MatchCookieLines("A=B",
this->GetCookies(cs, GURL(url + "/wee/war/more/more")));
if (!TypeParam::has_path_prefix_bug)
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL(url + "/weehee")));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, GURL(url + "/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(url + "/weehee")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(url + "/")));
// If we add a 0 length path, it should default to /
EXPECT_TRUE(this->SetCookie(cs, GURL(url), "A=C; path="));
@@ -621,17 +612,15 @@ TYPED_TEST_P(CookieStoreTest, HttpOnlyTest) {
options));
// Check httponly read protection.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
- this->MatchCookieLines(
- "A=B", this->GetCookiesWithOptions(cs, this->url_google_, options));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("A=B",
+ this->GetCookiesWithOptions(cs, this->url_google_, options));
// Check httponly overwrite protection.
EXPECT_FALSE(this->SetCookie(cs, this->url_google_, "A=C"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
- this->MatchCookieLines(
- "A=B", this->GetCookiesWithOptions(cs, this->url_google_, options));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("A=B",
+ this->GetCookiesWithOptions(cs, this->url_google_, options));
EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_, "A=C",
options));
this->MatchCookieLines("A=C", this->GetCookies(cs, this->url_google_));
@@ -656,7 +645,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
// Delete it via Max-Age.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) + "; max-age=0"));
- this->MatchCookieLineWithTimeout(cs, this->url_google_, std::string());
+ this->MatchCookieLineWithTimeout(cs, this->url_google_, "");
// Create a session cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_, kValidCookieLine));
@@ -665,8 +654,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Mon, 18-Apr-1977 22:50:13 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -677,7 +665,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
// Delete it via Max-Age.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) + "; max-age=0"));
- this->MatchCookieLineWithTimeout(cs, this->url_google_, std::string());
+ this->MatchCookieLineWithTimeout(cs, this->url_google_, "");
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -688,8 +676,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Mon, 18-Apr-1977 22:50:13 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -716,8 +703,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Thu, 1-Jan-1970 00:00:00 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
@@ -745,8 +731,7 @@ TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
// Remove the cookie with an interval defined by two dates.
EXPECT_EQ(1, this->DeleteCreatedBetween(cs, last_minute, next_minute));
// Check that the cookie disappeared.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Add another cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_, "C=D"));
@@ -756,8 +741,7 @@ TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
// Remove the cookie with a null ending time.
EXPECT_EQ(1, this->DeleteCreatedBetween(cs, last_minute, base::Time()));
// Check that the cookie disappeared.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
TYPED_TEST_P(CookieStoreTest, TestSecure) {
@@ -769,13 +753,11 @@ TYPED_TEST_P(CookieStoreTest, TestSecure) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_secure_, "A=B; secure"));
// The secure should overwrite the non-secure.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
this->MatchCookieLines("A=B", this->GetCookies(cs, this->url_google_secure_));
EXPECT_TRUE(this->SetCookie(cs, this->url_google_secure_, "D=E; secure"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
this->MatchCookieLines("A=B; D=E",
this->GetCookies(cs, this->url_google_secure_));
diff --git a/net/cookies/parsed_cookie.cc b/net/cookies/parsed_cookie.cc
index ecb8712..5cd542d 100644
--- a/net/cookies/parsed_cookie.cc
+++ b/net/cookies/parsed_cookie.cc
@@ -424,7 +424,7 @@ bool ParsedCookie::SetBool(size_t* index,
ClearAttributePair(*index);
return true;
} else {
- return SetAttributePair(index, key, std::string());
+ return SetAttributePair(index, key, "");
}
}
diff --git a/net/cookies/parsed_cookie_unittest.cc b/net/cookies/parsed_cookie_unittest.cc
index 57de115..3729650 100644
--- a/net/cookies/parsed_cookie_unittest.cc
+++ b/net/cookies/parsed_cookie_unittest.cc
@@ -208,7 +208,7 @@ TEST(ParsedCookieTest, InvalidTooLong) {
}
TEST(ParsedCookieTest, InvalidEmpty) {
- ParsedCookie pc((std::string()));
+ ParsedCookie pc("");
EXPECT_FALSE(pc.IsValid());
}
@@ -259,7 +259,7 @@ TEST(ParsedCookieTest, SerializeCookieLine) {
TEST(ParsedCookieTest, SetNameAndValue) {
- ParsedCookie empty((std::string()));
+ ParsedCookie empty("");
EXPECT_FALSE(empty.IsValid());
EXPECT_FALSE(empty.SetDomain("foobar.com"));
EXPECT_TRUE(empty.SetName("name"));
@@ -282,7 +282,7 @@ TEST(ParsedCookieTest, SetNameAndValue) {
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
- EXPECT_FALSE(pc.SetName(std::string()));
+ EXPECT_FALSE(pc.SetName(""));
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
@@ -303,7 +303,7 @@ TEST(ParsedCookieTest, SetNameAndValue) {
EXPECT_EQ("test=\"foobar\"", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
- EXPECT_TRUE(pc.SetValue(std::string()));
+ EXPECT_TRUE(pc.SetValue(""));
EXPECT_EQ("test=", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
}
@@ -313,7 +313,7 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_TRUE(pc.IsValid());
// Clear an unset attribute.
- EXPECT_TRUE(pc.SetDomain(std::string()));
+ EXPECT_TRUE(pc.SetDomain(""));
EXPECT_FALSE(pc.HasDomain());
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
@@ -355,10 +355,10 @@ TEST(ParsedCookieTest, SetAttributes) {
pc.ToCookieLine());
// Clear the rest and change the name and value.
- EXPECT_TRUE(pc.SetDomain(std::string()));
- EXPECT_TRUE(pc.SetPath(std::string()));
- EXPECT_TRUE(pc.SetExpires(std::string()));
- EXPECT_TRUE(pc.SetMaxAge(std::string()));
+ EXPECT_TRUE(pc.SetDomain(""));
+ EXPECT_TRUE(pc.SetPath(""));
+ EXPECT_TRUE(pc.SetExpires(""));
+ EXPECT_TRUE(pc.SetMaxAge(""));
EXPECT_TRUE(pc.SetIsSecure(false));
EXPECT_TRUE(pc.SetIsHttpOnly(false));
EXPECT_TRUE(pc.SetName("name2"));
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index 26bebeb..c9ebec0 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -107,7 +107,7 @@ class MockHostResolverProc : public HostResolverProc {
void AddRule(const std::string& hostname, AddressFamily family,
const std::string& ip_list) {
AddressList result;
- int rv = ParseAddressList(ip_list, std::string(), &result);
+ int rv = ParseAddressList(ip_list, "", &result);
DCHECK_EQ(OK, rv);
AddRule(hostname, family, result);
}
@@ -115,7 +115,7 @@ class MockHostResolverProc : public HostResolverProc {
void AddRuleForAllFamilies(const std::string& hostname,
const std::string& ip_list) {
AddressList result;
- int rv = ParseAddressList(ip_list, std::string(), &result);
+ int rv = ParseAddressList(ip_list, "", &result);
DCHECK_EQ(OK, rv);
AddRule(hostname, ADDRESS_FAMILY_UNSPECIFIED, result);
AddRule(hostname, ADDRESS_FAMILY_IPV4, result);
@@ -137,7 +137,7 @@ class MockHostResolverProc : public HostResolverProc {
--num_slots_available_;
--num_requests_waiting_;
if (rules_.empty()) {
- int rv = ParseAddressList("127.0.0.1", std::string(), addrlist);
+ int rv = ParseAddressList("127.0.0.1", "", addrlist);
DCHECK_EQ(OK, rv);
return OK;
}
@@ -527,8 +527,7 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) {
}
TEST_F(HostResolverImplTest, FailedAsynchronousLookup) {
- proc_->AddRuleForAllFamilies(std::string(),
- "0.0.0.0"); // Default to failures.
+ proc_->AddRuleForAllFamilies("", "0.0.0.0"); // Default to failures.
proc_->SignalMultiple(1u);
Request* req = CreateRequest("just.testing", 80);
@@ -583,7 +582,7 @@ TEST_F(HostResolverImplTest, NumericIPv6Address) {
}
TEST_F(HostResolverImplTest, EmptyHost) {
- Request* req = CreateRequest(std::string(), 5555);
+ Request* req = CreateRequest("", 5555);
EXPECT_EQ(ERR_NAME_NOT_RESOLVED, req->Resolve());
}
@@ -1345,8 +1344,7 @@ TEST_F(HostResolverImplDnsTest, ServeFromHosts) {
DnsConfig config = CreateValidDnsConfig();
ChangeDnsConfig(config);
- proc_->AddRuleForAllFamilies(std::string(),
- std::string()); // Default to failures.
+ proc_->AddRuleForAllFamilies("", ""); // Default to failures.
proc_->SignalMultiple(1u); // For the first request which misses.
Request* req0 = CreateRequest("er_ipv4", 80);
@@ -1398,8 +1396,7 @@ TEST_F(HostResolverImplDnsTest, ServeFromHosts) {
TEST_F(HostResolverImplDnsTest, BypassDnsTask) {
ChangeDnsConfig(CreateValidDnsConfig());
- proc_->AddRuleForAllFamilies(std::string(),
- std::string()); // Default to failures.
+ proc_->AddRuleForAllFamilies("", ""); // Default to failures.
EXPECT_EQ(ERR_IO_PENDING, CreateRequest("ok.local", 80)->Resolve());
EXPECT_EQ(ERR_IO_PENDING, CreateRequest("ok.local.", 80)->Resolve());
@@ -1419,8 +1416,7 @@ TEST_F(HostResolverImplDnsTest, BypassDnsTask) {
TEST_F(HostResolverImplDnsTest, DisableDnsClientOnPersistentFailure) {
ChangeDnsConfig(CreateValidDnsConfig());
- proc_->AddRuleForAllFamilies(std::string(),
- std::string()); // Default to failures.
+ proc_->AddRuleForAllFamilies("", ""); // Default to failures.
// Check that DnsTask works.
Request* req = CreateRequest("ok_1", 80);
@@ -1474,7 +1470,7 @@ TEST_F(HostResolverImplDnsTest, DontDisableDnsClientOnSporadicFailure) {
EXPECT_EQ(OK, requests_[i]->WaitForResult()) << i;
// Make |proc_| default to failures.
- proc_->AddRuleForAllFamilies(std::string(), std::string());
+ proc_->AddRuleForAllFamilies("", "");
// DnsTask should still be enabled.
Request* req = CreateRequest("ok_last", 80);
diff --git a/net/dns/mapped_host_resolver_unittest.cc b/net/dns/mapped_host_resolver_unittest.cc
index d859466..8da95e1 100644
--- a/net/dns/mapped_host_resolver_unittest.cc
+++ b/net/dns/mapped_host_resolver_unittest.cc
@@ -18,7 +18,7 @@ namespace {
std::string FirstAddress(const AddressList& address_list) {
if (address_list.empty())
- return std::string();
+ return "";
return address_list.front().ToString();
}
@@ -171,7 +171,7 @@ TEST(MappedHostResolverTest, ParseInvalidRules) {
new MappedHostResolver(scoped_ptr<HostResolver>()));
EXPECT_FALSE(resolver->AddRuleFromString("xyz"));
- EXPECT_FALSE(resolver->AddRuleFromString(std::string()));
+ EXPECT_FALSE(resolver->AddRuleFromString(""));
EXPECT_FALSE(resolver->AddRuleFromString(" "));
EXPECT_FALSE(resolver->AddRuleFromString("EXCLUDE"));
EXPECT_FALSE(resolver->AddRuleFromString("EXCLUDE foo bar"));
diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc
index e6ecf59..fb03836 100644
--- a/net/dns/mock_host_resolver.cc
+++ b/net/dns/mock_host_resolver.cc
@@ -256,13 +256,8 @@ void RuleBasedHostResolverProc::AddRuleForAddressFamily(
DCHECK(!replacement.empty());
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeSystem,
- host_pattern,
- address_family,
- flags,
- replacement,
- std::string(),
- 0);
+ Rule rule(Rule::kResolverTypeSystem, host_pattern, address_family, flags,
+ replacement, "", 0);
rules_.push_back(rule);
}
@@ -291,13 +286,8 @@ void RuleBasedHostResolverProc::AddRuleWithLatency(
DCHECK(!replacement.empty());
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeSystem,
- host_pattern,
- ADDRESS_FAMILY_UNSPECIFIED,
- flags,
- replacement,
- std::string(),
- latency_ms);
+ Rule rule(Rule::kResolverTypeSystem, host_pattern, ADDRESS_FAMILY_UNSPECIFIED,
+ flags, replacement, "", latency_ms);
rules_.push_back(rule);
}
@@ -305,13 +295,8 @@ void RuleBasedHostResolverProc::AllowDirectLookup(
const std::string& host_pattern) {
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeSystem,
- host_pattern,
- ADDRESS_FAMILY_UNSPECIFIED,
- flags,
- std::string(),
- std::string(),
- 0);
+ Rule rule(Rule::kResolverTypeSystem, host_pattern, ADDRESS_FAMILY_UNSPECIFIED,
+ flags, "", "", 0);
rules_.push_back(rule);
}
@@ -319,13 +304,8 @@ void RuleBasedHostResolverProc::AddSimulatedFailure(
const std::string& host_pattern) {
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeFail,
- host_pattern,
- ADDRESS_FAMILY_UNSPECIFIED,
- flags,
- std::string(),
- std::string(),
- 0);
+ Rule rule(Rule::kResolverTypeFail, host_pattern, ADDRESS_FAMILY_UNSPECIFIED,
+ flags, "", "", 0);
rules_.push_back(rule);
}
diff --git a/net/dns/single_request_host_resolver_unittest.cc b/net/dns/single_request_host_resolver_unittest.cc
index 1b0198f..3e2ea1e 100644
--- a/net/dns/single_request_host_resolver_unittest.cc
+++ b/net/dns/single_request_host_resolver_unittest.cc
@@ -68,7 +68,7 @@ TEST(SingleRequestHostResolverTest, NormalResolve) {
// Create a host resolver dependency that returns address "199.188.1.166"
// for resolutions of "watsup".
MockHostResolver resolver;
- resolver.rules()->AddIPLiteralRule("watsup", "199.188.1.166", std::string());
+ resolver.rules()->AddIPLiteralRule("watsup", "199.188.1.166", "");
SingleRequestHostResolver single_request_resolver(&resolver);
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
index 68307a2..0eab465 100644
--- a/net/ftp/ftp_util.cc
+++ b/net/ftp/ftp_util.cc
@@ -107,7 +107,7 @@ std::string FtpUtil::VMSPathToUnix(const std::string& vms_path) {
std::string result(vms_path);
if (vms_path[0] == '[') {
// It's a relative path.
- ReplaceFirstSubstringAfterOffset(&result, 0, "[.", std::string());
+ ReplaceFirstSubstringAfterOffset(&result, 0, "[.", "");
} else {
// It's an absolute path.
result.insert(0, "/");
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc
index 9e9410b..fb7fc5d 100644
--- a/net/http/http_auth.cc
+++ b/net/http/http_auth.cc
@@ -146,7 +146,7 @@ std::string HttpAuth::GetChallengeHeaderName(Target target) {
return "WWW-Authenticate";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -159,7 +159,7 @@ std::string HttpAuth::GetAuthorizationHeaderName(Target target) {
return HttpRequestHeaders::kAuthorization;
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -172,7 +172,7 @@ std::string HttpAuth::GetAuthTargetString(Target target) {
return "server";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
diff --git a/net/http/http_auth_cache_unittest.cc b/net/http/http_auth_cache_unittest.cc
index 0bdb280..af3b25c 100644
--- a/net/http/http_auth_cache_unittest.cc
+++ b/net/http/http_auth_cache_unittest.cc
@@ -106,13 +106,11 @@ TEST(HttpAuthCacheTest, Basic) {
new MockAuthHandler(HttpAuth::AUTH_SCHEME_BASIC,
kRealm3,
HttpAuth::AUTH_PROXY));
- cache.Add(
- origin,
- realm3_basic_handler->realm(),
- realm3_basic_handler->auth_scheme(),
- "Basic realm=Realm3",
- CreateASCIICredentials("realm3-basic-user", "realm3-basic-password"),
- std::string());
+ cache.Add(origin, realm3_basic_handler->realm(),
+ realm3_basic_handler->auth_scheme(), "Basic realm=Realm3",
+ CreateASCIICredentials("realm3-basic-user",
+ "realm3-basic-password"),
+ "");
scoped_ptr<HttpAuthHandler> realm3_digest_handler(
new MockAuthHandler(HttpAuth::AUTH_SCHEME_DIGEST,
@@ -207,7 +205,7 @@ TEST(HttpAuthCacheTest, Basic) {
// Negative tests:
entry = cache.LookupByPath(origin, "/foo3/index.html");
EXPECT_FALSE(realm2_entry == entry);
- entry = cache.LookupByPath(origin, std::string());
+ entry = cache.LookupByPath(origin, "");
EXPECT_FALSE(realm2_entry == entry);
// Confirm we find the same realm, different auth scheme by path lookup
@@ -233,7 +231,7 @@ TEST(HttpAuthCacheTest, Basic) {
EXPECT_FALSE(realm3DigestEntry == entry);
// Lookup using empty path (may be used for proxy).
- entry = cache.LookupByPath(origin, std::string());
+ entry = cache.LookupByPath(origin, "");
EXPECT_FALSE(NULL == entry);
EXPECT_EQ(HttpAuth::AUTH_SCHEME_BASIC, entry->scheme());
EXPECT_EQ(kRealm3, entry->realm());
@@ -542,10 +540,7 @@ class HttpAuthCacheEvictionTest : public testing::Test {
}
void AddPathToRealm(int realm_i, int path_i) {
- cache_.Add(origin_,
- GenerateRealm(realm_i),
- HttpAuth::AUTH_SCHEME_BASIC,
- std::string(),
+ cache_.Add(origin_, GenerateRealm(realm_i), HttpAuth::AUTH_SCHEME_BASIC, "",
AuthCredentials(kUsername, kPassword),
GeneratePath(realm_i, path_i));
}
diff --git a/net/http/http_auth_filter_unittest.cc b/net/http/http_auth_filter_unittest.cc
index e6891dd..0aab9d4 100644
--- a/net/http/http_auth_filter_unittest.cc
+++ b/net/http/http_auth_filter_unittest.cc
@@ -35,17 +35,22 @@ struct UrlData {
};
static const UrlData urls[] = {
- { GURL(std::string()), HttpAuth::AUTH_NONE, false, 0 },
- { GURL("http://foo.cn"), HttpAuth::AUTH_PROXY, true, ALL_SERVERS_MATCH },
- { GURL("http://foo.cn"), HttpAuth::AUTH_SERVER, false, 0 },
- { GURL("http://slashdot.org"), HttpAuth::AUTH_NONE, false, 0 },
- { GURL("http://www.google.com"), HttpAuth::AUTH_SERVER, true, 1 << 0 },
- { GURL("http://www.google.com"), HttpAuth::AUTH_PROXY, true,
- ALL_SERVERS_MATCH },
+ { GURL(""),
+ HttpAuth::AUTH_NONE, false, 0 },
+ { GURL("http://foo.cn"),
+ HttpAuth::AUTH_PROXY, true, ALL_SERVERS_MATCH },
+ { GURL("http://foo.cn"),
+ HttpAuth::AUTH_SERVER, false, 0 },
+ { GURL("http://slashdot.org"),
+ HttpAuth::AUTH_NONE, false, 0 },
+ { GURL("http://www.google.com"),
+ HttpAuth::AUTH_SERVER, true, 1 << 0 },
+ { GURL("http://www.google.com"),
+ HttpAuth::AUTH_PROXY, true, ALL_SERVERS_MATCH },
{ GURL("https://login.facebook.com/login.php?login_attempt=1"),
HttpAuth::AUTH_NONE, false, 0 },
- { GURL("http://codereview.chromium.org/634002/show"), HttpAuth::AUTH_SERVER,
- true, 1 << 3 },
+ { GURL("http://codereview.chromium.org/634002/show"),
+ HttpAuth::AUTH_SERVER, true, 1 << 3 },
{ GURL("http://code.google.com/p/chromium/issues/detail?id=34505"),
HttpAuth::AUTH_SERVER, true, 1 << 0 },
{ GURL("http://code.google.com/p/chromium/issues/list?can=2&q=label:"
@@ -72,7 +77,7 @@ static const UrlData urls[] = {
TEST(HttpAuthFilterTest, EmptyFilter) {
// Create an empty filter
- HttpAuthFilterWhitelist filter((std::string()));
+ HttpAuthFilterWhitelist filter("");
for (size_t i = 0; i < arraysize(urls); i++) {
EXPECT_EQ(urls[i].target == HttpAuth::AUTH_PROXY,
filter.IsValid(urls[i].url, urls[i].target))
diff --git a/net/http/http_auth_gssapi_posix_unittest.cc b/net/http/http_auth_gssapi_posix_unittest.cc
index 1c3d12b..cbf4d3d 100644
--- a/net/http/http_auth_gssapi_posix_unittest.cc
+++ b/net/http/http_auth_gssapi_posix_unittest.cc
@@ -76,7 +76,7 @@ TEST(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup) {
// TODO(ahendrickson): Manipulate the libraries and paths to test each of the
// libraries we expect, and also whether or not they have the interface
// functions we want.
- scoped_ptr<GSSAPILibrary> gssapi(new GSSAPISharedLibrary(std::string()));
+ scoped_ptr<GSSAPILibrary> gssapi(new GSSAPISharedLibrary(""));
DCHECK(gssapi.get());
EXPECT_TRUE(gssapi.get()->Init());
}
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc
index cc90b52..bfc8312 100644
--- a/net/http/http_auth_handler_digest.cc
+++ b/net/http/http_auth_handler_digest.cc
@@ -270,12 +270,12 @@ bool HttpAuthHandlerDigest::ParseChallengeProperty(const std::string& name,
std::string HttpAuthHandlerDigest::QopToString(QualityOfProtection qop) {
switch (qop) {
case QOP_UNSPECIFIED:
- return std::string();
+ return "";
case QOP_AUTH:
return "auth";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -284,14 +284,14 @@ std::string HttpAuthHandlerDigest::AlgorithmToString(
DigestAlgorithm algorithm) {
switch (algorithm) {
case ALGORITHM_UNSPECIFIED:
- return std::string();
+ return "";
case ALGORITHM_MD5:
return "MD5";
case ALGORITHM_MD5_SESS:
return "MD5-sess";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
diff --git a/net/http/http_auth_unittest.cc b/net/http/http_auth_unittest.cc
index ff63c9b..88c7f95 100644
--- a/net/http/http_auth_unittest.cc
+++ b/net/http/http_auth_unittest.cc
@@ -304,7 +304,7 @@ TEST(HttpAuthTest, ChallengeTokenizerMismatchedQuotesNoValue) {
EXPECT_TRUE(parameters.GetNext());
EXPECT_TRUE(parameters.valid());
EXPECT_EQ(std::string("realm"), parameters.name());
- EXPECT_EQ(std::string(), parameters.value());
+ EXPECT_EQ(std::string(""), parameters.value());
EXPECT_FALSE(parameters.GetNext());
}
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 27c591d..a2a9dfc 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -445,7 +445,7 @@ int HttpCache::CreateBackend(disk_cache::Backend** backend,
// This is the only operation that we can do that is not related to any given
// entry, so we use an empty key for it.
- PendingOp* pending_op = GetPendingOp(std::string());
+ PendingOp* pending_op = GetPendingOp("");
if (pending_op->writer) {
if (!callback.is_null())
pending_op->pending_queue.push_back(item.release());
@@ -477,7 +477,7 @@ int HttpCache::GetBackendForTransaction(Transaction* trans) {
WorkItem* item = new WorkItem(
WI_CREATE_BACKEND, trans, net::CompletionCallback(), NULL);
- PendingOp* pending_op = GetPendingOp(std::string());
+ PendingOp* pending_op = GetPendingOp("");
DCHECK(pending_op->writer);
pending_op->pending_queue.push_back(item);
return ERR_IO_PENDING;
@@ -896,7 +896,7 @@ void HttpCache::RemovePendingTransaction(Transaction* trans) {
return;
if (building_backend_) {
- PendingOpsMap::const_iterator j = pending_ops_.find(std::string());
+ PendingOpsMap::const_iterator j = pending_ops_.find("");
if (j != pending_ops_.end())
found = RemovePendingTransactionFromPendingOp(j->second, trans);
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 467eb94..54d79f3 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -929,7 +929,7 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) {
// We treat any other 1xx in this same way (although in practice getting
// a 1xx that isn't a 100 is rare).
if (response_.headers->response_code() / 100 == 1) {
- response_.headers = new HttpResponseHeaders(std::string());
+ response_.headers = new HttpResponseHeaders("");
next_state_ = STATE_READ_HEADERS;
return OK;
}
diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc
index 0da9f2e..3f81030 100644
--- a/net/http/http_network_transaction_spdy2_unittest.cc
+++ b/net/http/http_network_transaction_spdy2_unittest.cc
@@ -461,24 +461,12 @@ CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool(
CertVerifier* /* cert_verifier */)
: HttpProxyClientSocketPool(0, 0, NULL, host_resolver, NULL, NULL, NULL) {}
-template <>
+template<>
CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
HostResolver* host_resolver,
CertVerifier* cert_verifier)
- : SSLClientSocketPool(0,
- 0,
- NULL,
- host_resolver,
- cert_verifier,
- NULL,
- NULL,
- std::string(),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL) {}
+ : SSLClientSocketPool(0, 0, NULL, host_resolver, cert_verifier, NULL,
+ NULL, "", NULL, NULL, NULL, NULL, NULL, NULL) {}
//-----------------------------------------------------------------------------
@@ -8863,10 +8851,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test,
SSLClientSocketContext context;
context.cert_verifier = session_deps.cert_verifier.get();
ssl_connection->set_socket(session_deps.socket_factory->CreateSSLClientSocket(
- connection.release(),
- HostPortPair(std::string(), 443),
- ssl_config,
- context));
+ connection.release(), HostPortPair("" , 443), ssl_config, context));
EXPECT_EQ(ERR_IO_PENDING,
ssl_connection->socket()->Connect(callback.callback()));
EXPECT_EQ(OK, callback.WaitForResult());
diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc
index 8a90c7b..3076326 100644
--- a/net/http/http_network_transaction_spdy3_unittest.cc
+++ b/net/http/http_network_transaction_spdy3_unittest.cc
@@ -461,24 +461,12 @@ CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool(
CertVerifier* /* cert_verifier */)
: HttpProxyClientSocketPool(0, 0, NULL, host_resolver, NULL, NULL, NULL) {}
-template <>
+template<>
CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
HostResolver* host_resolver,
CertVerifier* cert_verifier)
- : SSLClientSocketPool(0,
- 0,
- NULL,
- host_resolver,
- cert_verifier,
- NULL,
- NULL,
- std::string(),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL) {}
+ : SSLClientSocketPool(0, 0, NULL, host_resolver, cert_verifier, NULL,
+ NULL, "", NULL, NULL, NULL, NULL, NULL, NULL) {}
//-----------------------------------------------------------------------------
@@ -8839,10 +8827,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test,
SSLClientSocketContext context;
context.cert_verifier = session_deps.cert_verifier.get();
ssl_connection->set_socket(session_deps.socket_factory->CreateSSLClientSocket(
- connection.release(),
- HostPortPair(std::string(), 443),
- ssl_config,
- context));
+ connection.release(), HostPortPair("" , 443), ssl_config, context));
EXPECT_EQ(ERR_IO_PENDING,
ssl_connection->socket()->Connect(callback.callback()));
EXPECT_EQ(OK, callback.WaitForResult());
diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
index 48ac42c..77ccbed 100644
--- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
@@ -47,37 +47,26 @@ class HttpProxyClientSocketPoolSpdy2Test : public TestWithHttpParam {
protected:
HttpProxyClientSocketPoolSpdy2Test()
: ssl_config_(),
- ignored_transport_socket_params_(
- new TransportSocketParams(HostPortPair("proxy", 80),
- LOWEST,
- false,
- false,
- OnHostResolutionCallback())),
- ignored_ssl_socket_params_(
- new SSLSocketParams(ignored_transport_socket_params_,
- NULL,
- NULL,
- ProxyServer::SCHEME_DIRECT,
- HostPortPair("www.google.com", 443),
- ssl_config_,
- 0,
- false,
- false)),
+ ignored_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("proxy", 80), LOWEST, false, false,
+ OnHostResolutionCallback())),
+ ignored_ssl_socket_params_(new SSLSocketParams(
+ ignored_transport_socket_params_, NULL, NULL,
+ ProxyServer::SCHEME_DIRECT, HostPortPair("www.google.com", 443),
+ ssl_config_, 0, false, false)),
tcp_histograms_("MockTCP"),
transport_socket_pool_(
- kMaxSockets,
- kMaxSocketsPerGroup,
+ kMaxSockets, kMaxSocketsPerGroup,
&tcp_histograms_,
session_deps_.deterministic_socket_factory.get()),
ssl_histograms_("MockSSL"),
- ssl_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ ssl_socket_pool_(kMaxSockets, kMaxSocketsPerGroup,
&ssl_histograms_,
session_deps_.host_resolver.get(),
session_deps_.cert_verifier.get(),
NULL /* server_bound_cert_store */,
NULL /* transport_security_state */,
- std::string() /* ssl_session_cache_shard */,
+ "" /* ssl_session_cache_shard */,
session_deps_.deterministic_socket_factory.get(),
&transport_socket_pool_,
NULL,
@@ -88,13 +77,13 @@ class HttpProxyClientSocketPoolSpdy2Test : public TestWithHttpParam {
http_proxy_histograms_("HttpProxyUnitTest"),
ssl_data_(NULL),
data_(NULL),
- pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ pool_(kMaxSockets, kMaxSocketsPerGroup,
&http_proxy_histograms_,
NULL,
&transport_socket_pool_,
&ssl_socket_pool_,
- NULL) {}
+ NULL) {
+ }
virtual ~HttpProxyClientSocketPoolSpdy2Test() {
}
@@ -126,16 +115,17 @@ class HttpProxyClientSocketPoolSpdy2Test : public TestWithHttpParam {
// Returns the a correctly constructed HttpProxyParms
// for the HTTP or HTTPS proxy.
scoped_refptr<HttpProxySocketParams> GetParams(bool tunnel) {
- return scoped_refptr<HttpProxySocketParams>(new HttpProxySocketParams(
- GetTcpParams(),
- GetSslParams(),
- GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
- std::string(),
- HostPortPair("www.google.com", tunnel ? 443 : 80),
- session_->http_auth_cache(),
- session_->http_auth_handler_factory(),
- session_->spdy_session_pool(),
- tunnel));
+ return scoped_refptr<HttpProxySocketParams>(
+ new HttpProxySocketParams(
+ GetTcpParams(),
+ GetSslParams(),
+ GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
+ "",
+ HostPortPair("www.google.com", tunnel ? 443 : 80),
+ session_->http_auth_cache(),
+ session_->http_auth_handler_factory(),
+ session_->spdy_session_pool(),
+ tunnel));
}
scoped_refptr<HttpProxySocketParams> GetTunnelParams() {
diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
index 36e5869..86924fc 100644
--- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
@@ -47,37 +47,26 @@ class HttpProxyClientSocketPoolSpdy3Test : public TestWithHttpParam {
protected:
HttpProxyClientSocketPoolSpdy3Test()
: ssl_config_(),
- ignored_transport_socket_params_(
- new TransportSocketParams(HostPortPair("proxy", 80),
- LOWEST,
- false,
- false,
- OnHostResolutionCallback())),
- ignored_ssl_socket_params_(
- new SSLSocketParams(ignored_transport_socket_params_,
- NULL,
- NULL,
- ProxyServer::SCHEME_DIRECT,
- HostPortPair("www.google.com", 443),
- ssl_config_,
- 0,
- false,
- false)),
+ ignored_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("proxy", 80), LOWEST, false, false,
+ OnHostResolutionCallback())),
+ ignored_ssl_socket_params_(new SSLSocketParams(
+ ignored_transport_socket_params_, NULL, NULL,
+ ProxyServer::SCHEME_DIRECT, HostPortPair("www.google.com", 443),
+ ssl_config_, 0, false, false)),
tcp_histograms_("MockTCP"),
transport_socket_pool_(
- kMaxSockets,
- kMaxSocketsPerGroup,
+ kMaxSockets, kMaxSocketsPerGroup,
&tcp_histograms_,
session_deps_.deterministic_socket_factory.get()),
ssl_histograms_("MockSSL"),
- ssl_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ ssl_socket_pool_(kMaxSockets, kMaxSocketsPerGroup,
&ssl_histograms_,
session_deps_.host_resolver.get(),
session_deps_.cert_verifier.get(),
NULL /* server_bound_cert_store */,
NULL /* transport_security_state */,
- std::string() /* ssl_session_cache_shard */,
+ "" /* ssl_session_cache_shard */,
session_deps_.deterministic_socket_factory.get(),
&transport_socket_pool_,
NULL,
@@ -88,13 +77,13 @@ class HttpProxyClientSocketPoolSpdy3Test : public TestWithHttpParam {
http_proxy_histograms_("HttpProxyUnitTest"),
ssl_data_(NULL),
data_(NULL),
- pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ pool_(kMaxSockets, kMaxSocketsPerGroup,
&http_proxy_histograms_,
NULL,
&transport_socket_pool_,
&ssl_socket_pool_,
- NULL) {}
+ NULL) {
+ }
virtual ~HttpProxyClientSocketPoolSpdy3Test() {
}
@@ -126,16 +115,17 @@ class HttpProxyClientSocketPoolSpdy3Test : public TestWithHttpParam {
// Returns the a correctly constructed HttpProxyParms
// for the HTTP or HTTPS proxy.
scoped_refptr<HttpProxySocketParams> GetParams(bool tunnel) {
- return scoped_refptr<HttpProxySocketParams>(new HttpProxySocketParams(
- GetTcpParams(),
- GetSslParams(),
- GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
- std::string(),
- HostPortPair("www.google.com", tunnel ? 443 : 80),
- session_->http_auth_cache(),
- session_->http_auth_handler_factory(),
- session_->spdy_session_pool(),
- tunnel));
+ return scoped_refptr<HttpProxySocketParams>(
+ new HttpProxySocketParams(
+ GetTcpParams(),
+ GetSslParams(),
+ GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
+ "",
+ HostPortPair("www.google.com", tunnel ? 443 : 80),
+ session_->http_auth_cache(),
+ session_->http_auth_handler_factory(),
+ session_->spdy_session_pool(),
+ tunnel));
}
scoped_refptr<HttpProxySocketParams> GetTunnelParams() {
diff --git a/net/http/http_security_headers_unittest.cc b/net/http/http_security_headers_unittest.cc
index 4f1e580..a142486 100644
--- a/net/http/http_security_headers_unittest.cc
+++ b/net/http/http_security_headers_unittest.cc
@@ -51,8 +51,7 @@ TEST_F(HttpSecurityHeadersTest, BogusHeaders) {
base::Time expiry = now;
bool include_subdomains = false;
- EXPECT_FALSE(
- ParseHSTSHeader(now, std::string(), &expiry, &include_subdomains));
+ EXPECT_FALSE(ParseHSTSHeader(now, "", &expiry, &include_subdomains));
EXPECT_FALSE(ParseHSTSHeader(now, " ", &expiry, &include_subdomains));
EXPECT_FALSE(ParseHSTSHeader(now, "abc", &expiry, &include_subdomains));
EXPECT_FALSE(ParseHSTSHeader(now, " abc", &expiry, &include_subdomains));
@@ -136,8 +135,7 @@ static void TestBogusPinsHeaders(HashValueTag tag) {
std::string good_pin = GetTestPin(2, tag);
std::string backup_pin = GetTestPin(4, tag);
- EXPECT_FALSE(
- ParseHPKPHeader(now, std::string(), chain_hashes, &expiry, &hashes));
+ EXPECT_FALSE(ParseHPKPHeader(now, "", chain_hashes, &expiry, &hashes));
EXPECT_FALSE(ParseHPKPHeader(now, " ", chain_hashes, &expiry, &hashes));
EXPECT_FALSE(ParseHPKPHeader(now, "abc", chain_hashes, &expiry, &hashes));
EXPECT_FALSE(ParseHPKPHeader(now, " abc", chain_hashes, &expiry, &hashes));
diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc
index b9ef0bf..8dc9de3 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -65,7 +65,7 @@ TEST_F(SpdyServerPropertiesTest, Initialize) {
}
TEST_F(SpdyServerPropertiesTest, SupportsSpdyTest) {
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
EXPECT_FALSE(impl_.SupportsSpdy(spdy_server_empty));
// Add www.google.com:443 as supporting SPDY.
@@ -89,7 +89,7 @@ TEST_F(SpdyServerPropertiesTest, SupportsSpdyTest) {
}
TEST_F(SpdyServerPropertiesTest, SetSupportsSpdy) {
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
impl_.SetSupportsSpdy(spdy_server_empty, true);
EXPECT_FALSE(impl_.SupportsSpdy(spdy_server_empty));
@@ -134,7 +134,7 @@ TEST_F(SpdyServerPropertiesTest, GetSpdyServerList) {
EXPECT_EQ(0U, spdy_server_list.GetSize());
// Check empty server is not added.
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
impl_.SetSupportsSpdy(spdy_server_empty, true);
impl_.GetSpdyServerList(&spdy_server_list);
EXPECT_EQ(0U, spdy_server_list.GetSize());
@@ -303,7 +303,7 @@ TEST_F(SpdySettingsServerPropertiesTest, Initialize) {
}
TEST_F(SpdySettingsServerPropertiesTest, SetSpdySetting) {
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
const SettingsMap& settings_map0 = impl_.GetSpdySettings(spdy_server_empty);
EXPECT_EQ(0U, settings_map0.size()); // Returns kEmptySettingsMap.
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index f228d9a..0a9437f 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -271,24 +271,11 @@ CapturePreconnectsHttpProxySocketPool::CapturePreconnectsSocketPool(
: HttpProxyClientSocketPool(0, 0, NULL, host_resolver, NULL, NULL, NULL),
last_num_streams_(-1) {}
-template <>
+template<>
CapturePreconnectsSSLSocketPool::CapturePreconnectsSocketPool(
- HostResolver* host_resolver,
- CertVerifier* cert_verifier)
- : SSLClientSocketPool(0,
- 0,
- NULL,
- host_resolver,
- cert_verifier,
- NULL,
- NULL,
- std::string(),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL),
+ HostResolver* host_resolver, CertVerifier* cert_verifier)
+ : SSLClientSocketPool(0, 0, NULL, host_resolver, cert_verifier, NULL,
+ NULL, "", NULL, NULL, NULL, NULL, NULL, NULL),
last_num_streams_(-1) {}
TEST(HttpStreamFactoryTest, PreconnectDirect) {
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index f86821c..083343d 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -966,12 +966,12 @@ TEST(HttpUtilTest, NameValuePairsIteratorCopyAndAssign) {
}
TEST(HttpUtilTest, NameValuePairsIteratorEmptyInput) {
- std::string data;
+ std::string data = "";
HttpUtil::NameValuePairsIterator parser(data.begin(), data.end(), ';');
EXPECT_TRUE(parser.valid());
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
TEST(HttpUtilTest, NameValuePairsIterator) {
@@ -997,19 +997,19 @@ TEST(HttpUtilTest, NameValuePairsIterator) {
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "f", "'hello world'"));
ASSERT_NO_FATAL_FAILURE(
- CheckNextNameValuePair(&parser, true, true, "g", std::string()));
+ CheckNextNameValuePair(&parser, true, true, "g", ""));
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "h", "hello"));
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
TEST(HttpUtilTest, NameValuePairsIteratorIllegalInputs) {
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1", "; beta"));
- ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair(std::string(), "beta"));
+ ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("", "beta"));
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1", "; 'beta'=2"));
- ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair(std::string(), "'beta'=2"));
+ ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("", "'beta'=2"));
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1", ";beta="));
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1",
";beta=;cappa=2"));
@@ -1033,8 +1033,8 @@ TEST(HttpUtilTest, NameValuePairsIteratorExtraSeparators) {
CheckNextNameValuePair(&parser, true, true, "beta", "2"));
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "cappa", "3"));
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
// See comments on the implementation of NameValuePairsIterator::GetNext
@@ -1046,6 +1046,6 @@ TEST(HttpUtilTest, NameValuePairsIteratorMissingEndQuote) {
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "name", "value"));
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
diff --git a/net/http/http_vary_data.cc b/net/http/http_vary_data.cc
index 51b74a4..c716ca0 100644
--- a/net/http/http_vary_data.cc
+++ b/net/http/http_vary_data.cc
@@ -105,7 +105,7 @@ std::string HttpVaryData::GetRequestValue(
if (request_info.extra_headers.GetHeader(request_header, &result))
return result;
- return std::string();
+ return "";
}
// static
diff --git a/net/http/http_vary_data_unittest.cc b/net/http/http_vary_data_unittest.cc
index 93ee4f45..38e4e32 100644
--- a/net/http/http_vary_data_unittest.cc
+++ b/net/http/http_vary_data_unittest.cc
@@ -41,7 +41,7 @@ TEST(HttpVaryDataTest, IsInvalid) {
for (size_t i = 0; i < arraysize(kTestResponses); ++i) {
TestTransaction t;
- t.Init(std::string(), kTestResponses[i]);
+ t.Init("", kTestResponses[i]);
net::HttpVaryData v;
EXPECT_FALSE(v.is_valid());
diff --git a/net/proxy/dhcp_proxy_script_fetcher.cc b/net/proxy/dhcp_proxy_script_fetcher.cc
index 1771be0..4771d9d 100644
--- a/net/proxy/dhcp_proxy_script_fetcher.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher.cc
@@ -9,7 +9,7 @@
namespace net {
std::string DhcpProxyScriptFetcher::GetFetcherName() const {
- return std::string();
+ return "";
}
DhcpProxyScriptFetcher::DhcpProxyScriptFetcher() {}
diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
index 5e0e108..b5503e5 100644
--- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
@@ -282,8 +282,7 @@ TEST_F(ProxyResolverV8TracingTest, Dns) {
host_resolver.rules()->AddRuleForAddressFamily(
"host1", ADDRESS_FAMILY_IPV4, "166.155.144.44");
- host_resolver.rules()
- ->AddIPLiteralRule("host1", "::1,192.168.1.1", std::string());
+ host_resolver.rules()->AddIPLiteralRule("host1", "::1,192.168.1.1", "");
host_resolver.rules()->AddSimulatedFailure("host2");
host_resolver.rules()->AddRule("host3", "166.155.144.33");
host_resolver.rules()->AddRule("host5", "166.155.144.55");
@@ -996,8 +995,7 @@ TEST_F(ProxyResolverV8TracingTest, MultipleResolvers) {
MockHostResolver host_resolver0;
host_resolver0.rules()->AddRuleForAddressFamily(
"host1", ADDRESS_FAMILY_IPV4, "166.155.144.44");
- host_resolver0.rules()
- ->AddIPLiteralRule("host1", "::1,192.168.1.1", std::string());
+ host_resolver0.rules()->AddIPLiteralRule("host1", "::1,192.168.1.1", "");
host_resolver0.rules()->AddSimulatedFailure("host2");
host_resolver0.rules()->AddRule("host3", "166.155.144.33");
host_resolver0.rules()->AddRule("host5", "166.155.144.55");
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index 53cc326..ec4a0fa 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -1723,7 +1723,7 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomPac) {
// the script download.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://wpad/wpad.dat"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Next it should be trying the custom PAC url.
EXPECT_TRUE(fetcher->has_pending_request());
@@ -1872,12 +1872,12 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) {
// It should be trying to auto-detect first -- fail the download.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://wpad/wpad.dat"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Next it should be trying the custom PAC url -- fail the download.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Since we never managed to initialize a ProxyResolver, nothing should have
// been sent to it.
@@ -2251,7 +2251,7 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterFailure) {
//
// We simulate a failed download attempt, the proxy service should now
// fall-back to DIRECT connections.
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
ASSERT_TRUE(resolver->pending_requests().empty());
@@ -2604,7 +2604,7 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterSuccess) {
// to download the script.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
MessageLoop::current()->RunUntilIdle();
@@ -2771,7 +2771,7 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterActivity) {
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
// This time we will fail the download, to simulate a PAC script change.
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Drain the message loop, so ProxyService is notified of the change
// and has a chance to re-configure itself.
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 1370ced..f3f4c33 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -348,7 +348,7 @@ TEST_F(QuicHttpStreamTest, GetRequest) {
stream_->ReadResponseHeaders(callback_.callback()));
// Send the response without a body.
- SetResponseString("404 Not Found", std::string());
+ SetResponseString("404 Not Found", "");
scoped_ptr<QuicEncryptedPacket> resp(
ConstructDataPacket(2, false, kFin, 0, response_data_));
ProcessPacket(*resp);
@@ -440,7 +440,7 @@ TEST_F(QuicHttpStreamTest, SendPostRequest) {
ProcessPacket(*ack);
// Send the response headers (but not the body).
- SetResponseString("200 OK", std::string());
+ SetResponseString("200 OK", "");
scoped_ptr<QuicEncryptedPacket> resp(
ConstructDataPacket(2, false, !kFin, 0, response_data_));
ProcessPacket(*resp);
@@ -502,7 +502,7 @@ TEST_F(QuicHttpStreamTest, SendChunkedPostRequest) {
ProcessPacket(*ack);
// Send the response headers (but not the body).
- SetResponseString("200 OK", std::string());
+ SetResponseString("200 OK", "");
scoped_ptr<QuicEncryptedPacket> resp(
ConstructDataPacket(2, false, !kFin, 0, response_data_));
ProcessPacket(*resp);
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 2f4e2e9..5e7ed61 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -180,7 +180,7 @@ TEST_F(QuicPacketCreatorTest, CreateStreamFrameFinOnly) {
QuicFrame frame;
size_t consumed = creator_.CreateStreamFrame(1u, "", 0u, true, &frame);
EXPECT_EQ(0u, consumed);
- CheckStreamFrame(frame, 1u, std::string(), 0u, true);
+ CheckStreamFrame(frame, 1u, "", 0u, true);
delete frame.stream_frame;
}
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index 4e84d0b..c7e2918 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -120,7 +120,7 @@ class QuicPacketGeneratorTest : public ::testing::Test {
}
QuicGoAwayFrame* CreateGoAwayFrame() {
- return new QuicGoAwayFrame(QUIC_NO_ERROR, 1, std::string());
+ return new QuicGoAwayFrame(QUIC_NO_ERROR, 1, "");
}
void CheckPacketContains(const PacketContents& contents,
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index a0c9a3a..4f1fb08 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -62,7 +62,7 @@ void HttpServer::Send200(int connection_id,
}
void HttpServer::Send404(int connection_id) {
- Send(connection_id, HTTP_NOT_FOUND, std::string(), "text/html");
+ Send(connection_id, HTTP_NOT_FOUND, "", "text/html");
}
void HttpServer::Send500(int connection_id, const std::string& message) {
diff --git a/net/server/http_server_request_info.cc b/net/server/http_server_request_info.cc
index 08b925f..eda597a 100644
--- a/net/server/http_server_request_info.cc
+++ b/net/server/http_server_request_info.cc
@@ -16,7 +16,7 @@ std::string HttpServerRequestInfo::GetHeaderValue(
headers.find(header_name);
if (it != headers.end())
return it->second;
- return std::string();
+ return "";
}
} // namespace net
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index bc64306..0628d91 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -274,7 +274,7 @@ class TestConnectJob : public ConnectJob {
// Set all of the additional error state fields in some way.
handle->set_is_ssl_error(true);
HttpResponseInfo info;
- info.headers = new HttpResponseHeaders(std::string());
+ info.headers = new HttpResponseHeaders("");
handle->set_ssl_error_response_info(info);
}
}
@@ -846,7 +846,7 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) {
// Set the additional error state members to ensure that they get cleared.
handle.set_is_ssl_error(true);
HttpResponseInfo info;
- info.headers = new HttpResponseHeaders(std::string());
+ info.headers = new HttpResponseHeaders("");
handle.set_ssl_error_response_info(info);
EXPECT_EQ(ERR_CONNECTION_FAILED,
handle.Init("a",
@@ -1720,7 +1720,7 @@ TEST_F(ClientSocketPoolBaseTest,
// Set the additional error state members to ensure that they get cleared.
handle.set_is_ssl_error(true);
HttpResponseInfo info;
- info.headers = new HttpResponseHeaders(std::string());
+ info.headers = new HttpResponseHeaders("");
handle.set_ssl_error_response_info(info);
EXPECT_EQ(ERR_IO_PENDING, handle.Init("a",
params_,
diff --git a/net/socket/deterministic_socket_data_unittest.cc b/net/socket/deterministic_socket_data_unittest.cc
index aea8160..a007e36 100644
--- a/net/socket/deterministic_socket_data_unittest.cc
+++ b/net/socket/deterministic_socket_data_unittest.cc
@@ -77,8 +77,9 @@ DeterministicSocketDataTest::DeterministicSocketDataTest()
false,
false,
OnHostResolutionCallback())),
- histograms_(std::string()),
- socket_pool_(10, 10, &histograms_, &socket_factory_) {}
+ histograms_(""),
+ socket_pool_(10, 10, &histograms_, &socket_factory_) {
+}
void DeterministicSocketDataTest::TearDown() {
// Empty the current queue.
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc
index fe7e3d2..c188a80 100644
--- a/net/socket/ssl_client_socket_pool_unittest.cc
+++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -79,54 +79,46 @@ class SSLClientSocketPoolTest : public testing::Test {
SSLClientSocketPoolTest()
: proxy_service_(ProxyService::CreateDirect()),
ssl_config_service_(new SSLConfigServiceDefaults),
- http_auth_handler_factory_(
- HttpAuthHandlerFactory::CreateDefault(&host_resolver_)),
+ http_auth_handler_factory_(HttpAuthHandlerFactory::CreateDefault(
+ &host_resolver_)),
session_(CreateNetworkSession()),
- direct_transport_socket_params_(
- new TransportSocketParams(HostPortPair("host", 443),
- MEDIUM,
- false,
- false,
- OnHostResolutionCallback())),
+ direct_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("host", 443), MEDIUM, false, false,
+ OnHostResolutionCallback())),
transport_histograms_("MockTCP"),
- transport_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
- &transport_histograms_,
- &socket_factory_),
- proxy_transport_socket_params_(
- new TransportSocketParams(HostPortPair("proxy", 443),
- MEDIUM,
- false,
- false,
- OnHostResolutionCallback())),
- socks_socket_params_(
- new SOCKSSocketParams(proxy_transport_socket_params_,
- true,
- HostPortPair("sockshost", 443),
- MEDIUM)),
+ transport_socket_pool_(
+ kMaxSockets,
+ kMaxSocketsPerGroup,
+ &transport_histograms_,
+ &socket_factory_),
+ proxy_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("proxy", 443), MEDIUM, false, false,
+ OnHostResolutionCallback())),
+ socks_socket_params_(new SOCKSSocketParams(
+ proxy_transport_socket_params_, true,
+ HostPortPair("sockshost", 443), MEDIUM)),
socks_histograms_("MockSOCKS"),
- socks_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
- &socks_histograms_,
- &transport_socket_pool_),
- http_proxy_socket_params_(
- new HttpProxySocketParams(proxy_transport_socket_params_,
- NULL,
- GURL("http://host"),
- std::string(),
- HostPortPair("host", 80),
- session_->http_auth_cache(),
- session_->http_auth_handler_factory(),
- session_->spdy_session_pool(),
- true)),
+ socks_socket_pool_(
+ kMaxSockets,
+ kMaxSocketsPerGroup,
+ &socks_histograms_,
+ &transport_socket_pool_),
+ http_proxy_socket_params_(new HttpProxySocketParams(
+ proxy_transport_socket_params_, NULL, GURL("http://host"), "",
+ HostPortPair("host", 80),
+ session_->http_auth_cache(),
+ session_->http_auth_handler_factory(),
+ session_->spdy_session_pool(),
+ true)),
http_proxy_histograms_("MockHttpProxy"),
- http_proxy_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
- &http_proxy_histograms_,
- &host_resolver_,
- &transport_socket_pool_,
- NULL,
- NULL) {
+ http_proxy_socket_pool_(
+ kMaxSockets,
+ kMaxSocketsPerGroup,
+ &http_proxy_histograms_,
+ &host_resolver_,
+ &transport_socket_pool_,
+ NULL,
+ NULL) {
scoped_refptr<SSLConfigService> ssl_config_service(
new SSLConfigServiceDefaults);
ssl_config_service->GetSSLConfig(&ssl_config_);
@@ -142,7 +134,7 @@ class SSLClientSocketPoolTest : public testing::Test {
NULL /* cert_verifier */,
NULL /* server_bound_cert_service */,
NULL /* transport_security_state */,
- std::string() /* ssl_session_cache_shard */,
+ "" /* ssl_session_cache_shard */,
&socket_factory_,
transport_pool ? &transport_socket_pool_ : NULL,
socks_pool ? &socks_socket_pool_ : NULL,
@@ -730,8 +722,8 @@ TEST_F(SSLClientSocketPoolTest, IPPooling) {
host_resolver_.set_synchronous_mode(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- host_resolver_.rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ host_resolver_.rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
@@ -813,8 +805,8 @@ void SSLClientSocketPoolTest::TestIPPoolingDisabled(
TestCompletionCallback callback;
int rv;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- host_resolver_.rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ host_resolver_.rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc
index 9d95a1b..eba7c26 100644
--- a/net/socket/transport_client_socket_pool_unittest.cc
+++ b/net/socket/transport_client_socket_pool_unittest.cc
@@ -1210,8 +1210,8 @@ TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) {
client_socket_factory_.set_client_socket_types(case_types, 2);
// Resolve an AddressList with a IPv6 address first and then a IPv4 address.
- host_resolver_->rules()
- ->AddIPLiteralRule("*", "2:abcd::3:4:ff,2.2.2.2", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "2:abcd::3:4:ff,2.2.2.2", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
@@ -1255,8 +1255,8 @@ TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv6FinishesFirst) {
TransportConnectJob::kIPv6FallbackTimerInMs + 50));
// Resolve an AddressList with a IPv6 address first and then a IPv4 address.
- host_resolver_->rules()
- ->AddIPLiteralRule("*", "2:abcd::3:4:ff,2.2.2.2", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "2:abcd::3:4:ff,2.2.2.2", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
@@ -1289,8 +1289,8 @@ TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) {
MockClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
// Resolve an AddressList with only IPv6 addresses.
- host_resolver_->rules()
- ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "2:abcd::3:4:ff,3:abcd::3:4:ff", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
@@ -1323,7 +1323,8 @@ TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) {
MockClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
// Resolve an AddressList with only IPv4 addresses.
- host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "1.1.1.1", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 3ae8871a..46d44c9 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -1826,7 +1826,7 @@ TEST_P(SpdyFramerTest, CreateSynStreamUncompressed) {
"max stream ID";
SpdyHeaderBlock headers;
- headers[std::string()] = "foo";
+ headers[""] = "foo";
headers["foo"] = "bar";
const unsigned char kV2FrameData[] = {
@@ -2103,7 +2103,7 @@ TEST_P(SpdyFramerTest, CreateSynReplyUncompressed) {
"SYN_REPLY frame with a 0-length header name, FIN, max stream ID";
SpdyHeaderBlock headers;
- headers[std::string()] = "foo";
+ headers[""] = "foo";
headers["foo"] = "bar";
const unsigned char kV2FrameData[] = {
@@ -2619,7 +2619,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
"HEADERS frame with a 0-length header name, FIN, max stream ID";
SpdyHeaderBlock headers;
- headers[std::string()] = "foo";
+ headers[""] = "foo";
headers["foo"] = "bar";
const unsigned char kV2FrameData[] = {
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index 49fb8ca..41647c1 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -188,9 +188,8 @@ GURL GetUrlFromHeaderBlock(const SpdyHeaderBlock& headers,
if (it != headers.end())
path = it->second;
- std::string url = (scheme.empty() || host_port.empty() || path.empty())
- ? std::string()
- : scheme + "://" + host_port + path;
+ std::string url = (scheme.empty() || host_port.empty() || path.empty())
+ ? "" : scheme + "://" + host_port + path;
return GURL(url);
}
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
index 1d7026f..0b93815 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -678,8 +678,8 @@ void IPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type) {
SpdySessionDependencies session_deps;
session_deps.host_resolver->set_synchronous_mode(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- session_deps.host_resolver->rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ session_deps.host_resolver->rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
@@ -1139,7 +1139,7 @@ TEST_F(SpdySessionSpdy2Test, CloseSessionWithTwoCreatedStreams) {
EXPECT_EQ(0u, spdy_stream2->stream_id());
// Ensure we don't crash while closing the session.
- session->CloseSessionOnError(ERR_ABORTED, true, std::string());
+ session->CloseSessionOnError(ERR_ABORTED, true, "");
EXPECT_TRUE(spdy_stream1->closed());
EXPECT_TRUE(spdy_stream2->closed());
diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc
index eaf23ffe..c790251 100644
--- a/net/spdy/spdy_session_spdy3_unittest.cc
+++ b/net/spdy/spdy_session_spdy3_unittest.cc
@@ -704,8 +704,8 @@ void IPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type) {
SpdySessionDependencies session_deps;
session_deps.host_resolver->set_synchronous_mode(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- session_deps.host_resolver->rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ session_deps.host_resolver->rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
@@ -1140,7 +1140,7 @@ TEST_F(SpdySessionSpdy3Test, CloseSessionWithTwoCreatedStreams) {
EXPECT_EQ(0u, spdy_stream2->stream_id());
// Ensure we don't crash while closing the session.
- session->CloseSessionOnError(ERR_ABORTED, true, std::string());
+ session->CloseSessionOnError(ERR_ABORTED, true, "");
EXPECT_TRUE(spdy_stream1->closed());
EXPECT_TRUE(spdy_stream2->closed());
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 70412dd..5725253 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -534,7 +534,7 @@ void SpdyStream::Cancel() {
cancelled_ = true;
if (session_->IsStreamActive(stream_id_))
- session_->ResetStream(stream_id_, RST_STREAM_CANCEL, std::string());
+ session_->ResetStream(stream_id_, RST_STREAM_CANCEL, "");
else if (stream_id_ == 0)
session_->CloseCreatedStream(this, RST_STREAM_CANCEL);
}
diff --git a/net/spdy/spdy_stream_test_util.cc b/net/spdy/spdy_stream_test_util.cc
index 00a58df..3b2235f 100644
--- a/net/spdy/spdy_stream_test_util.cc
+++ b/net/spdy/spdy_stream_test_util.cc
@@ -101,7 +101,7 @@ int StreamDelegateBase::WaitForClose() {
std::string StreamDelegateBase::GetResponseHeaderValue(
const std::string& name) const {
SpdyHeaderBlock::const_iterator it = response_.find(name);
- return (it == response_.end()) ? std::string() : it->second;
+ return (it == response_.end()) ? "" : it->second;
}
StreamDelegateSendImmediate::StreamDelegateSendImmediate(
diff --git a/net/spdy/spdy_write_queue_unittest.cc b/net/spdy/spdy_write_queue_unittest.cc
index 26029e4..c295db8 100644
--- a/net/spdy/spdy_write_queue_unittest.cc
+++ b/net/spdy/spdy_write_queue_unittest.cc
@@ -60,8 +60,7 @@ int ProducerToInt(scoped_ptr<SpdyFrameProducer> producer) {
// -- be careful to not call any functions that expect the session to
// be there.
SpdyStream* MakeTestStream(RequestPriority priority) {
- return new SpdyStream(
- NULL, std::string(), priority, 0, 0, false, BoundNetLog());
+ return new SpdyStream(NULL, "", priority, 0, 0, false, BoundNetLog());
}
// Add some frame producers of different priority. The producers
diff --git a/net/ssl/server_bound_cert_service.cc b/net/ssl/server_bound_cert_service.cc
index 3a50ed6..bed97cf 100644
--- a/net/ssl/server_bound_cert_service.cc
+++ b/net/ssl/server_bound_cert_service.cc
@@ -579,11 +579,8 @@ void ServerBoundCertService::GotServerBoundCert(
delete worker;
// TODO(rkn): Log to the NetLog.
LOG(ERROR) << "ServerBoundCertServiceWorker couldn't be started.";
- HandleResult(ERR_INSUFFICIENT_RESOURCES,
- server_identifier,
- CLIENT_CERT_INVALID_TYPE,
- std::string(),
- std::string());
+ HandleResult(ERR_INSUFFICIENT_RESOURCES, server_identifier,
+ CLIENT_CERT_INVALID_TYPE, "", "");
return;
}
}
@@ -613,11 +610,7 @@ void ServerBoundCertService::GeneratedServerBoundCert(
HandleResult(error, server_identifier, cert->type(), cert->private_key(),
cert->cert());
} else {
- HandleResult(error,
- server_identifier,
- CLIENT_CERT_INVALID_TYPE,
- std::string(),
- std::string());
+ HandleResult(error, server_identifier, CLIENT_CERT_INVALID_TYPE, "", "");
}
}
diff --git a/net/test/base_test_server.cc b/net/test/base_test_server.cc
index ab9b121..3a2dc11 100644
--- a/net/test/base_test_server.cc
+++ b/net/test/base_test_server.cc
@@ -92,7 +92,7 @@ base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
std::string BaseTestServer::SSLOptions::GetOCSPArgument() const {
if (server_certificate != CERT_AUTO)
- return std::string();
+ return "";
switch (ocsp_status) {
case OCSP_OK:
@@ -107,7 +107,7 @@ std::string BaseTestServer::SSLOptions::GetOCSPArgument() const {
return "unknown";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
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_;
diff --git a/net/udp/udp_socket_unittest.cc b/net/udp/udp_socket_unittest.cc
index 09a2806..c2085ad 100644
--- a/net/udp/udp_socket_unittest.cc
+++ b/net/udp/udp_socket_unittest.cc
@@ -38,7 +38,7 @@ class UDPSocketTest : public PlatformTest {
if (rv == ERR_IO_PENDING)
rv = callback.WaitForResult();
if (rv < 0)
- return std::string(); // error!
+ return ""; // error!
return std::string(buffer_->data(), rv);
}
@@ -82,7 +82,7 @@ class UDPSocketTest : public PlatformTest {
if (rv == ERR_IO_PENDING)
rv = callback.WaitForResult();
if (rv < 0)
- return std::string(); // error!
+ return ""; // error!
return std::string(buffer_->data(), rv);
}
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc
index c8cbd1a..98a3a11 100644
--- a/net/url_request/url_fetcher_impl_unittest.cc
+++ b/net/url_request/url_fetcher_impl_unittest.cc
@@ -441,16 +441,11 @@ class CancelTestURLRequestContextGetter
// The initial backoff is 2 seconds and maximum backoff is 4 seconds.
// Maximum retries allowed is set to 2.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(context_->throttler_manager(),
- std::string(),
- 200,
- 3,
- 2000,
- 2.0,
- 0.0,
- 4000));
- context_->throttler_manager()
- ->OverrideEntryForTests(throttle_for_url_, entry);
+ new URLRequestThrottlerEntry(
+ context_->throttler_manager(),
+ "", 200, 3, 2000, 2.0, 0.0, 4000));
+ context_->throttler_manager()->OverrideEntryForTests(
+ throttle_for_url_, entry);
context_created_.Signal();
}
@@ -558,7 +553,7 @@ void URLFetcherEmptyPostTest::CreateFetcher(const GURL& url) {
fetcher_ = new URLFetcherImpl(url, URLFetcher::POST, this);
fetcher_->SetRequestContext(new TestURLRequestContextGetter(
io_message_loop_proxy()));
- fetcher_->SetUploadData("text/plain", std::string());
+ fetcher_->SetUploadData("text/plain", "");
fetcher_->Start();
}
@@ -1168,14 +1163,9 @@ TEST_F(URLFetcherProtectTest, Overload) {
// Registers an entry for test url. It only allows 3 requests to be sent
// in 200 milliseconds.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 200,
- 3,
- 1,
- 2.0,
- 0.0,
- 256));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 200, 3, 1, 2.0, 0.0, 256));
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
CreateFetcher(url);
@@ -1196,14 +1186,9 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) {
// and maximum backoff time is 256 milliseconds.
// Maximum retries allowed is set to 11.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 200,
- 3,
- 1,
- 2.0,
- 0.0,
- 256));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 200, 3, 1, 2.0, 0.0, 256));
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
CreateFetcher(url);
@@ -1224,14 +1209,9 @@ TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) {
// and maximum backoff time is 150000 milliseconds.
// Maximum retries allowed is set to 11.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 200,
- 3,
- 100,
- 2.0,
- 0.0,
- 150000));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 200, 3, 100, 2.0, 0.0, 150000));
// Total time if *not* for not doing automatic backoff would be 150s.
// In reality it should be "as soon as server responds".
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
@@ -1288,14 +1268,9 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
// Using a sliding window of 4 seconds, and max of 1 request, under a fast
// run we expect to have a 4 second delay when posting the Start task.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 4000,
- 1,
- 2000,
- 2.0,
- 0.0,
- 4000));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 4000, 1, 2000, 2.0, 0.0, 4000));
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
// Fake that a request has just started.
entry->ReserveSendingTimeForNextRequest(base::TimeTicks());
diff --git a/net/url_request/url_request_throttler_simulation_unittest.cc b/net/url_request/url_request_throttler_simulation_unittest.cc
index cbb8be8..3a5a399 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -297,9 +297,11 @@ class Server : public DiscreteTimeSimulation::Actor {
// Mock throttler entry used by Requester class.
class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
public:
- explicit MockURLRequestThrottlerEntry(URLRequestThrottlerManager* manager)
- : URLRequestThrottlerEntry(manager, std::string()),
- mock_backoff_entry_(&backoff_policy_) {}
+ explicit MockURLRequestThrottlerEntry(
+ URLRequestThrottlerManager* manager)
+ : URLRequestThrottlerEntry(manager, ""),
+ mock_backoff_entry_(&backoff_policy_) {
+ }
virtual const BackoffEntry* GetBackoffEntry() const OVERRIDE {
return &mock_backoff_entry_;
@@ -431,7 +433,7 @@ class Requester : public DiscreteTimeSimulation::Actor {
if (!throttler_entry_->ShouldRejectRequest(server_->mock_request())) {
int status_code = server_->HandleRequest();
MockURLRequestThrottlerHeaderAdapter response_headers(status_code);
- throttler_entry_->UpdateWithResponse(std::string(), &response_headers);
+ throttler_entry_->UpdateWithResponse("", &response_headers);
if (status_code == 200) {
if (results_)
diff --git a/net/url_request/url_request_throttler_test_support.cc b/net/url_request/url_request_throttler_test_support.cc
index 9d3f4e2..b6088ec 100644
--- a/net/url_request/url_request_throttler_test_support.cc
+++ b/net/url_request/url_request_throttler_test_support.cc
@@ -48,7 +48,7 @@ std::string MockURLRequestThrottlerHeaderAdapter::GetNormalizedValue(
return fake_opt_out_value_;
}
- return std::string();
+ return "";
}
int MockURLRequestThrottlerHeaderAdapter::GetResponseCode() const {
diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc
index ed3eb87..cb20a95 100644
--- a/net/url_request/url_request_throttler_unittest.cc
+++ b/net/url_request/url_request_throttler_unittest.cc
@@ -37,7 +37,7 @@ class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
public:
explicit MockURLRequestThrottlerEntry(
net::URLRequestThrottlerManager* manager)
- : net::URLRequestThrottlerEntry(manager, std::string()),
+ : net::URLRequestThrottlerEntry(manager, ""),
mock_backoff_entry_(&backoff_policy_) {
InitPolicy();
}
@@ -46,7 +46,7 @@ class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
const TimeTicks& exponential_backoff_release_time,
const TimeTicks& sliding_window_release_time,
const TimeTicks& fake_now)
- : net::URLRequestThrottlerEntry(manager, std::string()),
+ : net::URLRequestThrottlerEntry(manager, ""),
fake_time_now_(fake_now),
mock_backoff_entry_(&backoff_policy_) {
InitPolicy();
@@ -279,14 +279,14 @@ TEST_F(URLRequestThrottlerEntryTest, InterfaceNotDuringExponentialBackoff) {
TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateFailure) {
MockURLRequestThrottlerHeaderAdapter failure_response(503);
- entry_->UpdateWithResponse(std::string(), &failure_response);
+ entry_->UpdateWithResponse("", &failure_response);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), entry_->fake_time_now_)
<< "A failure should increase the release_time";
}
TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateSuccess) {
MockURLRequestThrottlerHeaderAdapter success_response(200);
- entry_->UpdateWithResponse(std::string(), &success_response);
+ entry_->UpdateWithResponse("", &success_response);
EXPECT_EQ(entry_->GetExponentialBackoffReleaseTime(), entry_->fake_time_now_)
<< "A success should not add any delay";
}
@@ -294,11 +294,11 @@ TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateSuccess) {
TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateSuccessThenFailure) {
MockURLRequestThrottlerHeaderAdapter failure_response(503);
MockURLRequestThrottlerHeaderAdapter success_response(200);
- entry_->UpdateWithResponse(std::string(), &success_response);
- entry_->UpdateWithResponse(std::string(), &failure_response);
+ entry_->UpdateWithResponse("", &success_response);
+ entry_->UpdateWithResponse("", &failure_response);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), entry_->fake_time_now_)
<< "This scenario should add delay";
- entry_->UpdateWithResponse(std::string(), &success_response);
+ entry_->UpdateWithResponse("", &success_response);
}
TEST_F(URLRequestThrottlerEntryTest, IsEntryReallyOutdated) {
@@ -324,7 +324,7 @@ TEST_F(URLRequestThrottlerEntryTest, IsEntryReallyOutdated) {
TEST_F(URLRequestThrottlerEntryTest, MaxAllowedBackoff) {
for (int i = 0; i < 30; ++i) {
MockURLRequestThrottlerHeaderAdapter response_adapter(503);
- entry_->UpdateWithResponse(std::string(), &response_adapter);
+ entry_->UpdateWithResponse("", &response_adapter);
}
TimeDelta delay = entry_->GetExponentialBackoffReleaseTime() - now_;
@@ -335,7 +335,7 @@ TEST_F(URLRequestThrottlerEntryTest, MaxAllowedBackoff) {
TEST_F(URLRequestThrottlerEntryTest, MalformedContent) {
MockURLRequestThrottlerHeaderAdapter response_adapter(503);
for (int i = 0; i < 5; ++i)
- entry_->UpdateWithResponse(std::string(), &response_adapter);
+ entry_->UpdateWithResponse("", &response_adapter);
TimeTicks release_after_failures = entry_->GetExponentialBackoffReleaseTime();
@@ -346,7 +346,7 @@ TEST_F(URLRequestThrottlerEntryTest, MalformedContent) {
// response must also have been received).
entry_->ReceivedContentWasMalformed(200);
MockURLRequestThrottlerHeaderAdapter success_adapter(200);
- entry_->UpdateWithResponse(std::string(), &success_adapter);
+ entry_->UpdateWithResponse("", &success_adapter);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), release_after_failures);
}
@@ -475,7 +475,7 @@ void ExpectEntryAllowsAllOnErrorIfOptedOut(
MockURLRequestThrottlerHeaderAdapter failure_adapter(503);
for (int i = 0; i < 10; ++i) {
// Host doesn't really matter in this scenario so we skip it.
- entry->UpdateWithResponse(std::string(), &failure_adapter);
+ entry->UpdateWithResponse("", &failure_adapter);
}
EXPECT_NE(opted_out, entry->ShouldRejectRequest(request));
@@ -500,7 +500,7 @@ TEST_F(URLRequestThrottlerManagerTest, OptOutHeader) {
// Fake a response with the opt-out header.
MockURLRequestThrottlerHeaderAdapter response_adapter(
- std::string(),
+ "",
MockURLRequestThrottlerEntry::kExponentialThrottlingDisableValue,
200);
entry->UpdateWithResponse("www.google.com", &response_adapter);
@@ -517,8 +517,7 @@ TEST_F(URLRequestThrottlerManagerTest, OptOutHeader) {
// Fake a response with the opt-out header incorrectly specified.
scoped_refptr<net::URLRequestThrottlerEntryInterface> no_opt_out_entry =
manager.RegisterRequestUrl(GURL("http://www.nike.com/justdoit"));
- MockURLRequestThrottlerHeaderAdapter wrong_adapter(
- std::string(), "yesplease", 200);
+ MockURLRequestThrottlerHeaderAdapter wrong_adapter("", "yesplease", 200);
no_opt_out_entry->UpdateWithResponse("www.nike.com", &wrong_adapter);
ExpectEntryAllowsAllOnErrorIfOptedOut(no_opt_out_entry, false, request_);
@@ -536,7 +535,7 @@ TEST_F(URLRequestThrottlerManagerTest, ClearOnNetworkChange) {
MockURLRequestThrottlerHeaderAdapter failure_adapter(503);
for (int j = 0; j < 10; ++j) {
// Host doesn't really matter in this scenario so we skip it.
- entry_before->UpdateWithResponse(std::string(), &failure_adapter);
+ entry_before->UpdateWithResponse("", &failure_adapter);
}
EXPECT_TRUE(entry_before->ShouldRejectRequest(request_));
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index c3c68a1..494e6b3 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -2577,7 +2577,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequest) {
&network_delegate);
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -2626,21 +2626,21 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestSynchronously1) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::SYNCHRONOUS,
BlockingNetworkDelegate::ON_BEFORE_URL_REQUEST,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestSynchronously2) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::SYNCHRONOUS,
BlockingNetworkDelegate::ON_BEFORE_SEND_HEADERS,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestSynchronously3) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::SYNCHRONOUS,
BlockingNetworkDelegate::ON_HEADERS_RECEIVED,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
// The following 3 tests check that the network delegate can cancel a request
@@ -2649,21 +2649,21 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestAsynchronously1) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::AUTO_CALLBACK,
BlockingNetworkDelegate::ON_BEFORE_URL_REQUEST,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestAsynchronously2) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::AUTO_CALLBACK,
BlockingNetworkDelegate::ON_BEFORE_SEND_HEADERS,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestAsynchronously3) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::AUTO_CALLBACK,
BlockingNetworkDelegate::ON_HEADERS_RECEIVED,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
// Tests that the network delegate can block and redirect a request to a new
@@ -2992,7 +2992,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting1) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -3028,7 +3028,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting2) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -3063,7 +3063,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting3) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -3147,7 +3147,7 @@ TEST_F(URLRequestTestHTTP, GetTest_NoCache) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3213,7 +3213,7 @@ TEST_F(URLRequestTestHTTP, GetTest) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3235,7 +3235,7 @@ TEST_F(URLRequestTestHTTP, GetTestLoadTiming) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3319,7 +3319,7 @@ TEST_F(URLRequestTestHTTP, HTTPSToHTTPRedirectNoRefererTest) {
// An https server is sent a request with an https referer,
// and responds with a redirect to an http url. The http
// server should not be sent the referer.
- GURL http_destination = test_server_.GetURL(std::string());
+ GURL http_destination = test_server_.GetURL("");
TestDelegate d;
URLRequest req(https_test_server.GetURL(
"server-redirect?" + http_destination.spec()), &d, &default_context_);
@@ -3336,9 +3336,9 @@ TEST_F(URLRequestTestHTTP, HTTPSToHTTPRedirectNoRefererTest) {
TEST_F(URLRequestTestHTTP, RedirectLoadTiming) {
ASSERT_TRUE(test_server_.Start());
- GURL destination_url = test_server_.GetURL(std::string());
- GURL original_url =
- test_server_.GetURL("server-redirect?" + destination_url.spec());
+ GURL destination_url = test_server_.GetURL("");
+ GURL original_url = test_server_.GetURL(
+ "server-redirect?" + destination_url.spec());
TestDelegate d;
URLRequest req(original_url, &d, &default_context_);
req.Start();
@@ -3374,9 +3374,9 @@ TEST_F(URLRequestTestHTTP, RedirectLoadTiming) {
TEST_F(URLRequestTestHTTP, MultipleRedirectTest) {
ASSERT_TRUE(test_server_.Start());
- GURL destination_url = test_server_.GetURL(std::string());
- GURL middle_redirect_url =
- test_server_.GetURL("server-redirect?" + destination_url.spec());
+ GURL destination_url = test_server_.GetURL("");
+ GURL middle_redirect_url = test_server_.GetURL(
+ "server-redirect?" + destination_url.spec());
GURL original_url = test_server_.GetURL(
"server-redirect?" + middle_redirect_url.spec());
TestDelegate d;
@@ -3492,7 +3492,7 @@ TEST_F(URLRequestTestHTTP, CancelTest2) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
d.set_cancel_in_response_started(true);
@@ -3513,7 +3513,7 @@ TEST_F(URLRequestTestHTTP, CancelTest3) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
d.set_cancel_in_received_data(true);
@@ -3537,7 +3537,7 @@ TEST_F(URLRequestTestHTTP, CancelTest4) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4496,7 +4496,7 @@ TEST_F(HTTPSRequestTest, HTTPSGetTest) {
TestDelegate d;
{
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4526,7 +4526,7 @@ TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) {
TestDelegate d;
{
d.set_allow_certificate_errors(err_allowed);
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4561,7 +4561,7 @@ TEST_F(HTTPSRequestTest, HTTPSExpiredTest) {
TestDelegate d;
{
d.set_allow_certificate_errors(err_allowed);
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4605,7 +4605,7 @@ TEST_F(HTTPSRequestTest, TLSv1Fallback) {
TestURLRequestContext context(true);
context.Init();
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -4784,7 +4784,7 @@ TEST_F(HTTPSRequestTest, SSLv3Fallback) {
TestURLRequestContext context(true);
context.Init();
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -4832,7 +4832,7 @@ TEST_F(HTTPSRequestTest, ClientAuthTest) {
SSLClientAuthTestDelegate d;
{
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5072,7 +5072,7 @@ class HTTPSOCSPTest : public HTTPSRequestTest {
TestDelegate d;
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context_);
+ URLRequest r(test_server.GetURL(""), &d, &context_);
r.Start();
MessageLoop::current()->Run();
diff --git a/net/websockets/websocket_net_log_params_unittest.cc b/net/websockets/websocket_net_log_params_unittest.cc
index 0519390f..e3c92a9 100644
--- a/net/websockets/websocket_net_log_params_unittest.cc
+++ b/net/websockets/websocket_net_log_params_unittest.cc
@@ -21,7 +21,7 @@ TEST(NetLogWebSocketHandshakeParameterTest, ToValue) {
list->Append(new StringValue("Upgrade: WebSocket"));
list->Append(new StringValue("Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5"));
list->Append(new StringValue("Origin: http://example.com"));
- list->Append(new StringValue(std::string()));
+ list->Append(new StringValue(""));
list->Append(new StringValue("\\x00\\x01\\x0a\\x0d\\xff\\xfe\\x0d\\x0a"));
DictionaryValue expected;