summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_cache_transaction.cc2
-rw-r--r--net/http/http_cache_unittest.cc24
-rw-r--r--net/http/http_network_transaction.cc4
-rw-r--r--net/http/http_network_transaction_unittest.cc30
-rw-r--r--net/http/http_response_headers_unittest.cc80
-rw-r--r--net/http/http_stream_parser.cc2
-rw-r--r--net/http/http_stream_request.cc8
-rw-r--r--net/http/http_transaction_unittest.cc2
8 files changed, 76 insertions, 76 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 58288f4..873ccf4 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1801,7 +1801,7 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
DCHECK_EQ(200, response_.headers->response_code());
}
- scoped_refptr<PickledIOBuffer> data = new PickledIOBuffer();
+ scoped_refptr<PickledIOBuffer> data(new PickledIOBuffer());
response_.Persist(data->pickle(), skip_transient_headers, truncated);
data->Done();
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index eec8098..f71cec9 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -573,7 +573,7 @@ class MockHttpCache {
int size = disk_entry->GetDataSize(0);
TestCompletionCallback cb;
- scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(size);
+ scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(size));
int rv = disk_entry->ReadData(0, 0, buffer, size, &cb);
rv = cb.GetResult(rv);
EXPECT_EQ(size, rv);
@@ -593,8 +593,8 @@ class MockHttpCache {
&pickle, skip_transient_headers, response_truncated);
TestCompletionCallback cb;
- scoped_refptr<net::WrappedIOBuffer> data = new net::WrappedIOBuffer(
- reinterpret_cast<const char*>(pickle.data()));
+ scoped_refptr<net::WrappedIOBuffer> data(new net::WrappedIOBuffer(
+ reinterpret_cast<const char*>(pickle.data())));
int len = static_cast<int>(pickle.size());
int rv = disk_entry->WriteData(0, 0, data, len, &cb, true);
@@ -951,8 +951,8 @@ const MockTransaction kRangeGET_TransactionOK = {
void Verify206Response(std::string response, int start, int end) {
std::string raw_headers(net::HttpUtil::AssembleRawHeaders(response.data(),
response.size()));
- scoped_refptr<net::HttpResponseHeaders> headers =
- new net::HttpResponseHeaders(raw_headers);
+ scoped_refptr<net::HttpResponseHeaders> headers(
+ new net::HttpResponseHeaders(raw_headers));
ASSERT_EQ(206, headers->response_code());
@@ -1854,7 +1854,7 @@ TEST(HttpCache, SimpleGET_AbandonedCacheRead) {
rv = callback.WaitForResult();
ASSERT_EQ(net::OK, rv);
- scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(256);
+ scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256));
rv = trans->Read(buf, 256, &callback);
EXPECT_EQ(net::ERR_IO_PENDING, rv);
@@ -3544,7 +3544,7 @@ TEST(HttpCache, RangeGET_Cancel) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure that the entry has some data stored.
- scoped_refptr<net::IOBufferWithSize> buf = new net::IOBufferWithSize(10);
+ scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10));
rv = c->trans->Read(buf, buf->size(), &c->callback);
if (rv == net::ERR_IO_PENDING)
rv = c->callback.WaitForResult();
@@ -3585,7 +3585,7 @@ TEST(HttpCache, RangeGET_Cancel2) {
// Make sure that we revalidate the entry and read from the cache (a single
// read will return while waiting for the network).
- scoped_refptr<net::IOBufferWithSize> buf = new net::IOBufferWithSize(5);
+ scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(5));
rv = c->trans->Read(buf, buf->size(), &c->callback);
EXPECT_EQ(5, c->callback.GetResult(rv));
rv = c->trans->Read(buf, buf->size(), &c->callback);
@@ -3631,7 +3631,7 @@ TEST(HttpCache, RangeGET_Cancel3) {
// Make sure that we revalidate the entry and read from the cache (a single
// read will return while waiting for the network).
- scoped_refptr<net::IOBufferWithSize> buf = new net::IOBufferWithSize(5);
+ scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(5));
rv = c->trans->Read(buf, buf->size(), &c->callback);
EXPECT_EQ(5, c->callback.GetResult(rv));
rv = c->trans->Read(buf, buf->size(), &c->callback);
@@ -4029,7 +4029,7 @@ TEST(HttpCache, DoomOnDestruction2) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure that the entry has some data stored.
- scoped_refptr<net::IOBufferWithSize> buf = new net::IOBufferWithSize(10);
+ scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10));
rv = c->trans->Read(buf, buf->size(), &c->callback);
if (rv == net::ERR_IO_PENDING)
rv = c->callback.WaitForResult();
@@ -4073,7 +4073,7 @@ TEST(HttpCache, DoomOnDestruction3) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure that the entry has some data stored.
- scoped_refptr<net::IOBufferWithSize> buf = new net::IOBufferWithSize(10);
+ scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10));
rv = c->trans->Read(buf, buf->size(), &c->callback);
if (rv == net::ERR_IO_PENDING)
rv = c->callback.WaitForResult();
@@ -4117,7 +4117,7 @@ TEST(HttpCache, Set_Truncated_Flag) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure that the entry has some data stored.
- scoped_refptr<net::IOBufferWithSize> buf = new net::IOBufferWithSize(10);
+ scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10));
rv = c->trans->Read(buf, buf->size(), &c->callback);
if (rv == net::ERR_IO_PENDING)
rv = c->callback.WaitForResult();
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 43eae30..16d9171 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -285,7 +285,7 @@ int HttpNetworkTransaction::Read(IOBuffer* buf, int buf_len,
State next_state = STATE_NONE;
- scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders();
+ scoped_refptr<HttpResponseHeaders> headers(GetResponseHeaders());
if (headers_valid_ && headers.get() && stream_request_.get()) {
// We're trying to read the body of the response but we're still trying
// to establish an SSL tunnel through the proxy. We can't read these
@@ -1078,7 +1078,7 @@ bool HttpNetworkTransaction::ShouldApplyServerAuth() const {
}
int HttpNetworkTransaction::HandleAuthChallenge() {
- scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders();
+ scoped_refptr<HttpResponseHeaders> headers(GetResponseHeaders());
DCHECK(headers);
int status = headers->response_code();
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 1510186..0ba698c 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -605,7 +605,7 @@ TEST_F(HttpNetworkTransactionTest, Head) {
TEST_F(HttpNetworkTransactionTest, ReuseConnection) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
MockRead data_reads[] = {
MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
@@ -794,7 +794,7 @@ TEST_F(HttpNetworkTransactionTest, EmptyResponse) {
void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest(
const MockRead& read_failure) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpRequestInfo request;
request.method = "GET";
@@ -911,7 +911,7 @@ TEST_F(HttpNetworkTransactionTest, NonKeepAliveConnectionEOF) {
// reading the body.
TEST_F(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpRequestInfo request;
request.method = "GET";
@@ -3250,7 +3250,7 @@ TEST_F(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) {
request[1].load_flags = 0;
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
// The first socket is used for transaction 1 and the first attempt of
// transaction 2.
@@ -3518,7 +3518,7 @@ TEST_F(HttpNetworkTransactionTest, WrongAuthIdentityInURL) {
// Test that previously tried username/passwords for a realm get re-used.
TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
// Transaction 1: authenticate (foo, bar) on MyRealm1
{
@@ -3911,7 +3911,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
// are started with the same nonce.
TEST_F(HttpNetworkTransactionTest, DigestPreAuthNonceCount) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpAuthHandlerDigest::SetFixedCnonce(true);
// Transaction 1: authenticate (foo, bar) on MyRealm1
@@ -4065,7 +4065,7 @@ TEST_F(HttpNetworkTransactionTest, ResetStateForRestart) {
HttpRequestInfo request;
std::string temp("HTTP/1.1 200 OK\nVary: foo, bar\n\n");
std::replace(temp.begin(), temp.end(), '\n', '\0');
- scoped_refptr<HttpResponseHeaders> headers = new HttpResponseHeaders(temp);
+ scoped_refptr<HttpResponseHeaders> headers(new HttpResponseHeaders(temp));
request.extra_headers.SetHeader("Foo", "1");
request.extra_headers.SetHeader("bar", "23");
EXPECT_TRUE(response->vary_data.Init(request, *headers));
@@ -5378,7 +5378,7 @@ TEST_F(HttpNetworkTransactionTest, BypassHostCacheOnRefresh3) {
// Make sure we can handle an error when writing the request.
TEST_F(HttpNetworkTransactionTest, RequestWriteError) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpRequestInfo request;
request.method = "GET";
@@ -5407,7 +5407,7 @@ TEST_F(HttpNetworkTransactionTest, RequestWriteError) {
// Check that a connection closed after the start of the headers finishes ok.
TEST_F(HttpNetworkTransactionTest, ConnectionClosedAfterStartOfHeaders) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpRequestInfo request;
request.method = "GET";
@@ -5449,7 +5449,7 @@ TEST_F(HttpNetworkTransactionTest, ConnectionClosedAfterStartOfHeaders) {
// restart does the right thing.
TEST_F(HttpNetworkTransactionTest, DrainResetOK) {
SessionDependencies session_deps;
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpRequestInfo request;
request.method = "GET";
@@ -6473,8 +6473,8 @@ TEST_F(HttpNetworkTransactionTest,
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, session->mutable_spdy_settings(),
BoundNetLog());
- scoped_refptr<TCPSocketParams> tcp_params =
- new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false);
+ scoped_refptr<TCPSocketParams> tcp_params(
+ new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(ERR_IO_PENDING,
@@ -6948,7 +6948,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
origin, BoundNetLog());
auth_factory->set_mock_handler(auth_handler, HttpAuth::AUTH_SERVER);
- scoped_refptr<HttpNetworkSession> session = CreateSession(&session_deps);
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session));
int rv = OK;
@@ -7649,8 +7649,8 @@ TEST_F(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) {
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, session->mutable_spdy_settings(),
BoundNetLog());
- scoped_refptr<TCPSocketParams> tcp_params =
- new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false);
+ scoped_refptr<TCPSocketParams> tcp_params(
+ new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false));
TestCompletionCallback callback;
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc
index 18cd1c4..6986723 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -51,8 +51,8 @@ void TestCommon(const TestData& test) {
string expected_headers(test.expected_headers);
string headers;
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(raw_headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(raw_headers));
parsed->GetNormalizedHeaders(&headers);
// Transform to readable output format (so it's easier to see diffs).
@@ -281,7 +281,7 @@ TEST(HttpResponseHeadersTest, GetNormalizedHeader) {
"Cache-control: private\n"
"cache-Control: no-store\n";
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
std::string value;
EXPECT_TRUE(parsed->GetNormalizedHeader("cache-control", &value));
@@ -448,15 +448,15 @@ TEST(HttpResponseHeadersTest, Persist) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
std::string headers = tests[i].raw_headers;
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed1 =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed1(
+ new HttpResponseHeaders(headers));
Pickle pickle;
parsed1->Persist(&pickle, tests[i].options);
void* iter = NULL;
- scoped_refptr<HttpResponseHeaders> parsed2 =
- new HttpResponseHeaders(pickle, &iter);
+ scoped_refptr<HttpResponseHeaders> parsed2(
+ new HttpResponseHeaders(pickle, &iter));
std::string h2;
parsed2->GetNormalizedHeaders(&h2);
@@ -472,7 +472,7 @@ TEST(HttpResponseHeadersTest, EnumerateHeader_Coalesced) {
"Cache-control:private , no-cache=\"set-cookie,server\" \n"
"cache-Control: no-store\n";
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
void* iter = NULL;
std::string value;
@@ -493,7 +493,7 @@ TEST(HttpResponseHeadersTest, EnumerateHeader_Challenge) {
"WWW-Authenticate:Digest realm=foobar, nonce=x, domain=y\n"
"WWW-Authenticate:Basic realm=quatar\n";
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
void* iter = NULL;
std::string value;
@@ -512,7 +512,7 @@ TEST(HttpResponseHeadersTest, EnumerateHeader_DateValued) {
"Date: Tue, 07 Aug 2007 23:10:55 GMT\n"
"Last-Modified: Wed, 01 Aug 2007 23:23:45 GMT\n";
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
std::string value;
EXPECT_TRUE(parsed->EnumerateHeader(NULL, "date", &value));
@@ -656,8 +656,8 @@ TEST(HttpResponseHeadersTest, GetMimeType) {
for (size_t i = 0; i < arraysize(tests); ++i) {
string headers(tests[i].raw_headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
std::string value;
EXPECT_EQ(tests[i].has_mimetype, parsed->GetMimeType(&value));
@@ -807,8 +807,8 @@ TEST(HttpResponseHeadersTest, RequiresValidation) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
bool requires_validation =
parsed->RequiresValidation(request_time, response_time, current_time);
@@ -871,13 +871,13 @@ TEST(HttpResponseHeadersTest, Update) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string orig_headers(tests[i].orig_headers);
HeadersToRaw(&orig_headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(orig_headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(orig_headers));
string new_headers(tests[i].new_headers);
HeadersToRaw(&new_headers);
- scoped_refptr<HttpResponseHeaders> new_parsed =
- new HttpResponseHeaders(new_headers);
+ scoped_refptr<HttpResponseHeaders> new_parsed(
+ new HttpResponseHeaders(new_headers));
parsed->Update(*new_parsed);
@@ -917,8 +917,8 @@ TEST(HttpResponseHeadersTest, EnumerateHeaderLines) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
string name, value, lines;
@@ -1001,8 +1001,8 @@ TEST(HttpResponseHeadersTest, IsRedirect) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
std::string location;
EXPECT_EQ(parsed->IsRedirect(&location), tests[i].is_redirect);
@@ -1087,8 +1087,8 @@ TEST(HttpResponseHeadersTest, GetContentLength) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
EXPECT_EQ(tests[i].expected_len, parsed->GetContentLength());
}
@@ -1338,8 +1338,8 @@ TEST(HttpResponseHeaders, GetContentRange) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
int64 first_byte_position;
int64 last_byte_position;
@@ -1420,8 +1420,8 @@ TEST(HttpResponseHeadersTest, IsKeepAlive) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
EXPECT_EQ(tests[i].expected_keep_alive, parsed->IsKeepAlive());
}
@@ -1473,8 +1473,8 @@ TEST(HttpResponseHeadersTest, HasStrongValidators) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(headers));
EXPECT_EQ(tests[i].expected_result, parsed->HasStrongValidators()) <<
"Failed test case " << i;
@@ -1484,14 +1484,14 @@ TEST(HttpResponseHeadersTest, HasStrongValidators) {
TEST(HttpResponseHeadersTest, GetStatusText) {
std::string headers("HTTP/1.1 404 Not Found");
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
EXPECT_EQ(std::string("Not Found"), parsed->GetStatusText());
}
TEST(HttpResponseHeadersTest, GetStatusTextMissing) {
std::string headers("HTTP/1.1 404");
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
// Since the status line gets normalized, we have OK
EXPECT_EQ(std::string("OK"), parsed->GetStatusText());
}
@@ -1499,14 +1499,14 @@ TEST(HttpResponseHeadersTest, GetStatusTextMissing) {
TEST(HttpResponseHeadersTest, GetStatusTextMultiSpace) {
std::string headers("HTTP/1.0 404 Not Found");
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
EXPECT_EQ(std::string("Not Found"), parsed->GetStatusText());
}
TEST(HttpResponseHeadersTest, GetStatusBadStatusLine) {
std::string headers("Foo bar.");
HeadersToRaw(&headers);
- scoped_refptr<HttpResponseHeaders> parsed = new HttpResponseHeaders(headers);
+ scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
// The bad status line would have gotten rewritten as
// HTTP/1.0 200 OK.
EXPECT_EQ(std::string("OK"), parsed->GetStatusText());
@@ -1545,8 +1545,8 @@ TEST(HttpResponseHeadersTest, AddHeader) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string orig_headers(tests[i].orig_headers);
HeadersToRaw(&orig_headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(orig_headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(orig_headers));
string new_header(tests[i].new_header);
parsed->AddHeader(new_header);
@@ -1590,8 +1590,8 @@ TEST(HttpResponseHeadersTest, RemoveHeader) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string orig_headers(tests[i].orig_headers);
HeadersToRaw(&orig_headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(orig_headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(orig_headers));
string name(tests[i].to_remove);
parsed->RemoveHeader(name);
@@ -1645,8 +1645,8 @@ TEST(HttpResponseHeadersTest, ReplaceStatus) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string orig_headers(tests[i].orig_headers);
HeadersToRaw(&orig_headers);
- scoped_refptr<HttpResponseHeaders> parsed =
- new HttpResponseHeaders(orig_headers);
+ scoped_refptr<HttpResponseHeaders> parsed(
+ new HttpResponseHeaders(orig_headers));
string name(tests[i].new_status);
parsed->ReplaceStatusLine(name);
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 4470199..d3e4abd 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -53,7 +53,7 @@ int HttpStreamParser::SendRequest(const std::string& headers,
DCHECK(response);
response_ = response;
- scoped_refptr<StringIOBuffer> headers_io_buf = new StringIOBuffer(headers);
+ scoped_refptr<StringIOBuffer> headers_io_buf(new StringIOBuffer(headers));
request_headers_ = new DrainableIOBuffer(headers_io_buf,
headers_io_buf->size());
request_body_.reset(request_body);
diff --git a/net/http/http_stream_request.cc b/net/http/http_stream_request.cc
index 3517b4e..71bbdda 100644
--- a/net/http/http_stream_request.cc
+++ b/net/http/http_stream_request.cc
@@ -480,9 +480,9 @@ int HttpStreamRequest::DoInitConnection() {
} else {
ProxyServer proxy_server = proxy_info()->proxy_server();
proxy_host_port.reset(new HostPortPair(proxy_server.host_port_pair()));
- scoped_refptr<TCPSocketParams> proxy_tcp_params =
+ scoped_refptr<TCPSocketParams> proxy_tcp_params(
new TCPSocketParams(*proxy_host_port, request_info().priority,
- request_info().referrer, disable_resolver_cache);
+ request_info().referrer, disable_resolver_cache));
if (proxy_info()->is_http() || proxy_info()->is_https()) {
GURL authentication_url = request_info().url;
@@ -857,12 +857,12 @@ scoped_refptr<SSLSocketParams> HttpStreamRequest::GenerateSslParams(
ssl_config()->mitm_proxies_allowed = true;
}
- scoped_refptr<SSLSocketParams> ssl_params =
+ scoped_refptr<SSLSocketParams> ssl_params(
new SSLSocketParams(tcp_params, socks_params, http_proxy_params,
proxy_scheme, hostname,
*ssl_config(), load_flags,
force_spdy_always_ && force_spdy_over_ssl_,
- want_spdy_over_npn);
+ want_spdy_over_npn));
return ssl_params;
}
diff --git a/net/http/http_transaction_unittest.cc b/net/http/http_transaction_unittest.cc
index 4d9daa5..518c1f8 100644
--- a/net/http/http_transaction_unittest.cc
+++ b/net/http/http_transaction_unittest.cc
@@ -147,7 +147,7 @@ int ReadTransaction(net::HttpTransaction* trans, std::string* result) {
std::string content;
do {
- scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(256);
+ scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256));
rv = trans->Read(buf, 256, &callback);
if (rv == net::ERR_IO_PENDING)
rv = callback.WaitForResult();