Index: net/http/http_network_transaction_unittest.cc |
=================================================================== |
--- net/http/http_network_transaction_unittest.cc (revision 227981) |
+++ net/http/http_network_transaction_unittest.cc (working copy) |
@@ -289,9 +289,9 @@ |
CapturingBoundNetLog log; |
session_deps_.net_log = log.bound().net_log(); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
for (size_t i = 0; i < data_count; ++i) { |
session_deps_.socket_factory->AddSocketDataProvider(data[i]); |
@@ -566,9 +566,9 @@ |
} // namespace |
TEST_P(HttpNetworkTransactionTest, Basic) { |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
} |
TEST_P(HttpNetworkTransactionTest, SimpleGET) { |
@@ -861,9 +861,9 @@ |
request.url = GURL("http://redirect.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); |
session_deps_.socket_factory->AddSocketDataProvider(&data); |
@@ -905,9 +905,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes1[] = { |
MockWrite("HEAD / HTTP/1.1\r\n" |
@@ -1017,9 +1017,9 @@ |
request.upload_data_stream = &upload_data_stream; |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead("HTTP/1.0 100 Continue\r\n\r\n"), |
@@ -1059,9 +1059,9 @@ |
request.url = GURL("http://www.foo.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead("HTTP/1.1 102 Unspecified status code\r\n\r\n" |
@@ -1098,9 +1098,9 @@ |
request.url = GURL("http://www.foo.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead(SYNCHRONOUS, "HTTP/1.0 100 Continue\r\n"), |
@@ -1129,10 +1129,11 @@ |
request.url = GURL("http://www.foo.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
+ |
MockRead data_reads[] = { |
MockRead(ASYNC, 0), |
}; |
@@ -1259,9 +1260,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead(ASYNC, ERR_CONNECTION_RESET), |
@@ -1507,9 +1508,9 @@ |
CapturingNetLog log; |
session_deps_.net_log = &log; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes1[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -1600,9 +1601,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -2263,9 +2264,9 @@ |
request.load_flags = 0; |
// We are using a DIRECT connection (i.e. no proxy) for this session. |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes1[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -3742,10 +3743,11 @@ |
request.load_flags = 0; |
session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
// Configure against proxy server "myproxy:70". |
wtc
2013/10/15 23:08:21
Nit: this comment could be describing |session| be
mmenke
2013/10/16 15:58:44
Done.
|
- scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ scoped_ptr<HttpTransaction> trans( |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes1[] = { |
MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" |
@@ -4201,9 +4203,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
// Respond with 300 kb of headers (we should fail after 256 kb). |
std::string large_headers_string; |
@@ -4656,9 +4658,9 @@ |
request.url = GURL("http://foo:b@r@www.google.com/"); |
request.load_flags = LOAD_NORMAL; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
// The password contains an escaped character -- for this test to pass it |
// will need to be unescaped by HttpNetworkTransaction. |
@@ -4737,9 +4739,9 @@ |
request.load_flags = LOAD_NORMAL; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes1[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -5356,9 +5358,9 @@ |
// Test the ResetStateForRestart() private method. |
TEST_P(HttpNetworkTransactionTest, ResetStateForRestart) { |
// Create a transaction (the dependencies aren't important). |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpNetworkTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
// Setup some state (which we expect ResetStateForRestart() will clear). |
trans->read_buf_ = new IOBuffer(15); |
@@ -5403,9 +5405,9 @@ |
request.url = GURL("https://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -5507,9 +5509,9 @@ |
for (int i = 0; i < 2; i++) { |
wtc
2013/10/16 15:04:32
I wonder why this test needs to repeat this twice.
mmenke
2013/10/16 15:58:44
https://codereview.chromium.org/43115 - sounds lik
|
session_deps_.socket_factory->ResetNextMockIndexes(); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5571,9 +5573,9 @@ |
TestCompletionCallback callback; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5629,9 +5631,9 @@ |
TestCompletionCallback callback; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5714,9 +5716,9 @@ |
TestCompletionCallback callback; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5766,9 +5768,9 @@ |
TestCompletionCallback callback; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5827,9 +5829,9 @@ |
TestCompletionCallback callback; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -6252,9 +6254,9 @@ |
TestCompletionCallback callback; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -6281,9 +6283,9 @@ |
request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, |
"Chromium Ultra Awesome X Edition"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -6321,9 +6323,9 @@ |
"Chromium Ultra Awesome X Edition"); |
session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" |
@@ -6360,9 +6362,9 @@ |
request.extra_headers.SetHeader(HttpRequestHeaders::kReferer, |
"http://the.previous.site.com/"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -6397,9 +6399,9 @@ |
request.method = "POST"; |
request.url = GURL("http://www.google.com/"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("POST / HTTP/1.1\r\n" |
@@ -6434,9 +6436,9 @@ |
request.method = "PUT"; |
request.url = GURL("http://www.google.com/"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("PUT / HTTP/1.1\r\n" |
@@ -6471,9 +6473,9 @@ |
request.method = "HEAD"; |
request.url = GURL("http://www.google.com/"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("HEAD / HTTP/1.1\r\n" |
@@ -6509,9 +6511,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = LOAD_BYPASS_CACHE; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -6549,9 +6551,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = LOAD_VALIDATE_CACHE; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -6587,9 +6589,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.extra_headers.SetHeader("FooHeader", "Bar"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -6627,9 +6629,9 @@ |
request.extra_headers.SetHeader("hEllo", "Kitty"); |
request.extra_headers.SetHeader("FoO", "bar"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -6672,9 +6674,9 @@ |
CapturingNetLog net_log; |
session_deps_.net_log = &net_log; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
char write_buffer[] = { 0x04, 0x01, 0x00, 0x50, 127, 0, 0, 1, 0 }; |
char read_buffer[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; |
@@ -6731,9 +6733,9 @@ |
CapturingNetLog net_log; |
session_deps_.net_log = &net_log; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
unsigned char write_buffer[] = { 0x04, 0x01, 0x01, 0xBB, 127, 0, 0, 1, 0 }; |
unsigned char read_buffer[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; |
@@ -6795,9 +6797,9 @@ |
CapturingNetLog net_log; |
session_deps_.net_log = &net_log; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
char write_buffer[] = { 0x04, 0x01, 0x00, 0x50, 127, 0, 0, 1, 0 }; |
char read_buffer[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; |
@@ -6854,9 +6856,9 @@ |
CapturingNetLog net_log; |
session_deps_.net_log = &net_log; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
const char kSOCKS5GreetRequest[] = { 0x05, 0x01, 0x00 }; |
const char kSOCKS5GreetResponse[] = { 0x05, 0x00 }; |
@@ -6927,9 +6929,9 @@ |
CapturingNetLog net_log; |
session_deps_.net_log = &net_log; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
const char kSOCKS5GreetRequest[] = { 0x05, 0x01, 0x00 }; |
const char kSOCKS5GreetResponse[] = { 0x05, 0x00 }; |
@@ -7255,9 +7257,9 @@ |
// connecting to both proxies (myproxy:70 and foobar:80). |
session_deps_.host_resolver->rules()->AddSimulatedFailure("*"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
TestCompletionCallback callback; |
@@ -7281,8 +7283,9 @@ |
// Select a host resolver that does caching. |
session_deps_.host_resolver.reset(new MockCachingHostResolver); |
- scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
+ scoped_ptr<HttpTransaction> trans( |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
// Warm up the host cache so it has an entry for "www.google.com". |
AddressList addrlist; |
@@ -7363,8 +7366,7 @@ |
TestCompletionCallback callback; |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -7393,8 +7395,7 @@ |
TestCompletionCallback callback; |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -7518,9 +7519,9 @@ |
session_deps_.socket_factory->ResetNextMockIndexes(); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -7535,9 +7536,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead("HTTP/1.0 200 OK\r\nContent-Length:6719476739\r\n\r\n"), |
@@ -7587,9 +7588,9 @@ |
request.upload_data_stream = &upload_data_stream; |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead("HTTP/1.0 200 OK\r\n\r\n"), |
@@ -7646,9 +7647,9 @@ |
// If we try to upload an unreadable file, the network stack should report |
// the file size as zero and upload zero bytes for that file. |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead("HTTP/1.0 200 OK\r\n\r\n"), |
@@ -7704,9 +7705,9 @@ |
request.upload_data_stream = &upload_data_stream; |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockRead data_reads[] = { |
MockRead("HTTP/1.1 401 Unauthorized\r\n"), |
@@ -7808,9 +7809,9 @@ |
request.upload_data_stream = &upload_data_stream; |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
StaticSocketDataProvider data; |
session_deps_.socket_factory->AddSocketDataProvider(&data); |
@@ -7912,9 +7913,9 @@ |
TestCompletionCallback callback1; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
// Issue the first request with Authorize headers. There should be a |
// password prompt for first_realm waiting to be filled in after the |
@@ -9287,8 +9288,7 @@ |
request.load_flags = 0; |
scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
- HttpNetworkTransaction trans( |
- DEFAULT_PRIORITY, CreateSession(&session_deps_)); |
+ HttpNetworkTransaction trans(DEFAULT_PRIORITY, session); |
for (int round = 0; round < test_config.num_auth_rounds; ++round) { |
const TestRound& read_write_round = test_config.rounds[round]; |
@@ -9843,9 +9843,9 @@ |
request.load_flags = 0; |
session_deps_.host_resolver->set_synchronous_mode(true); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); |
data.set_connect_data(mock_connect); |
@@ -11525,9 +11525,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockConnect mock_connect(SYNCHRONOUS, ERR_CONNECTION_REFUSED); |
StaticSocketDataProvider data; |
@@ -11555,9 +11555,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); |
StaticSocketDataProvider data; |
@@ -11585,9 +11585,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite(SYNCHRONOUS, ERR_CONNECTION_RESET), |
@@ -11621,9 +11621,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite(ASYNC, ERR_CONNECTION_RESET), |
@@ -11657,9 +11657,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -11695,9 +11695,9 @@ |
request.url = GURL("http://www.google.com/"); |
request.load_flags = 0; |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |
@@ -11734,9 +11734,9 @@ |
request.load_flags = 0; |
request.extra_headers.SetHeader("X-Foo", "bar"); |
+ scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, |
- CreateSession(&session_deps_))); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
MockWrite data_writes[] = { |
MockWrite("GET / HTTP/1.1\r\n" |