summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_auth_handler_basic_unittest.cc6
-rw-r--r--net/http/http_auth_handler_digest_unittest.cc4
-rw-r--r--net/http/http_auth_unittest.cc2
-rw-r--r--net/http/http_byte_range_unittest.cc6
-rw-r--r--net/http/http_cache_transaction.cc2
-rw-r--r--net/http/http_content_disposition_unittest.cc6
-rw-r--r--net/http/http_network_transaction_unittest.cc8
-rw-r--r--net/http/http_util_unittest.cc12
8 files changed, 23 insertions, 23 deletions
diff --git a/net/http/http_auth_handler_basic_unittest.cc b/net/http/http_auth_handler_basic_unittest.cc
index 6f112b1..a369df3 100644
--- a/net/http/http_auth_handler_basic_unittest.cc
+++ b/net/http/http_auth_handler_basic_unittest.cc
@@ -32,7 +32,7 @@ TEST(HttpAuthHandlerBasicTest, GenerateAuthToken) {
};
GURL origin("http://www.example.com");
HttpAuthHandlerBasic::Factory factory;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string challenge = "Basic realm=\"Atlantis\"";
scoped_ptr<HttpAuthHandler> basic;
EXPECT_EQ(OK, factory.CreateAuthHandlerFromString(
@@ -90,7 +90,7 @@ TEST(HttpAuthHandlerBasicTest, HandleAnotherChallenge) {
tests[0].challenge, HttpAuth::AUTH_SERVER, origin,
BoundNetLog(), &basic));
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string challenge(tests[i].challenge);
HttpAuthChallengeTokenizer tok(challenge.begin(),
challenge.end());
@@ -183,7 +183,7 @@ TEST(HttpAuthHandlerBasicTest, InitFromChallenge) {
};
HttpAuthHandlerBasic::Factory factory;
GURL origin("http://www.example.com");
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string challenge = tests[i].challenge;
scoped_ptr<HttpAuthHandler> basic;
int rv = factory.CreateAuthHandlerFromString(
diff --git a/net/http/http_auth_handler_digest_unittest.cc b/net/http/http_auth_handler_digest_unittest.cc
index 5c3941c..8b5179e 100644
--- a/net/http/http_auth_handler_digest_unittest.cc
+++ b/net/http/http_auth_handler_digest_unittest.cc
@@ -351,7 +351,7 @@ TEST(HttpAuthHandlerDigestTest, ParseChallenge) {
GURL origin("http://www.example.com");
scoped_ptr<HttpAuthHandlerDigest::Factory> factory(
new HttpAuthHandlerDigest::Factory());
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
scoped_ptr<HttpAuthHandler> handler;
int rv = factory->CreateAuthHandlerFromString(tests[i].challenge,
HttpAuth::AUTH_SERVER,
@@ -516,7 +516,7 @@ TEST(HttpAuthHandlerDigestTest, AssembleCredentials) {
GURL origin("http://www.example.com");
scoped_ptr<HttpAuthHandlerDigest::Factory> factory(
new HttpAuthHandlerDigest::Factory());
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
scoped_ptr<HttpAuthHandler> handler;
int rv = factory->CreateAuthHandlerFromString(tests[i].challenge,
HttpAuth::AUTH_SERVER,
diff --git a/net/http/http_auth_unittest.cc b/net/http/http_auth_unittest.cc
index cf68fa8..52e8294 100644
--- a/net/http/http_auth_unittest.cc
+++ b/net/http/http_auth_unittest.cc
@@ -129,7 +129,7 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
http_auth_handler_factory->SetURLSecurityManager(
"negotiate", &url_security_manager);
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
// Make a HttpResponseHeaders object.
std::string headers_with_status_line("HTTP/1.1 401 Unauthorized\n");
headers_with_status_line += tests[i].headers;
diff --git a/net/http/http_byte_range_unittest.cc b/net/http/http_byte_range_unittest.cc
index 5dc6e52..d075294 100644
--- a/net/http/http_byte_range_unittest.cc
+++ b/net/http/http_byte_range_unittest.cc
@@ -23,7 +23,7 @@ TEST(HttpByteRangeTest, ValidRanges) {
{ -1, -1, 100000, true },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
net::HttpByteRange range;
range.set_first_byte_position(tests[i].first_byte_position);
range.set_last_byte_position(tests[i].last_byte_position);
@@ -55,7 +55,7 @@ TEST(HttpByteRangeTest, SetInstanceSize) {
{ 10, 10000, -1, 1000000, true, 10, 10000 },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
net::HttpByteRange range;
range.set_first_byte_position(tests[i].first_byte_position);
range.set_last_byte_position(tests[i].last_byte_position);
@@ -86,7 +86,7 @@ TEST(HttpByteRangeTest, GetHeaderValue) {
{net::HttpByteRange::Bounded(0, -1), "bytes=0-"},
{net::HttpByteRange::RightUnbounded(100), "bytes=100-"},
{net::HttpByteRange::Suffix(100), "bytes=-100"}, };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
EXPECT_EQ(tests[i].expected, tests[i].range.GetHeaderValue());
}
}
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index ddd0481..5441e90 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -2015,7 +2015,7 @@ void HttpCache::Transaction::SetRequest(const BoundNetLog& net_log,
if (request_->extra_headers.HasHeader(HttpRequestHeaders::kRange))
range_found = true;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSpecialHeaders); ++i) {
+ for (size_t i = 0; i < arraysize(kSpecialHeaders); ++i) {
if (HeaderMatches(request_->extra_headers, kSpecialHeaders[i].search)) {
effective_load_flags_ |= kSpecialHeaders[i].load_flag;
break;
diff --git a/net/http/http_content_disposition_unittest.cc b/net/http/http_content_disposition_unittest.cc
index 43fef9d..e617c6c 100644
--- a/net/http/http_content_disposition_unittest.cc
+++ b/net/http/http_content_disposition_unittest.cc
@@ -195,7 +195,7 @@ TEST(HttpContentDispositionTest, Filename) {
{"attachment; foobar=x; filename=\"foo.html\"", "",
L"foo.html"},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
HttpContentDisposition header(tests[i].header, tests[i].referrer_charset);
EXPECT_EQ(tests[i].expected,
base::UTF8ToWide(header.filename()))
@@ -503,7 +503,7 @@ TEST(HttpContentDispositionTest, tc2231) {
// TODO(abarth): http://greenbytes.de/tech/tc2231/#attrfc2047token
// TODO(abarth): http://greenbytes.de/tech/tc2231/#attrfc2047quoted
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
HttpContentDisposition header(tests[i].header, std::string());
EXPECT_EQ(tests[i].expected_type, header.type())
<< "Failed on input: " << tests[i].header;
@@ -576,7 +576,7 @@ TEST(HttpContentDispositionTest, ParseResult) {
HttpContentDisposition::HAS_NAME },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kTestCases); ++i) {
const ParseResultTestCase& test_case = kTestCases[i];
HttpContentDisposition content_disposition(test_case.header, "utf-8");
int result = content_disposition.parse_result_flags();
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 4aa309d..ca26d6f 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -7601,7 +7601,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForDirectConnections) {
session_deps_.use_alternate_protocols = true;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
session_deps_.proxy_service.reset(
ProxyService::CreateFixed(tests[i].proxy_server));
scoped_refptr<HttpNetworkSession> session(
@@ -7664,7 +7664,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForHTTPProxyConnections) {
session_deps_.use_alternate_protocols = true;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
session_deps_.proxy_service.reset(
ProxyService::CreateFixed(tests[i].proxy_server));
scoped_refptr<HttpNetworkSession> session(
@@ -7734,7 +7734,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForSOCKSConnections) {
session_deps_.use_alternate_protocols = true;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
session_deps_.proxy_service.reset(
ProxyService::CreateFixed(tests[i].proxy_server));
scoped_refptr<HttpNetworkSession> session(
@@ -9652,7 +9652,7 @@ TEST_P(HttpNetworkTransactionTest, GenerateAuthToken) {
TestRound(kGetAuth, kFailure, kAuthErr)}},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_configs); ++i) {
+ for (size_t i = 0; i < arraysize(test_configs); ++i) {
HttpAuthHandlerMock::Factory* auth_factory(
new HttpAuthHandlerMock::Factory());
session_deps_.http_auth_handler_factory.reset(auth_factory);
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index 54acf68..acb2693 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -114,7 +114,7 @@ TEST(HttpUtilTest, HasHeader) {
{ "fOO: 1\r\nbar: 2", "foo", true },
{ "g: 0\r\nfoo: 1\r\nbar: 2", "foo", true },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
bool result = HttpUtil::HasHeader(tests[i].headers, tests[i].name);
EXPECT_EQ(tests[i].expected_result, result);
}
@@ -272,7 +272,7 @@ TEST(HttpUtilTest, LocateEndOfHeaders) {
{ "foo\nbar\n\r\njunk", 10 },
{ "foo\nbar\r\n\njunk", 10 },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
int input_len = static_cast<int>(strlen(tests[i].input));
int eoh = HttpUtil::LocateEndOfHeaders(tests[i].input, input_len);
EXPECT_EQ(tests[i].expected_result, eoh);
@@ -582,7 +582,7 @@ TEST(HttpUtilTest, AssembleRawHeaders) {
"HTTP/1.0 200 OK|Foo: 1Foo2: 3|Bar: 2||"
},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string input = tests[i].input;
std::replace(input.begin(), input.end(), '|', '\0');
std::string raw = HttpUtil::AssembleRawHeaders(input.data(), input.size());
@@ -629,7 +629,7 @@ TEST(HttpUtilTest, RequestUrlSanitize) {
"/foobar?query=1"
}
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
GURL url(GURL(tests[i].url));
std::string expected_spec(tests[i].expected_spec);
std::string expected_path(tests[i].expected_path);
@@ -725,7 +725,7 @@ TEST(HttpUtilTest, ParseContentType) {
},
// TODO(abarth): Add more interesting test cases.
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string mime_type;
std::string charset;
bool had_charset = false;
@@ -853,7 +853,7 @@ TEST(HttpUtilTest, ParseRanges) {
},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::vector<net::HttpByteRange> ranges;
bool return_value = HttpUtil::ParseRanges(std::string(tests[i].headers),
&ranges);