diff options
Diffstat (limited to 'net')
32 files changed, 493 insertions, 408 deletions
diff --git a/net/base/host_resolver_impl_unittest.cc b/net/base/host_resolver_impl_unittest.cc index a17fb6a..bf69bff7 100644 --- a/net/base/host_resolver_impl_unittest.cc +++ b/net/base/host_resolver_impl_unittest.cc @@ -170,7 +170,8 @@ class ResolveRequest { ALLOW_THIS_IN_INITIALIZER_LIST( callback_(this, &ResolveRequest::OnLookupFinished)) { // Start the request. - int err = resolver->Resolve(info_, &addrlist_, &callback_, &req_, NULL); + int err = resolver->Resolve(info_, &addrlist_, &callback_, &req_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, err); } @@ -181,7 +182,8 @@ class ResolveRequest { ALLOW_THIS_IN_INITIALIZER_LIST( callback_(this, &ResolveRequest::OnLookupFinished)) { // Start the request. - int err = resolver->Resolve(info, &addrlist_, &callback_, &req_, NULL); + int err = resolver->Resolve(info, &addrlist_, &callback_, &req_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, err); } @@ -374,7 +376,7 @@ TEST_F(HostResolverImplTest, NumericIPv4Address) { AddressList adrlist; const int kPortnum = 5555; HostResolver::RequestInfo info("127.1.2.3", kPortnum); - int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, BoundNetLog()); EXPECT_EQ(OK, err); const struct addrinfo* ainfo = adrlist.head(); @@ -399,7 +401,7 @@ TEST_F(HostResolverImplTest, NumericIPv6Address) { AddressList adrlist; const int kPortnum = 5555; HostResolver::RequestInfo info("2001:db8::1", kPortnum); - int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, BoundNetLog()); // On computers without IPv6 support, getaddrinfo cannot convert IPv6 // address literals to addresses (getaddrinfo returns EAI_NONAME). So this // test has to allow host_resolver->Resolve to fail. @@ -434,7 +436,7 @@ TEST_F(HostResolverImplTest, EmptyHost) { AddressList adrlist; const int kPortnum = 5555; HostResolver::RequestInfo info("", kPortnum); - int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, BoundNetLog()); EXPECT_EQ(ERR_NAME_NOT_RESOLVED, err); } @@ -786,7 +788,8 @@ class BypassCacheVerifier : public ResolveRequest::Delegate { AddressList addrlist; HostResolver::RequestInfo info("a", 70); - int error = resolver->Resolve(info, &addrlist, junk_callback, NULL, NULL); + int error = resolver->Resolve(info, &addrlist, junk_callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, error); // Ok good. Now make sure that if we ask to bypass the cache, it can no @@ -933,7 +936,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host1" again -- this time it will be served from cache, but it // should still notify of completion. TestCompletionCallback callback; - rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, NULL); + rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, BoundNetLog()); ASSERT_EQ(OK, rv); // Should complete synchronously. EXPECT_EQ(2U, observer.start_log.size()); @@ -947,7 +950,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host2", setting referrer to "http://foobar.com" HostResolver::RequestInfo info2("host2", 70); info2.set_referrer(GURL("http://foobar.com")); - rv = host_resolver->Resolve(info2, &addrlist, NULL, NULL, NULL); + rv = host_resolver->Resolve(info2, &addrlist, NULL, NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ(3U, observer.start_log.size()); @@ -963,7 +966,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host3" HostResolver::RequestInfo info3("host3", 70); - host_resolver->Resolve(info3, &addrlist, NULL, NULL, NULL); + host_resolver->Resolve(info3, &addrlist, NULL, NULL, BoundNetLog()); // No effect this time, since observer was removed. EXPECT_EQ(3U, observer.start_log.size()); @@ -993,7 +996,8 @@ TEST_F(HostResolverImplTest, CancellationObserver) { HostResolver::RequestInfo info1("host1", 70); HostResolver::RequestHandle req = NULL; AddressList addrlist; - int rv = host_resolver->Resolve(info1, &addrlist, &callback, &req, NULL); + int rv = host_resolver->Resolve(info1, &addrlist, &callback, &req, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_TRUE(NULL != req); @@ -1016,7 +1020,8 @@ TEST_F(HostResolverImplTest, CancellationObserver) { // Start an async request for (host2:60) HostResolver::RequestInfo info2("host2", 60); - rv = host_resolver->Resolve(info2, &addrlist, &callback, NULL, NULL); + rv = host_resolver->Resolve(info2, &addrlist, &callback, NULL, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_TRUE(NULL != req); @@ -1056,13 +1061,14 @@ TEST_F(HostResolverImplTest, FlushCacheOnIPAddressChange) { // Resolve "host1". HostResolver::RequestInfo info1("host1", 70); TestCompletionCallback callback; - int rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, NULL); + int rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); // Resolve "host1" again -- this time it will be served from cache, but it // should still notify of completion. - rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, NULL); + rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, BoundNetLog()); ASSERT_EQ(OK, rv); // Should complete synchronously. // Flush cache by triggering an IP address change. @@ -1070,7 +1076,7 @@ TEST_F(HostResolverImplTest, FlushCacheOnIPAddressChange) { // Resolve "host1" again -- this time it won't be served from cache, so it // will complete asynchronously. - rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, NULL); + rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, BoundNetLog()); ASSERT_EQ(ERR_IO_PENDING, rv); // Should complete asynchronously. EXPECT_EQ(OK, callback.WaitForResult()); } @@ -1110,7 +1116,7 @@ TEST_F(HostResolverImplTest, HigherPriorityRequestsStartedFirst) { // Start all of the requests. for (size_t i = 0; i < arraysize(req); ++i) { int rv = host_resolver->Resolve(req[i], &addrlist[i], - &callback[i], NULL, NULL); + &callback[i], NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); } @@ -1192,7 +1198,7 @@ TEST_F(HostResolverImplTest, CancelPendingRequest) { // Start all of the requests. for (size_t i = 0; i < arraysize(req); ++i) { int rv = host_resolver->Resolve(req[i], &addrlist[i], - &callback[i], &handle[i], NULL); + &callback[i], &handle[i], BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); } @@ -1267,7 +1273,7 @@ TEST_F(HostResolverImplTest, QueueOverflow) { // Start all of the requests. for (size_t i = 0; i < arraysize(req); ++i) { int rv = host_resolver->Resolve(req[i], &addrlist[i], - &callback[i], &handle[i], NULL); + &callback[i], &handle[i], BoundNetLog()); if (i == 4u) EXPECT_EQ(ERR_HOST_RESOLVER_QUEUE_TOO_LARGE, rv); else @@ -1333,7 +1339,7 @@ TEST_F(HostResolverImplTest, SetDefaultAddressFamily_IPv4) { // Start all of the requests. for (size_t i = 0; i < arraysize(req); ++i) { int rv = host_resolver->Resolve(req[i], &addrlist[i], - &callback[i], &handle[i], NULL); + &callback[i], &handle[i], BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv) << i; } @@ -1402,7 +1408,7 @@ TEST_F(HostResolverImplTest, SetDefaultAddressFamily_IPv6) { // Start all of the requests. for (size_t i = 0; i < arraysize(req); ++i) { int rv = host_resolver->Resolve(req[i], &addrlist[i], - &callback[i], &handle[i], NULL); + &callback[i], &handle[i], BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv) << i; } @@ -1468,7 +1474,7 @@ TEST_F(HostResolverImplTest, SetDefaultAddressFamily_Synchronous) { // Start and run all of the requests synchronously. for (size_t i = 0; i < arraysize(req); ++i) { int rv = host_resolver->Resolve(req[i], &addrlist[i], - NULL, NULL, NULL); + NULL, NULL, BoundNetLog()); EXPECT_EQ(OK, rv) << i; } diff --git a/net/base/net_log.h b/net/base/net_log.h index 6bef13c..ba271c5 100644 --- a/net/base/net_log.h +++ b/net/base/net_log.h @@ -137,11 +137,6 @@ class BoundNetLog { public: BoundNetLog() : net_log_(NULL) {} - // TODO(eroman): This is a complete hack to allow passing in NULL in - // place of a BoundNetLog. I added this while refactoring to simplify the - // task of updating all the callers. - BoundNetLog(uint32) : net_log_(NULL) {} - BoundNetLog(const NetLog::Source& source, NetLog* net_log) : source_(source), net_log_(net_log) { } diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc index 33145a5..6e814aa 100644 --- a/net/ftp/ftp_network_transaction_unittest.cc +++ b/net/ftp/ftp_network_transaction_unittest.cc @@ -715,7 +715,7 @@ class FtpNetworkTransactionTest : public PlatformTest { FtpRequestInfo request_info = GetRequestInfo(request); EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState()); ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(&request_info, &callback_, NULL)); + transaction_.Start(&request_info, &callback_, BoundNetLog())); EXPECT_NE(LOAD_STATE_IDLE, transaction_.GetLoadState()); ASSERT_EQ(expected_result, callback_.WaitForResult()); if (expected_result == OK) { @@ -761,7 +761,7 @@ TEST_F(FtpNetworkTransactionTest, FailedLookup) { host_resolver_->rules()->AddSimulatedFailure("badhost"); EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState()); ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(&request_info, &callback_, NULL)); + transaction_.Start(&request_info, &callback_, BoundNetLog())); ASSERT_EQ(ERR_NAME_NOT_RESOLVED, callback_.WaitForResult()); EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState()); } @@ -962,7 +962,7 @@ TEST_F(FtpNetworkTransactionTest, DownloadTransactionEvilPasvUnsafeHost) { // Start the transaction. ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(&request_info, &callback_, NULL)); + transaction_.Start(&request_info, &callback_, BoundNetLog())); ASSERT_EQ(OK, callback_.WaitForResult()); // The transaction fires the callback when we can start reading data. That @@ -1085,7 +1085,7 @@ TEST_F(FtpNetworkTransactionTest, EvilRestartUser) { FtpRequestInfo request_info = GetRequestInfo("ftp://host/file"); ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(&request_info, &callback_, NULL)); + transaction_.Start(&request_info, &callback_, BoundNetLog())); ASSERT_EQ(ERR_FAILED, callback_.WaitForResult()); MockRead ctrl_reads[] = { @@ -1115,7 +1115,7 @@ TEST_F(FtpNetworkTransactionTest, EvilRestartPassword) { FtpRequestInfo request_info = GetRequestInfo("ftp://host/file"); ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(&request_info, &callback_, NULL)); + transaction_.Start(&request_info, &callback_, BoundNetLog())); ASSERT_EQ(ERR_FAILED, callback_.WaitForResult()); MockRead ctrl_reads[] = { diff --git a/net/http/http_auth_handler_negotiate_unittest.cc b/net/http/http_auth_handler_negotiate_unittest.cc index 6ed882f..ffb7ba4 100644 --- a/net/http/http_auth_handler_negotiate_unittest.cc +++ b/net/http/http_auth_handler_negotiate_unittest.cc @@ -70,7 +70,7 @@ TEST(HttpAuthHandlerNegotiateTest, CnameSync) { "canonical.example.com"); TestCompletionCallback callback; EXPECT_EQ(OK, auth_handler->ResolveCanonicalName(mock_resolver, &callback, - NULL)); + BoundNetLog())); EXPECT_EQ(L"HTTP/canonical.example.com", auth_handler->spn()); } @@ -87,7 +87,7 @@ TEST(HttpAuthHandlerNegotiateTest, CnameAsync) { TestCompletionCallback callback; EXPECT_EQ(ERR_IO_PENDING, auth_handler->ResolveCanonicalName(mock_resolver, &callback, - NULL)); + BoundNetLog())); EXPECT_EQ(OK, callback.WaitForResult()); EXPECT_EQ(L"HTTP/canonical.example.com", auth_handler->spn()); } diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 3a816f7..2cb4fa1 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -163,7 +163,7 @@ void HttpCache::MetadataWriter::Write(const GURL& url, buf_len_ = buf_len; verified_ = false; - int rv = transaction_->Start(&request_info_, &callback_, NULL); + int rv = transaction_->Start(&request_info_, &callback_, BoundNetLog()); if (rv != ERR_IO_PENDING) VerifyResponse(rv); } diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index 48e61e7..346927d 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -617,7 +617,7 @@ void RunTransactionTestWithRequest(net::HttpCache* cache, const MockHttpRequest& request, net::HttpResponseInfo* response_info) { RunTransactionTestWithRequestAndLog(cache, trans_info, request, - response_info, NULL); + response_info, net::BoundNetLog()); } void RunTransactionTestWithLog(net::HttpCache* cache, @@ -629,7 +629,7 @@ void RunTransactionTestWithLog(net::HttpCache* cache, void RunTransactionTest(net::HttpCache* cache, const MockTransaction& trans_info) { - RunTransactionTestWithLog(cache, trans_info, NULL); + RunTransactionTestWithLog(cache, trans_info, net::BoundNetLog()); } void RunTransactionTestWithResponseInfo(net::HttpCache* cache, @@ -958,7 +958,7 @@ TEST(HttpCache, SimpleGETWithDiskFailures2) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); EXPECT_EQ(net::ERR_IO_PENDING, rv); rv = c->callback.WaitForResult(); @@ -1053,7 +1053,7 @@ TEST(HttpCache, SimpleGET_LoadOnlyFromCache_Miss) { EXPECT_EQ(net::OK, rv); ASSERT_TRUE(trans.get()); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::ERR_CACHE_MISS, rv); @@ -1268,7 +1268,7 @@ TEST(HttpCache, SimpleGET_ManyReaders) { c->result = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, c->result); - c->result = c->trans->Start(&request, &c->callback, NULL); + c->result = c->trans->Start(&request, &c->callback, net::BoundNetLog()); } // Allow all requests to move from the Create queue to the active entry. @@ -1325,7 +1325,7 @@ TEST(HttpCache, SimpleGET_RacingReaders) { if (i == 1 || i == 2) this_request = &reader_request; - c->result = c->trans->Start(this_request, &c->callback, NULL); + c->result = c->trans->Start(this_request, &c->callback, net::BoundNetLog()); } // Allow all requests to move from the Create queue to the active entry. @@ -1406,7 +1406,7 @@ TEST(HttpCache, SimpleGET_DoomWithPending) { if (i == 3) this_request = &writer_request; - c->result = c->trans->Start(this_request, &c->callback, NULL); + c->result = c->trans->Start(this_request, &c->callback, net::BoundNetLog()); } // The first request should be a writer at this point, and the two subsequent @@ -1449,7 +1449,7 @@ TEST(HttpCache, FastNoStoreGET_DoneWithPending) { c->result = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, c->result); - c->result = c->trans->Start(&request, &c->callback, NULL); + c->result = c->trans->Start(&request, &c->callback, net::BoundNetLog()); } // Allow all requests to move from the Create queue to the active entry. @@ -1495,7 +1495,7 @@ TEST(HttpCache, SimpleGET_ManyWriters_CancelFirst) { c->result = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, c->result); - c->result = c->trans->Start(&request, &c->callback, NULL); + c->result = c->trans->Start(&request, &c->callback, net::BoundNetLog()); } // Allow all requests to move from the Create queue to the active entry. @@ -1554,7 +1554,7 @@ TEST(HttpCache, SimpleGET_ManyWriters_CancelCreate) { c->result = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, c->result); - c->result = c->trans->Start(&request, &c->callback, NULL); + c->result = c->trans->Start(&request, &c->callback, net::BoundNetLog()); } // The first request should be creating the disk cache entry and the others @@ -1610,7 +1610,7 @@ TEST(HttpCache, SimpleGET_ManyWriters_BypassCache) { c->result = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, c->result); - c->result = c->trans->Start(&request, &c->callback, NULL); + c->result = c->trans->Start(&request, &c->callback, net::BoundNetLog()); } // The first request should be deleting the disk cache entry and the others @@ -1650,7 +1650,7 @@ TEST(HttpCache, SimpleGET_AbandonedCacheRead) { scoped_ptr<net::HttpTransaction> trans; int rv = cache.http_cache()->CreateTransaction(&trans); EXPECT_EQ(net::OK, rv); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -2281,7 +2281,7 @@ TEST(HttpCache, SimplePOST_LoadOnlyFromCache_Miss) { EXPECT_EQ(net::OK, rv); ASSERT_TRUE(trans.get()); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::ERR_CACHE_MISS, rv); @@ -3025,7 +3025,7 @@ TEST(HttpCache, RangeGET_Cancel) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); @@ -3065,7 +3065,7 @@ TEST(HttpCache, RangeGET_Cancel2) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); @@ -3110,7 +3110,7 @@ TEST(HttpCache, RangeGET_Cancel3) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); EXPECT_EQ(net::ERR_IO_PENDING, rv); rv = c->callback.WaitForResult(); @@ -3137,7 +3137,7 @@ TEST(HttpCache, RangeGET_Cancel3) { rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); EXPECT_EQ(net::ERR_IO_PENDING, rv); MockDiskEntry::IgnoreCallbacks(true); @@ -3476,7 +3476,7 @@ TEST(HttpCache, DoomOnDestruction) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) c->result = c->callback.WaitForResult(); @@ -3507,7 +3507,7 @@ TEST(HttpCache, DoomOnDestruction2) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); @@ -3551,7 +3551,7 @@ TEST(HttpCache, DoomOnDestruction3) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); @@ -3595,7 +3595,7 @@ TEST(HttpCache, Set_Truncated_Flag) { int rv = cache.http_cache()->CreateTransaction(&c->trans); EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, &c->callback, NULL); + rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); @@ -3801,7 +3801,7 @@ TEST(HttpCache, GET_CancelIncompleteResource) { Context* c = new Context(); EXPECT_EQ(net::OK, cache.http_cache()->CreateTransaction(&c->trans)); - int rv = c->trans->Start(&request, &c->callback, NULL); + int rv = c->trans->Start(&request, &c->callback, net::BoundNetLog()); EXPECT_EQ(net::OK, c->callback.GetResult(rv)); // Read 20 bytes from the cache, and 10 from the net. @@ -3892,13 +3892,13 @@ TEST(HttpCache, SyncRead) { c2(cache.http_cache()), c3(cache.http_cache()); - c1.Start(&r1, NULL); + c1.Start(&r1, net::BoundNetLog()); r2.load_flags |= net::LOAD_ONLY_FROM_CACHE; - c2.Start(&r2, NULL); + c2.Start(&r2, net::BoundNetLog()); r3.load_flags |= net::LOAD_ONLY_FROM_CACHE; - c3.Start(&r3, NULL); + c3.Start(&r3, net::BoundNetLog()); MessageLoop::current()->Run(); @@ -3946,7 +3946,7 @@ TEST(HttpCache, CachedRedirect) { EXPECT_EQ(net::OK, rv); ASSERT_TRUE(trans.get()); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -3974,7 +3974,7 @@ TEST(HttpCache, CachedRedirect) { EXPECT_EQ(net::OK, rv); ASSERT_TRUE(trans.get()); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -4102,7 +4102,7 @@ TEST(HttpCache, SimpleGET_SSLError) { EXPECT_EQ(net::OK, rv); ASSERT_TRUE(trans.get()); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::ERR_CACHE_MISS, rv); diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 4742122..6058d8f 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -121,7 +121,7 @@ class HttpNetworkTransactionTest : public PlatformTest { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -412,7 +412,7 @@ TEST_F(HttpNetworkTransactionTest, Head) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -469,7 +469,7 @@ TEST_F(HttpNetworkTransactionTest, ReuseConnection) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -511,7 +511,7 @@ TEST_F(HttpNetworkTransactionTest, Ignores100) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -553,7 +553,7 @@ TEST_F(HttpNetworkTransactionTest, Ignores1xx) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -590,7 +590,7 @@ TEST_F(HttpNetworkTransactionTest, Incomplete100ThenEOF) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -620,7 +620,7 @@ TEST_F(HttpNetworkTransactionTest, EmptyResponse) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -664,7 +664,7 @@ void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest( scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -714,7 +714,7 @@ TEST_F(HttpNetworkTransactionTest, NonKeepAliveConnectionReset) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -802,7 +802,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuth) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -862,7 +862,7 @@ TEST_F(HttpNetworkTransactionTest, DoNotSendAuth) { session_deps.socket_factory.AddSocketDataProvider(&data); TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -918,7 +918,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -991,7 +991,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1072,7 +1072,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1163,7 +1163,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1246,7 +1246,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1328,7 +1328,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -1381,7 +1381,7 @@ void HttpNetworkTransactionTest::ConnectStatusHelperWithExpectedStatus( TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -1643,7 +1643,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1782,7 +1782,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth1) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1957,7 +1957,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2051,7 +2051,7 @@ TEST_F(HttpNetworkTransactionTest, LargeHeadersNoBody) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2099,7 +2099,7 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2148,7 +2148,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocket) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2205,7 +2205,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2301,7 +2301,7 @@ TEST_F(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) { TestCompletionCallback callback; - int rv = trans->Start(&request[i], &callback, NULL); + int rv = trans->Start(&request[i], &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2376,7 +2376,7 @@ TEST_F(HttpNetworkTransactionTest, AuthIdentityInURL) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2474,7 +2474,7 @@ TEST_F(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2567,7 +2567,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2652,7 +2652,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2717,7 +2717,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2779,7 +2779,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2868,7 +2868,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2988,7 +2988,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificate) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3065,7 +3065,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3116,7 +3116,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_UserAgent) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3155,7 +3155,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_Referer) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3192,7 +3192,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_PostContentLengthZero) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3229,7 +3229,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_PutContentLengthZero) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3266,7 +3266,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_HeadContentLengthZero) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3305,7 +3305,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_CacheControlNoCache) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3344,7 +3344,7 @@ TEST_F(HttpNetworkTransactionTest, TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3382,7 +3382,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3423,7 +3423,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_ExtraHeadersStripped) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3466,7 +3466,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3522,7 +3522,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3587,7 +3587,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3657,7 +3657,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3768,7 +3768,7 @@ TEST_F(HttpNetworkTransactionTest, GroupNameForProxyConnections) { TestCompletionCallback callback; // We do not complete this request, the dtor will clean the transaction up. - EXPECT_EQ(ERR_IO_PENDING, trans->Start(&request, &callback, NULL)); + EXPECT_EQ(ERR_IO_PENDING, trans->Start(&request, &callback, BoundNetLog())); std::string allgroups = tcp_conn_pool->last_group_name_received() + socks_conn_pool->last_group_name_received(); EXPECT_EQ(tests[i].expected_group_name, allgroups); @@ -3794,7 +3794,7 @@ TEST_F(HttpNetworkTransactionTest, ReconsiderProxyAfterFailedConnection) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3870,7 +3870,7 @@ TEST_F(HttpNetworkTransactionTest, ResolveMadeWithReferrer) { // Run the request until it fails reading from the socket. TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); EXPECT_EQ(ERR_FAILED, rv); @@ -3895,7 +3895,7 @@ TEST_F(HttpNetworkTransactionTest, BypassHostCacheOnRefresh) { AddressList addrlist; int rv = session_deps.host_resolver->Resolve( HostResolver::RequestInfo("www.google.com", 80), &addrlist, - NULL, NULL, NULL); + NULL, NULL, BoundNetLog()); EXPECT_EQ(OK, rv); // Verify that it was added to host cache, by doing a subsequent async lookup @@ -3903,7 +3903,7 @@ TEST_F(HttpNetworkTransactionTest, BypassHostCacheOnRefresh) { TestCompletionCallback resolve_callback; rv = session_deps.host_resolver->Resolve( HostResolver::RequestInfo("www.google.com", 80), &addrlist, - &resolve_callback, NULL, NULL); + &resolve_callback, NULL, BoundNetLog()); ASSERT_EQ(OK, rv); // Inject a failure the next time that "www.google.com" is resolved. This way @@ -3925,7 +3925,7 @@ TEST_F(HttpNetworkTransactionTest, BypassHostCacheOnRefresh) { // Run the request. TestCompletionCallback callback; - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, BoundNetLog()); ASSERT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3956,7 +3956,7 @@ TEST_F(HttpNetworkTransactionTest, RequestWriteError) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3986,7 +3986,7 @@ TEST_F(HttpNetworkTransactionTest, ConnectionClosedAfterStartOfHeaders) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -4058,7 +4058,7 @@ TEST_F(HttpNetworkTransactionTest, DrainResetOK) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -4115,7 +4115,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSViaProxyWithExtraData) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -4142,7 +4142,7 @@ TEST_F(HttpNetworkTransactionTest, LargeContentLengthThenClose) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -4191,7 +4191,7 @@ TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -4254,7 +4254,7 @@ TEST_F(HttpNetworkTransactionTest, UploadUnreadableFile) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -4322,7 +4322,7 @@ TEST_F(HttpNetworkTransactionTest, UnreadableUploadFileAfterAuthRestart) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -4448,7 +4448,7 @@ TEST_F(HttpNetworkTransactionTest, ChangeAuthRealms) { // Issue the first request with Authorize headers. There should be a // password prompt for first_realm waiting to be filled in after the // transaction completes. - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); @@ -4528,7 +4528,7 @@ TEST_F(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); HostPortPair http_host_port_pair; @@ -4605,7 +4605,7 @@ TEST_F(HttpNetworkTransactionTest, MarkBrokenAlternateProtocol) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -4665,7 +4665,7 @@ TEST_F(HttpNetworkTransactionTest, MarkBrokenAlternateProtocol) { // // scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // -// int rv = trans->Start(&request, &callback, NULL); +// int rv = trans->Start(&request, &callback, BoundNetLog()); // EXPECT_EQ(ERR_IO_PENDING, rv); // EXPECT_EQ(OK, callback.WaitForResult()); // @@ -4720,7 +4720,7 @@ TEST_F(HttpNetworkTransactionTest, FailNpnSpdyAndFallback) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -4788,7 +4788,7 @@ TEST_F(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -4803,7 +4803,7 @@ TEST_F(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { trans.reset(new HttpNetworkTransaction(session)); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -4873,7 +4873,7 @@ TEST_F(HttpNetworkTransactionTest, scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -4896,7 +4896,7 @@ TEST_F(HttpNetworkTransactionTest, trans.reset(new HttpNetworkTransaction(session)); - rv = trans->Start(&request, &callback, NULL); + rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -5088,7 +5088,7 @@ TEST_F(HttpNetworkTransactionTest, ResolveCanonicalName) { TestCompletionCallback callback1; - int rv = trans->Start(&request, &callback1, NULL); + int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -5161,7 +5161,7 @@ TEST_F(HttpNetworkTransactionTest, RestartAfterTLSDecompressionFailure) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -5203,7 +5203,7 @@ TEST_F(HttpNetworkTransactionTest, scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); diff --git a/net/proxy/init_proxy_resolver.cc b/net/proxy/init_proxy_resolver.cc index 2c27dcb..ea1e475 100644 --- a/net/proxy/init_proxy_resolver.cc +++ b/net/proxy/init_proxy_resolver.cc @@ -17,14 +17,17 @@ namespace net { InitProxyResolver::InitProxyResolver(ProxyResolver* resolver, - ProxyScriptFetcher* proxy_script_fetcher) + ProxyScriptFetcher* proxy_script_fetcher, + NetLog* net_log) : resolver_(resolver), proxy_script_fetcher_(proxy_script_fetcher), ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_( this, &InitProxyResolver::OnIOCompletion)), user_callback_(NULL), current_pac_url_index_(0u), - next_state_(STATE_NONE) { + next_state_(STATE_NONE), + net_log_(BoundNetLog::Make( + net_log, NetLog::SOURCE_INIT_PROXY_RESOLVER)) { } InitProxyResolver::~InitProxyResolver() { @@ -33,14 +36,10 @@ InitProxyResolver::~InitProxyResolver() { } int InitProxyResolver::Init(const ProxyConfig& config, - CompletionCallback* callback, - const BoundNetLog& net_log) { + CompletionCallback* callback) { DCHECK_EQ(STATE_NONE, next_state_); DCHECK(callback); DCHECK(config.MayRequirePACResolver()); - DCHECK(!net_log_.net_log()); - - net_log_ = net_log; net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER, NULL); diff --git a/net/proxy/init_proxy_resolver.h b/net/proxy/init_proxy_resolver.h index 031fef3..e8d4ab2 100644 --- a/net/proxy/init_proxy_resolver.h +++ b/net/proxy/init_proxy_resolver.h @@ -14,7 +14,6 @@ namespace net { -class BoundNetLog; class ProxyConfig; class ProxyResolver; class ProxyScriptFetcher; @@ -37,18 +36,18 @@ class ProxyScriptFetcher; // class InitProxyResolver { public: - // |resolver| and |proxy_script_fetcher| must remain valid for + // |resolver|, |proxy_script_fetcher| and |net_log| must remain valid for // the lifespan of InitProxyResolver. InitProxyResolver(ProxyResolver* resolver, - ProxyScriptFetcher* proxy_script_fetcher); + ProxyScriptFetcher* proxy_script_fetcher, + NetLog* net_log); // Aborts any in-progress request. ~InitProxyResolver(); // Apply the PAC settings of |config| to |resolver_|. int Init(const ProxyConfig& config, - CompletionCallback* callback, - const BoundNetLog& net_log); + CompletionCallback* callback); private: enum State { diff --git a/net/proxy/init_proxy_resolver_unittest.cc b/net/proxy/init_proxy_resolver_unittest.cc index 234e5b0..6610d4c 100644 --- a/net/proxy/init_proxy_resolver_unittest.cc +++ b/net/proxy/init_proxy_resolver_unittest.cc @@ -171,9 +171,9 @@ TEST(InitProxyResolverTest, CustomPacSucceeds) { Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingBoundNetLog log(CapturingNetLog::kUnbounded); - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(OK, init.Init(config, &callback, log.bound())); + CapturingNetLog log(CapturingNetLog::kUnbounded); + InitProxyResolver init(&resolver, &fetcher, &log); + EXPECT_EQ(OK, init.Init(config, &callback)); EXPECT_EQ(rule.bytes(), resolver.pac_bytes()); // Check the NetLog was filled correctly. @@ -204,9 +204,9 @@ TEST(InitProxyResolverTest, CustomPacFails1) { rules.AddFailDownloadRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingBoundNetLog log(CapturingNetLog::kUnbounded); - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(kFailedDownloading, init.Init(config, &callback, log.bound())); + CapturingNetLog log(CapturingNetLog::kUnbounded); + InitProxyResolver init(&resolver, &fetcher, &log); + EXPECT_EQ(kFailedDownloading, init.Init(config, &callback)); EXPECT_EQ("", resolver.pac_bytes()); // Check the NetLog was filled correctly. @@ -233,8 +233,8 @@ TEST(InitProxyResolverTest, CustomPacFails2) { rules.AddFailParsingRule("http://custom/proxy.pac"); TestCompletionCallback callback; - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(kFailedParsing, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, &fetcher, NULL); + EXPECT_EQ(kFailedParsing, init.Init(config, &callback)); EXPECT_EQ("", resolver.pac_bytes()); } @@ -247,8 +247,8 @@ TEST(InitProxyResolverTest, HasNullProxyScriptFetcher) { config.set_pac_url(GURL("http://custom/proxy.pac")); TestCompletionCallback callback; - InitProxyResolver init(&resolver, NULL); - EXPECT_EQ(ERR_UNEXPECTED, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, NULL, NULL); + EXPECT_EQ(ERR_UNEXPECTED, init.Init(config, &callback)); EXPECT_EQ("", resolver.pac_bytes()); } @@ -264,8 +264,8 @@ TEST(InitProxyResolverTest, AutodetectSuccess) { Rules::Rule rule = rules.AddSuccessRule("http://wpad/wpad.dat"); TestCompletionCallback callback; - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(OK, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, &fetcher, NULL); + EXPECT_EQ(OK, init.Init(config, &callback)); EXPECT_EQ(rule.bytes(), resolver.pac_bytes()); } @@ -283,8 +283,8 @@ TEST(InitProxyResolverTest, AutodetectFailCustomSuccess1) { Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac"); TestCompletionCallback callback; - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(OK, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, &fetcher, NULL); + EXPECT_EQ(OK, init.Init(config, &callback)); EXPECT_EQ(rule.bytes(), resolver.pac_bytes()); } @@ -302,9 +302,9 @@ TEST(InitProxyResolverTest, AutodetectFailCustomSuccess2) { Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingBoundNetLog log(CapturingNetLog::kUnbounded); - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(OK, init.Init(config, &callback, log.bound())); + CapturingNetLog log(CapturingNetLog::kUnbounded); + InitProxyResolver init(&resolver, &fetcher, &log); + EXPECT_EQ(OK, init.Init(config, &callback)); EXPECT_EQ(rule.bytes(), resolver.pac_bytes()); // Check the NetLog was filled correctly. @@ -351,8 +351,8 @@ TEST(InitProxyResolverTest, AutodetectFailCustomFails1) { rules.AddFailDownloadRule("http://custom/proxy.pac"); TestCompletionCallback callback; - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(kFailedDownloading, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, &fetcher, NULL); + EXPECT_EQ(kFailedDownloading, init.Init(config, &callback)); EXPECT_EQ("", resolver.pac_bytes()); } @@ -370,8 +370,8 @@ TEST(InitProxyResolverTest, AutodetectFailCustomFails2) { rules.AddFailParsingRule("http://custom/proxy.pac"); TestCompletionCallback callback; - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(kFailedParsing, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, &fetcher, NULL); + EXPECT_EQ(kFailedParsing, init.Init(config, &callback)); EXPECT_EQ("", resolver.pac_bytes()); } @@ -391,8 +391,8 @@ TEST(InitProxyResolverTest, AutodetectFailCustomSuccess2_NoFetch) { Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac"); TestCompletionCallback callback; - InitProxyResolver init(&resolver, &fetcher); - EXPECT_EQ(OK, init.Init(config, &callback, NULL)); + InitProxyResolver init(&resolver, &fetcher, NULL); + EXPECT_EQ(OK, init.Init(config, &callback)); EXPECT_EQ(rule.url, resolver.pac_url()); } diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc index 7650be4..c093506 100644 --- a/net/proxy/proxy_resolver_perftest.cc +++ b/net/proxy/proxy_resolver_perftest.cc @@ -109,7 +109,8 @@ class PacPerfSuiteRunner { { net::ProxyInfo proxy_info; int result = resolver_->GetProxyForURL( - GURL("http://www.warmup.com"), &proxy_info, NULL, NULL, NULL); + GURL("http://www.warmup.com"), &proxy_info, NULL, NULL, + net::BoundNetLog()); ASSERT_EQ(net::OK, result); } @@ -124,7 +125,8 @@ class PacPerfSuiteRunner { // Resolve. net::ProxyInfo proxy_info; int result = resolver_->GetProxyForURL(GURL(query.query_url), - &proxy_info, NULL, NULL, NULL); + &proxy_info, NULL, NULL, + net::BoundNetLog()); // Check that the result was correct. Note that ToPacString() and // ASSERT_EQ() are fast, so they won't skew the results. diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc index 17916e6..3fb01c2b 100644 --- a/net/proxy/proxy_resolver_v8.cc +++ b/net/proxy/proxy_resolver_v8.cc @@ -102,7 +102,7 @@ bool V8ObjectToString(v8::Handle<v8::Value> object, std::string* result) { class ProxyResolverV8::Context { public: explicit Context(ProxyResolverJSBindings* js_bindings) - : js_bindings_(js_bindings), current_request_net_log_(NULL) { + : js_bindings_(js_bindings) { DCHECK(js_bindings != NULL); } diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc index b124c66..e46b1cb 100644 --- a/net/proxy/proxy_resolver_v8_unittest.cc +++ b/net/proxy/proxy_resolver_v8_unittest.cc @@ -138,7 +138,8 @@ TEST(ProxyResolverV8Test, ReturnEmptyString) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_TRUE(proxy_info.is_direct()); @@ -158,7 +159,7 @@ TEST(ProxyResolverV8Test, Basic) { { ProxyInfo proxy_info; result = resolver.GetProxyForURL(GURL("http://query.com/path"), - &proxy_info, NULL, NULL, NULL); + &proxy_info, NULL, NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ("http.query.com.path.query.com:80", proxy_info.proxy_server().ToURI()); @@ -166,7 +167,8 @@ TEST(ProxyResolverV8Test, Basic) { { ProxyInfo proxy_info; int result = resolver.GetProxyForURL(GURL("ftp://query.com:90/path"), - &proxy_info, NULL, NULL, NULL); + &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); // Note that FindProxyForURL(url, host) does not expect |host| to contain // the port number. @@ -204,7 +206,8 @@ TEST(ProxyResolverV8Test, BadReturnType) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); @@ -224,7 +227,8 @@ TEST(ProxyResolverV8Test, NoEntryPoint) { EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); } @@ -236,7 +240,8 @@ TEST(ProxyResolverV8Test, ParseError) { EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); @@ -259,7 +264,8 @@ TEST(ProxyResolverV8Test, SideEffects) { // The PAC script increments a counter each time we invoke it. for (int i = 0; i < 3; ++i) { ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ(StringPrintf("sideffect_%d:80", i), proxy_info.proxy_server().ToURI()); @@ -272,7 +278,8 @@ TEST(ProxyResolverV8Test, SideEffects) { for (int i = 0; i < 3; ++i) { ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ(StringPrintf("sideffect_%d:80", i), proxy_info.proxy_server().ToURI()); @@ -286,7 +293,8 @@ TEST(ProxyResolverV8Test, UnhandledException) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); @@ -306,7 +314,8 @@ TEST(ProxyResolverV8Test, DISABLED_ReturnUnicode) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); // The result from this resolve was unparseable, because it // wasn't ascii. @@ -320,7 +329,8 @@ TEST(ProxyResolverV8Test, JavascriptLibrary) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); // If the javascript side of this unit-test fails, it will throw a javascript // exception. Otherwise it will return "PROXY success:80". @@ -338,7 +348,8 @@ TEST(ProxyResolverV8Test, NoSetPacScript) { ProxyInfo proxy_info; // Resolve should fail, as we are not yet initialized with a script. - int result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + int result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); // Initialize it. @@ -346,20 +357,23 @@ TEST(ProxyResolverV8Test, NoSetPacScript) { EXPECT_EQ(OK, result); // Resolve should now succeed. - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); // Clear it, by initializing with an empty string. resolver.SetPacScriptByData(std::string(), NULL); // Resolve should fail again now. - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); // Load a good script once more. result = resolver.SetPacScriptFromDisk("direct.js"); EXPECT_EQ(OK, result); - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ(0U, resolver.mock_js_bindings()->alerts.size()); @@ -373,7 +387,8 @@ TEST(ProxyResolverV8Test, V8Bindings) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_TRUE(proxy_info.is_direct()); @@ -430,7 +445,8 @@ TEST(ProxyResolverV8Test, BindingCalledDuringInitialization) { EXPECT_EQ(1, bindings->my_ip_address_count); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_FALSE(proxy_info.is_direct()); @@ -528,7 +544,8 @@ TEST(ProxyResolverV8Test, DNSResolutionFailure) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); + result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, + BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_FALSE(proxy_info.is_direct()); diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index 2c68cf4..002c514 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -201,14 +201,14 @@ class ProxyService::PacRequest ProxyService::ProxyService(ProxyConfigService* config_service, ProxyResolver* resolver, NetworkChangeNotifier* network_change_notifier, - const BoundNetLog& init_proxy_resolver_log) + NetLog* net_log) : config_service_(config_service), resolver_(resolver), next_config_id_(1), should_use_proxy_resolver_(false), ALLOW_THIS_IN_INITIALIZER_LIST(init_proxy_resolver_callback_( this, &ProxyService::OnInitProxyResolverComplete)), - init_proxy_resolver_log_(init_proxy_resolver_log), + net_log_(net_log), network_change_notifier_(network_change_notifier) { // Register to receive network change notifications. if (network_change_notifier_) @@ -251,7 +251,7 @@ ProxyService* ProxyService::Create( ProxyService* proxy_service = new ProxyService( proxy_config_service, proxy_resolver, network_change_notifier, - BoundNetLog::Make(net_log, NetLog::SOURCE_INIT_PROXY_RESOLVER)); + net_log); if (proxy_resolver->expects_pac_bytes()) { // Configure PAC script downloads to be issued using |url_request_context|. @@ -275,7 +275,7 @@ ProxyService* ProxyService::CreateNull() { return new ProxyService(new ProxyConfigServiceNull, new ProxyResolverNull, NULL, - BoundNetLog()); + NULL); } int ProxyService::ResolveProxy(const GURL& raw_url, @@ -520,7 +520,7 @@ ProxyScriptFetcher* ProxyService::GetProxyScriptFetcher() const { void ProxyService::ResetConfigService( ProxyConfigService* new_proxy_config_service) { config_service_.reset(new_proxy_config_service); - UpdateConfig(NULL); + UpdateConfig(BoundNetLog()); } void ProxyService::PurgeMemory() { @@ -533,7 +533,7 @@ void ProxyService::ForceReloadProxyConfig() { // start updating (normally this would happen lazily during the next // call to ResolveProxy()). config_.set_id(ProxyConfig::INVALID_ID); - UpdateConfig(NULL); + UpdateConfig(BoundNetLog()); } // static @@ -653,11 +653,11 @@ void ProxyService::StartInitProxyResolver() { DCHECK(!init_proxy_resolver_.get()); init_proxy_resolver_.reset( - new InitProxyResolver(resolver_.get(), proxy_script_fetcher_.get())); + new InitProxyResolver(resolver_.get(), proxy_script_fetcher_.get(), + net_log_)); int rv = init_proxy_resolver_->Init( - config_, &init_proxy_resolver_callback_, - init_proxy_resolver_log_); + config_, &init_proxy_resolver_callback_); if (rv != ERR_IO_PENDING) OnInitProxyResolverComplete(rv); diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index bf176c8..49c7979 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -39,9 +39,11 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService>, // If |network_change_notifier| is non-NULL, the proxy service will register // with it to detect when the network setup has changed. This is used to // decide when to re-configure the proxy discovery. + // |net_log| is a possibly NULL destination to send log events to. It must + // remain alive for the lifetime of this ProxyService. ProxyService(ProxyConfigService* config_service, ProxyResolver* resolver, NetworkChangeNotifier* network_change_notifier, - const BoundNetLog& init_proxy_resolver_log); + NetLog* net_log); // Used internally to handle PAC queries. // TODO(eroman): consider naming this simply "Request". @@ -281,8 +283,9 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService>, // |proxy_resolver_| must outlive |init_proxy_resolver_|. scoped_ptr<InitProxyResolver> init_proxy_resolver_; - // Log for events generated by |init_proxy_resolver_|. - BoundNetLog init_proxy_resolver_log_; + // This is the log where any events generated by |init_proxy_resolver_| are + // sent to. + NetLog* net_log_; // The (possibly NULL) network change notifier that we use to decide when // to refetch PAC scripts or re-run WPAD. diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc index d608a44..f5e76d9 100644 --- a/net/proxy/proxy_service_unittest.cc +++ b/net/proxy/proxy_service_unittest.cc @@ -92,8 +92,7 @@ class MockProxyScriptFetcher : public ProxyScriptFetcher { TEST(ProxyServiceTest, Direct) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(new MockProxyConfigService, resolver, NULL, - BoundNetLog())); + new ProxyService(new MockProxyConfigService, resolver, NULL, NULL)); GURL url("http://www.google.com/"); @@ -121,7 +120,7 @@ TEST(ProxyServiceTest, PAC) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); @@ -168,13 +167,13 @@ TEST(ProxyServiceTest, PAC_NoIdentityOrHash) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://username:password@www.google.com/?ref#hash#hash"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -196,13 +195,13 @@ TEST(ProxyServiceTest, PAC_FailoverWithoutDirect) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -224,7 +223,8 @@ TEST(ProxyServiceTest, PAC_FailoverWithoutDirect) { // left to fallback to, since our proxy list was NOT terminated by // DIRECT. TestCompletionCallback callback2; - rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, + BoundNetLog()); // ReconsiderProxyAfterError returns error indicating nothing left. EXPECT_EQ(ERR_FAILED, rv); EXPECT_TRUE(info.is_empty()); @@ -253,13 +253,13 @@ TEST(ProxyServiceTest, PAC_FailoverAfterDirect) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -279,27 +279,31 @@ TEST(ProxyServiceTest, PAC_FailoverAfterDirect) { // Fallback 1. TestCompletionCallback callback2; - rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foobar:10", info.proxy_server().ToURI()); // Fallback 2. TestCompletionCallback callback3; - rv = service->ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback3, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); // Fallback 3. TestCompletionCallback callback4; - rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foobar:20", info.proxy_server().ToURI()); // Fallback 4 -- Nothing to fall back to! TestCompletionCallback callback5; - rv = service->ReconsiderProxyAfterError(url, &info, &callback5, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback5, NULL, + BoundNetLog()); EXPECT_EQ(ERR_FAILED, rv); EXPECT_TRUE(info.is_empty()); } @@ -315,13 +319,13 @@ TEST(ProxyServiceTest, ProxyResolverFails) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); // Start first resolve request. GURL url("http://www.google.com/"); ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -342,7 +346,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) { // The second resolve request will try to run through the proxy resolver, // regardless of whether the first request failed in it. TestCompletionCallback callback2; - rv = service->ResolveProxy(url, &info, &callback2, NULL, NULL); + rv = service->ResolveProxy(url, &info, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -368,14 +372,14 @@ TEST(ProxyServiceTest, ProxyFallback) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -397,14 +401,15 @@ TEST(ProxyServiceTest, ProxyFallback) { // Fake an error on the proxy. TestCompletionCallback callback2; - rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); // The second proxy should be specified. EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); TestCompletionCallback callback3; - rv = service->ResolveProxy(url, &info, &callback3, NULL, NULL); + rv = service->ResolveProxy(url, &info, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -422,7 +427,8 @@ TEST(ProxyServiceTest, ProxyFallback) { // We fake another error. It should now try the third one. TestCompletionCallback callback4; - rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); @@ -430,14 +436,16 @@ TEST(ProxyServiceTest, ProxyFallback) { // proxy servers we thought were valid; next we try the proxy server // that was in our bad proxies map (foopy1:8080). TestCompletionCallback callback5; - rv = service->ReconsiderProxyAfterError(url, &info, &callback5, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback5, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); // Fake another error, the last proxy is gone, the list should now be empty, // so there is nothing left to try. TestCompletionCallback callback6; - rv = service->ReconsiderProxyAfterError(url, &info, &callback6, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback6, NULL, + BoundNetLog()); EXPECT_EQ(ERR_FAILED, rv); EXPECT_FALSE(info.is_direct()); EXPECT_TRUE(info.is_empty()); @@ -454,14 +462,14 @@ TEST(ProxyServiceTest, ProxyFallbackToDirect) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -483,7 +491,8 @@ TEST(ProxyServiceTest, ProxyFallbackToDirect) { // Fake an error on the proxy. TestCompletionCallback callback2; - rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); // Now we get back the second proxy. @@ -491,7 +500,8 @@ TEST(ProxyServiceTest, ProxyFallbackToDirect) { // Fake an error on this proxy as well. TestCompletionCallback callback3; - rv = service->ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback3, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); // Finally, we get back DIRECT. @@ -499,7 +509,8 @@ TEST(ProxyServiceTest, ProxyFallbackToDirect) { // Now we tell the proxy service that even DIRECT failed. TestCompletionCallback callback4; - rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, + BoundNetLog()); // There was nothing left to try after DIRECT, so we are out of // choices. EXPECT_EQ(ERR_FAILED, rv); @@ -514,14 +525,14 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -546,7 +557,8 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { config_service->config.set_pac_url(GURL("http://foopy-new/proxy.pac")); TestCompletionCallback callback2; - rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy-new/proxy.pac"), @@ -566,7 +578,8 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { // We fake another error. It should now ignore the first one. TestCompletionCallback callback3; - rv = service->ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback3, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); @@ -576,7 +589,8 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { // We fake another error. It should go back to the first proxy. TestCompletionCallback callback4; - rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback4, NULL, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy-new2/proxy.pac"), @@ -603,14 +617,14 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service->ResolveProxy(url, &info, &callback1, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -630,7 +644,8 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // Fake a proxy error. TestCompletionCallback callback2; - rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info, &callback2, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); // The first proxy is ignored, and the second one is selected. @@ -640,7 +655,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // Fake a PAC failure. ProxyInfo info2; TestCompletionCallback callback3; - rv = service->ResolveProxy(url, &info2, &callback3, NULL, NULL); + rv = service->ResolveProxy(url, &info2, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -660,7 +675,8 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // "just work" the next time we call it. ProxyInfo info3; TestCompletionCallback callback4; - rv = service->ReconsiderProxyAfterError(url, &info3, &callback4, NULL, NULL); + rv = service->ReconsiderProxyAfterError(url, &info3, &callback4, NULL, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -689,19 +705,19 @@ TEST(ProxyServiceTest, ProxyBypassList) { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); int rv; GURL url1("http://www.webkit.org"); GURL url2("http://www.webkit.com"); // Request for a .org domain should bypass proxy. - rv = service->ResolveProxy(url1, &info[0], &callback[0], NULL, NULL); + rv = service->ResolveProxy(url1, &info[0], &callback[0], NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_TRUE(info[0].is_direct()); // Request for a .com domain hits the proxy. - rv = service->ResolveProxy(url2, &info[1], &callback[1], NULL, NULL); + rv = service->ResolveProxy(url2, &info[1], &callback[1], NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy1:8080", info[1].proxy_server().ToURI()); } @@ -714,11 +730,12 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("http://www.msn.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -726,11 +743,12 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("ftp://ftp.google.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); EXPECT_EQ("direct://", info.proxy_server().ToURI()); @@ -738,11 +756,12 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("https://webbranch.techcu.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI()); @@ -751,11 +770,12 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { config.proxy_rules().ParseFromString("foopy1:8080"); scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("http://www.microsoft.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -774,11 +794,12 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("http://www.msn.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -786,11 +807,12 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("ftp://ftp.google.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI()); @@ -798,11 +820,12 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("https://webbranch.techcu.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI()); @@ -810,11 +833,12 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config), new MockAsyncProxyResolver, NULL, - BoundNetLog())); + NULL)); GURL test_url("unknown://www.microsoft.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(test_url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(test_url, &info, &callback, NULL, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI()); @@ -829,14 +853,14 @@ TEST(ProxyServiceTest, CancelInProgressRequest) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); // Start 3 requests. ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Nothing has been sent to the proxy resolver yet, since the proxy @@ -855,7 +879,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) { TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, &request2, NULL); + GURL("http://request2"), &info2, &callback2, &request2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(2u, resolver->pending_requests().size()); EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url()); @@ -863,7 +887,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) { ProxyInfo info3; TestCompletionCallback callback3; rv = service->ResolveProxy( - GURL("http://request3"), &info3, &callback3, NULL, NULL); + GURL("http://request3"), &info3, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(3u, resolver->pending_requests().size()); EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[2]->url()); @@ -904,7 +928,7 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) { new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -914,7 +938,7 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first request should have triggered download of PAC script. @@ -924,13 +948,13 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) { ProxyInfo info2; TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, NULL, NULL); + GURL("http://request2"), &info2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info3; TestCompletionCallback callback3; rv = service->ResolveProxy( - GURL("http://request3"), &info3, &callback3, NULL, NULL); + GURL("http://request3"), &info3, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Nothing has been sent to the resolver yet. @@ -983,7 +1007,7 @@ TEST(ProxyServiceTest, ChangeScriptFetcherWhilePACDownloadInProgress) { new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -993,7 +1017,7 @@ TEST(ProxyServiceTest, ChangeScriptFetcherWhilePACDownloadInProgress) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first request should have triggered download of PAC script. @@ -1003,7 +1027,7 @@ TEST(ProxyServiceTest, ChangeScriptFetcherWhilePACDownloadInProgress) { ProxyInfo info2; TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, NULL, NULL); + GURL("http://request2"), &info2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // At this point the ProxyService should be waiting for the @@ -1040,7 +1064,7 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) { new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1062,13 +1086,13 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) { TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, &request2, NULL); + GURL("http://request2"), &info2, &callback2, &request2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info3; TestCompletionCallback callback3; rv = service->ResolveProxy( - GURL("http://request3"), &info3, &callback3, NULL, NULL); + GURL("http://request3"), &info3, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Nothing has been sent to the resolver yet. @@ -1128,7 +1152,7 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac) { MockAsyncProxyResolverExpectsBytes* resolver = new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1138,14 +1162,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info2; TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, &request2, NULL); + GURL("http://request2"), &info2, &callback2, &request2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1199,7 +1223,7 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac2) { MockAsyncProxyResolverExpectsBytes* resolver = new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1209,14 +1233,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac2) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info2; TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, &request2, NULL); + GURL("http://request2"), &info2, &callback2, &request2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1275,7 +1299,7 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) { MockAsyncProxyResolverExpectsBytes* resolver = new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1285,14 +1309,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info2; TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, &request2, NULL); + GURL("http://request2"), &info2, &callback2, &request2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1333,7 +1357,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) { MockAsyncProxyResolverExpectsBytes* resolver = new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1343,7 +1367,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1374,7 +1398,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) { ProxyInfo info2; TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://www.google.com"), &info2, &callback2, NULL, NULL); + GURL("http://www.google.com"), &info2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -1401,7 +1425,7 @@ TEST(ProxyServiceTest, DeleteWhileInitProxyResolverHasOutstandingFetch) { MockAsyncProxyResolverExpectsBytes* resolver = new MockAsyncProxyResolverExpectsBytes; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1411,7 +1435,7 @@ TEST(ProxyServiceTest, DeleteWhileInitProxyResolverHasOutstandingFetch) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1437,13 +1461,13 @@ TEST(ProxyServiceTest, DeleteWhileInitProxyResolverHasOutstandingSet) { MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); GURL url("http://www.google.com/"); ProxyInfo info; TestCompletionCallback callback; - int rv = service->ResolveProxy(url, &info, &callback, NULL, NULL); + int rv = service->ResolveProxy(url, &info, &callback, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -1460,12 +1484,12 @@ TEST(ProxyServiceTest, ResetProxyConfigService) { scoped_refptr<ProxyService> service(new ProxyService( new MockProxyConfigService(config1), new MockAsyncProxyResolverExpectsBytes, - NULL, BoundNetLog())); + NULL, NULL)); ProxyInfo info; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info, &callback1, NULL, NULL); + GURL("http://request1"), &info, &callback1, NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -1475,7 +1499,7 @@ TEST(ProxyServiceTest, ResetProxyConfigService) { service->ResetConfigService(new MockProxyConfigService(config2)); TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://request2"), &info, &callback2, NULL, NULL); + GURL("http://request2"), &info, &callback2, NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI()); } @@ -1492,14 +1516,14 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) { MockProxyConfigService* config_service = new MockProxyConfigService(config); MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); // Start 1 requests. ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1515,7 +1539,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) { // Force the ProxyService to pull down a new proxy configuration. // (Even though the configuration isn't old/bad). - service->UpdateConfig(NULL); + service->UpdateConfig(BoundNetLog()); // Start another request -- the effective configuration has not // changed, so we shouldn't re-run the autodetect step. @@ -1523,7 +1547,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) { ProxyInfo info2; TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://www.google.com"), &info2, &callback2, NULL, NULL); + GURL("http://www.google.com"), &info2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_TRUE(info2.is_direct()); @@ -1538,14 +1562,14 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) { MockProxyConfigService* config_service = new MockProxyConfigService(config); MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver; scoped_refptr<ProxyService> service( - new ProxyService(config_service, resolver, NULL, BoundNetLog())); + new ProxyService(config_service, resolver, NULL, NULL)); // Start 1 request. ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1571,13 +1595,13 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) { // requests should complete synchronously now as direct-connect. config.set_auto_detect(false); config_service->config = config; - service->UpdateConfig(NULL); + service->UpdateConfig(BoundNetLog()); // Start another request -- the effective configuration has changed. ProxyInfo info2; TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://www.google.com"), &info2, &callback2, NULL, NULL); + GURL("http://www.google.com"), &info2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_TRUE(info2.is_direct()); @@ -1594,7 +1618,7 @@ TEST(ProxyServiceTest, NetworkChangeTriggersPacRefetch) { scoped_refptr<ProxyService> service( new ProxyService(config_service, resolver, &network_change_notifier, - BoundNetLog())); + NULL)); MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; service->SetProxyScriptFetcher(fetcher); @@ -1604,7 +1628,7 @@ TEST(ProxyServiceTest, NetworkChangeTriggersPacRefetch) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service->ResolveProxy( - GURL("http://request1"), &info1, &callback1, NULL, NULL); + GURL("http://request1"), &info1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first request should have triggered initial download of PAC script. @@ -1645,7 +1669,7 @@ TEST(ProxyServiceTest, NetworkChangeTriggersPacRefetch) { ProxyInfo info2; TestCompletionCallback callback2; rv = service->ResolveProxy( - GURL("http://request2"), &info2, &callback2, NULL, NULL); + GURL("http://request2"), &info2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // This second request should have triggered the re-download of the PAC diff --git a/net/proxy/single_threaded_proxy_resolver_unittest.cc b/net/proxy/single_threaded_proxy_resolver_unittest.cc index b6029ee..753fcdd 100644 --- a/net/proxy/single_threaded_proxy_resolver_unittest.cc +++ b/net/proxy/single_threaded_proxy_resolver_unittest.cc @@ -178,19 +178,19 @@ TEST(SingleThreadedProxyResolverTest, Basic) { TestCompletionCallback callback1; ProxyInfo results1; rv = resolver.GetProxyForURL( - GURL("http://request1"), &results1, &callback1, NULL, NULL); + GURL("http://request1"), &results1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback2; ProxyInfo results2; rv = resolver.GetProxyForURL( - GURL("http://request2"), &results2, &callback2, NULL, NULL); + GURL("http://request2"), &results2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback3; ProxyInfo results3; rv = resolver.GetProxyForURL( - GURL("http://request3"), &results3, &callback3, NULL, NULL); + GURL("http://request3"), &results3, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Wait for the requests to finish (they must finish in the order they were @@ -307,7 +307,7 @@ TEST(SingleThreadedProxyResolverTest, CancelRequest) { TestCompletionCallback callback0; ProxyInfo results0; rv = resolver.GetProxyForURL( - GURL("http://request0"), &results0, &callback0, &request0, NULL); + GURL("http://request0"), &results0, &callback0, &request0, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Wait until requests 0 reaches the worker thread. @@ -318,20 +318,20 @@ TEST(SingleThreadedProxyResolverTest, CancelRequest) { TestCompletionCallback callback1; ProxyInfo results1; rv = resolver.GetProxyForURL( - GURL("http://request1"), &results1, &callback1, NULL, NULL); + GURL("http://request1"), &results1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyResolver::RequestHandle request2; TestCompletionCallback callback2; ProxyInfo results2; rv = resolver.GetProxyForURL( - GURL("http://request2"), &results2, &callback2, &request2, NULL); + GURL("http://request2"), &results2, &callback2, &request2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback3; ProxyInfo results3; rv = resolver.GetProxyForURL( - GURL("http://request3"), &results3, &callback3, NULL, NULL); + GURL("http://request3"), &results3, &callback3, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Cancel request0 (inprogress) and request2 (pending). @@ -376,19 +376,19 @@ TEST(SingleThreadedProxyResolverTest, CancelRequestByDeleting) { TestCompletionCallback callback0; ProxyInfo results0; rv = resolver->GetProxyForURL( - GURL("http://request0"), &results0, &callback0, NULL, NULL); + GURL("http://request0"), &results0, &callback0, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback1; ProxyInfo results1; rv = resolver->GetProxyForURL( - GURL("http://request1"), &results1, &callback1, NULL, NULL); + GURL("http://request1"), &results1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback2; ProxyInfo results2; rv = resolver->GetProxyForURL( - GURL("http://request2"), &results2, &callback2, NULL, NULL); + GURL("http://request2"), &results2, &callback2, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Wait until request 0 reaches the worker thread. @@ -430,7 +430,7 @@ TEST(SingleThreadedProxyResolverTest, CancelSetPacScript) { TestCompletionCallback callback0; ProxyInfo results0; rv = resolver.GetProxyForURL( - GURL("http://request0"), &results0, &callback0, &request0, NULL); + GURL("http://request0"), &results0, &callback0, &request0, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Wait until requests 0 reaches the worker thread. @@ -449,7 +449,7 @@ TEST(SingleThreadedProxyResolverTest, CancelSetPacScript) { TestCompletionCallback callback1; ProxyInfo results1; rv = resolver.GetProxyForURL( - GURL("http://request1"), &results1, &callback1, NULL, NULL); + GURL("http://request1"), &results1, &callback1, NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Unblock the worker thread so the requests can continue running. diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index cd333ff..3e20eb9b 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -471,7 +471,7 @@ TEST_F(ClientSocketPoolBaseTest, ConnectJob_NoTimeoutOnSynchronousCompletion) { TestConnectJobDelegate delegate; ClientSocketHandle ignored; TestClientSocketPoolBase::Request request( - &ignored, NULL, kDefaultPriority, NULL, NULL); + &ignored, NULL, kDefaultPriority, NULL, BoundNetLog()); scoped_ptr<TestConnectJob> job( new TestConnectJob(TestConnectJob::kMockJob, "a", @@ -479,7 +479,7 @@ TEST_F(ClientSocketPoolBaseTest, ConnectJob_NoTimeoutOnSynchronousCompletion) { base::TimeDelta::FromMicroseconds(1), &delegate, &client_socket_factory_, - NULL)); + BoundNetLog())); EXPECT_EQ(OK, job->Connect()); } @@ -489,7 +489,7 @@ TEST_F(ClientSocketPoolBaseTest, ConnectJob_TimedOut) { CapturingBoundNetLog log(CapturingNetLog::kUnbounded); TestClientSocketPoolBase::Request request( - &ignored, NULL, kDefaultPriority, NULL, NULL); + &ignored, NULL, kDefaultPriority, NULL, BoundNetLog()); // Deleted by TestConnectJobDelegate. TestConnectJob* job = new TestConnectJob(TestConnectJob::kMockPendingJob, @@ -556,7 +556,8 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) { log.bound())); EXPECT_EQ(6u, log.entries().size()); - EXPECT_TRUE(LogContainsBeginEvent(log.entries(), 0, NetLog::TYPE_SOCKET_POOL)); + EXPECT_TRUE(LogContainsBeginEvent( + log.entries(), 0, NetLog::TYPE_SOCKET_POOL)); EXPECT_TRUE(LogContainsBeginEvent( log.entries(), 2, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB)); EXPECT_TRUE(LogContainsEndEvent( @@ -888,7 +889,8 @@ TEST_F(ClientSocketPoolBaseTest, CancelRequestClearGroup) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req(&request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - InitHandle(req.handle(), "a", kDefaultPriority, &req, pool_, NULL)); + InitHandle(req.handle(), "a", kDefaultPriority, &req, pool_, + BoundNetLog())); req.handle()->Reset(); } @@ -901,13 +903,14 @@ TEST_F(ClientSocketPoolBaseTest, ConnectCancelConnect) { TestSocketRequest req(&request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, NULL)); + InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, + BoundNetLog())); handle.Reset(); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, InitHandle(&handle, "a", kDefaultPriority, - &callback2, pool_, NULL)); + &callback2, pool_, BoundNetLog())); EXPECT_EQ(OK, callback2.WaitForResult()); EXPECT_FALSE(callback.have_result()); @@ -981,7 +984,7 @@ class RequestSocketCallback : public CallbackRunner< Tuple1<int> > { within_callback_ = true; TestCompletionCallback next_job_callback; int rv = InitHandle(handle_, "a", kDefaultPriority, &next_job_callback, - pool_, NULL); + pool_, BoundNetLog()); switch (next_job_type_) { case TestConnectJob::kMockJob: EXPECT_EQ(OK, rv); @@ -1030,7 +1033,8 @@ TEST_F(ClientSocketPoolBaseTest, RequestPendingJobTwice) { RequestSocketCallback callback( &handle, pool_.get(), connect_job_factory_, TestConnectJob::kMockPendingJob); - int rv = InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, NULL); + int rv = InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, + BoundNetLog()); ASSERT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -1043,7 +1047,8 @@ TEST_F(ClientSocketPoolBaseTest, RequestPendingJobThenSynchronous) { ClientSocketHandle handle; RequestSocketCallback callback( &handle, pool_.get(), connect_job_factory_, TestConnectJob::kMockJob); - int rv = InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, NULL); + int rv = InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, + BoundNetLog()); ASSERT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -1104,13 +1109,15 @@ TEST_F(ClientSocketPoolBaseTest, CancelActiveRequestThenRequestSocket) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req(&request_order_, &completion_count_); - int rv = InitHandle(req.handle(), "a", kDefaultPriority, &req, pool_, NULL); + int rv = InitHandle(req.handle(), "a", kDefaultPriority, &req, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Cancel the active request. req.handle()->Reset(); - rv = InitHandle(req.handle(), "a", kDefaultPriority, &req, pool_, NULL); + rv = InitHandle(req.handle(), "a", kDefaultPriority, &req, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, req.WaitForResult()); @@ -1263,7 +1270,8 @@ TEST_F(ClientSocketPoolBaseTest, ReleaseSockets) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req1(&request_order_, &completion_count_); - int rv = InitHandle(req1.handle(), "a", kDefaultPriority, &req1, pool_, NULL); + int rv = InitHandle(req1.handle(), "a", kDefaultPriority, &req1, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, req1.WaitForResult()); @@ -1272,10 +1280,12 @@ TEST_F(ClientSocketPoolBaseTest, ReleaseSockets) { connect_job_factory_->set_job_type(TestConnectJob::kMockWaitingJob); TestSocketRequest req2(&request_order_, &completion_count_); - rv = InitHandle(req2.handle(), "a", kDefaultPriority, &req2, pool_, NULL); + rv = InitHandle(req2.handle(), "a", kDefaultPriority, &req2, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestSocketRequest req3(&request_order_, &completion_count_); - rv = InitHandle(req3.handle(), "a", kDefaultPriority, &req3, pool_, NULL); + rv = InitHandle(req3.handle(), "a", kDefaultPriority, &req3, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Both Requests 2 and 3 are pending. We release socket 1 which should @@ -1306,18 +1316,21 @@ TEST_F(ClientSocketPoolBaseTest, PendingJobCompletionOrder) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingFailingJob); TestSocketRequest req1(&request_order_, &completion_count_); - int rv = InitHandle(req1.handle(), "a", kDefaultPriority, &req1, pool_, NULL); + int rv = InitHandle(req1.handle(), "a", kDefaultPriority, &req1, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestSocketRequest req2(&request_order_, &completion_count_); - rv = InitHandle(req2.handle(), "a", kDefaultPriority, &req2, pool_, NULL); + rv = InitHandle(req2.handle(), "a", kDefaultPriority, &req2, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The pending job is sync. connect_job_factory_->set_job_type(TestConnectJob::kMockJob); TestSocketRequest req3(&request_order_, &completion_count_); - rv = InitHandle(req3.handle(), "a", kDefaultPriority, &req3, pool_, NULL); + rv = InitHandle(req3.handle(), "a", kDefaultPriority, &req3, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(ERR_CONNECTION_FAILED, req1.WaitForResult()); @@ -1336,14 +1349,16 @@ TEST_F(ClientSocketPoolBaseTest, DISABLED_LoadState) { TestConnectJob::kMockAdvancingLoadStateJob); TestSocketRequest req1(&request_order_, &completion_count_); - int rv = InitHandle(req1.handle(), "a", kDefaultPriority, &req1, pool_, NULL); + int rv = InitHandle(req1.handle(), "a", kDefaultPriority, &req1, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_IDLE, req1.handle()->GetLoadState()); MessageLoop::current()->RunAllPending(); TestSocketRequest req2(&request_order_, &completion_count_); - rv = InitHandle(req2.handle(), "a", kDefaultPriority, &req2, pool_, NULL); + rv = InitHandle(req2.handle(), "a", kDefaultPriority, &req2, pool_, + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_WAITING_FOR_CACHE, req1.handle()->GetLoadState()); EXPECT_EQ(LOAD_STATE_WAITING_FOR_CACHE, req2.handle()->GetLoadState()); @@ -1360,12 +1375,12 @@ TEST_F(ClientSocketPoolBaseTest, CleanupTimedOutIdleSockets) { // Startup two mock pending connect jobs, which will sit in the MessageLoop. TestSocketRequest req(&request_order_, &completion_count_); - int rv = InitHandle(req.handle(), "a", LOWEST, &req, pool_, NULL); + int rv = InitHandle(req.handle(), "a", LOWEST, &req, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_CONNECTING, pool_->GetLoadState("a", req.handle())); TestSocketRequest req2(&request_order_, &completion_count_); - rv = InitHandle(req2.handle(), "a", LOWEST, &req2, pool_, NULL); + rv = InitHandle(req2.handle(), "a", LOWEST, &req2, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_CONNECTING, pool_->GetLoadState("a", req2.handle())); @@ -1412,19 +1427,19 @@ TEST_F(ClientSocketPoolBaseTest, MultipleReleasingDisconnectedSockets) { // Startup 4 connect jobs. Two of them will be pending. TestSocketRequest req(&request_order_, &completion_count_); - int rv = InitHandle(req.handle(), "a", LOWEST, &req, pool_, NULL); + int rv = InitHandle(req.handle(), "a", LOWEST, &req, pool_, BoundNetLog()); EXPECT_EQ(OK, rv); TestSocketRequest req2(&request_order_, &completion_count_); - rv = InitHandle(req2.handle(), "a", LOWEST, &req2, pool_, NULL); + rv = InitHandle(req2.handle(), "a", LOWEST, &req2, pool_, BoundNetLog()); EXPECT_EQ(OK, rv); TestSocketRequest req3(&request_order_, &completion_count_); - rv = InitHandle(req3.handle(), "a", LOWEST, &req3, pool_, NULL); + rv = InitHandle(req3.handle(), "a", LOWEST, &req3, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestSocketRequest req4(&request_order_, &completion_count_); - rv = InitHandle(req4.handle(), "a", LOWEST, &req4, pool_, NULL); + rv = InitHandle(req4.handle(), "a", LOWEST, &req4, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // Release two disconnected sockets. @@ -1487,7 +1502,7 @@ class TestReleasingSocketRequest : public CallbackRunner< Tuple1<int> > { callback_.RunWithParams(params); handle_.Reset(); EXPECT_EQ(ERR_IO_PENDING, InitHandle(&handle2_, "a", kDefaultPriority, - &callback2_, pool_, NULL)); + &callback2_, pool_, BoundNetLog())); } private: @@ -1510,7 +1525,7 @@ TEST_F(ClientSocketPoolBaseTest, ReleasedSocketReleasesToo) { ClientSocketHandle handle; TestCompletionCallback callback; EXPECT_EQ(OK, InitHandle(&handle, "a", kDefaultPriority, &callback, pool_, - NULL)); + BoundNetLog())); handle.Reset(); // Before the DoReleaseSocket() task has run, start up a @@ -1518,7 +1533,7 @@ TEST_F(ClientSocketPoolBaseTest, ReleasedSocketReleasesToo) { // num_releasing_sockets > 0 and there was no idle socket to use yet. TestReleasingSocketRequest request(pool_.get()); EXPECT_EQ(ERR_IO_PENDING, InitHandle(request.handle(), "a", kDefaultPriority, - &request, pool_, NULL)); + &request, pool_, BoundNetLog())); EXPECT_EQ(OK, request.WaitForResult()); } diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index e309786c..f30a641 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -516,7 +516,7 @@ class ClientSocketPoolTest : public testing::Test { requests_.push_back(request); int rv = request->handle()->Init( group_name, socket_params, priority, request, - socket_pool, NULL); + socket_pool, BoundNetLog()); if (rv != ERR_IO_PENDING) request_order_.push_back(request); return rv; diff --git a/net/socket/socks5_client_socket_unittest.cc b/net/socket/socks5_client_socket_unittest.cc index eb4109a..736a725 100644 --- a/net/socket/socks5_client_socket_unittest.cc +++ b/net/socket/socks5_client_socket_unittest.cc @@ -67,7 +67,8 @@ void SOCKS5ClientSocketTest::SetUp() { // Resolve the "localhost" AddressList used by the TCP connection to connect. HostResolver::RequestInfo info("www.socks-proxy.com", 1080); - int rv = host_resolver_->Resolve(info, &address_list_, NULL, NULL, NULL); + int rv = host_resolver_->Resolve(info, &address_list_, NULL, NULL, + BoundNetLog()); ASSERT_EQ(OK, rv); } diff --git a/net/socket/socks_client_socket_pool_unittest.cc b/net/socket/socks_client_socket_pool_unittest.cc index e2e30a3..577a39b 100644 --- a/net/socket/socks_client_socket_pool_unittest.cc +++ b/net/socket/socks_client_socket_pool_unittest.cc @@ -199,7 +199,8 @@ TEST_F(SOCKSClientSocketPoolTest, Simple) { tcp_client_socket_factory_.AddSocketDataProvider(data.data_provider()); ClientSocketHandle handle; - int rv = handle.Init("a", ignored_socket_params_, LOW, NULL, pool_, NULL); + int rv = handle.Init("a", ignored_socket_params_, LOW, NULL, pool_, + BoundNetLog()); EXPECT_EQ(OK, rv); EXPECT_TRUE(handle.is_initialized()); EXPECT_TRUE(handle.socket()); @@ -212,7 +213,7 @@ TEST_F(SOCKSClientSocketPoolTest, Async) { TestCompletionCallback callback; ClientSocketHandle handle; int rv = handle.Init("a", ignored_socket_params_, LOW, &callback, pool_, - NULL); + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -228,7 +229,8 @@ TEST_F(SOCKSClientSocketPoolTest, TCPConnectError) { tcp_client_socket_factory_.AddSocketDataProvider(socket_data.get()); ClientSocketHandle handle; - int rv = handle.Init("a", ignored_socket_params_, LOW, NULL, pool_, NULL); + int rv = handle.Init("a", ignored_socket_params_, LOW, NULL, pool_, + BoundNetLog()); EXPECT_EQ(ERR_CONNECTION_REFUSED, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -242,7 +244,7 @@ TEST_F(SOCKSClientSocketPoolTest, AsyncTCPConnectError) { TestCompletionCallback callback; ClientSocketHandle handle; int rv = handle.Init("a", ignored_socket_params_, LOW, &callback, pool_, - NULL); + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -263,7 +265,8 @@ TEST_F(SOCKSClientSocketPoolTest, SOCKSConnectError) { ClientSocketHandle handle; EXPECT_EQ(0, tcp_socket_pool_->release_count()); - int rv = handle.Init("a", ignored_socket_params_, LOW, NULL, pool_, NULL); + int rv = handle.Init("a", ignored_socket_params_, LOW, NULL, pool_, + BoundNetLog()); EXPECT_EQ(ERR_SOCKS_CONNECTION_FAILED, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -283,7 +286,7 @@ TEST_F(SOCKSClientSocketPoolTest, AsyncSOCKSConnectError) { ClientSocketHandle handle; EXPECT_EQ(0, tcp_socket_pool_->release_count()); int rv = handle.Init("a", ignored_socket_params_, LOW, &callback, pool_, - NULL); + BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc index 86243af..3606c45 100644 --- a/net/socket/ssl_client_socket_unittest.cc +++ b/net/socket/ssl_client_socket_unittest.cc @@ -65,7 +65,7 @@ TEST_F(SSLClientSocketTest, Connect) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(net::OK, rv); net::CapturingNetLog log(net::CapturingNetLog::kUnbounded); @@ -109,7 +109,7 @@ TEST_F(SSLClientSocketTest, ConnectExpired) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kBadHTTPSPort); - int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(net::OK, rv); net::CapturingNetLog log(net::CapturingNetLog::kUnbounded); @@ -154,7 +154,7 @@ TEST_F(SSLClientSocketTest, ConnectMismatched) { net::HostResolver::RequestInfo info(server_.kMismatchedHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(net::OK, rv); net::CapturingNetLog log(net::CapturingNetLog::kUnbounded); @@ -203,7 +203,7 @@ TEST_F(SSLClientSocketTest, Read) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(info, &addr, &callback, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, &callback, NULL, net::BoundNetLog()); EXPECT_EQ(net::ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -265,7 +265,7 @@ TEST_F(SSLClientSocketTest, Read_FullDuplex) { TestCompletionCallback callback2; // Used for Write only. net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(info, &addr, &callback, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, &callback, NULL, net::BoundNetLog()); EXPECT_EQ(net::ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -327,7 +327,7 @@ TEST_F(SSLClientSocketTest, Read_SmallChunks) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(net::OK, rv); net::ClientSocket* transport = new net::TCPClientSocket(addr, NULL); @@ -381,7 +381,7 @@ TEST_F(SSLClientSocketTest, Read_Interrupted) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(net::OK, rv); net::ClientSocket* transport = new net::TCPClientSocket(addr, NULL); diff --git a/net/socket/ssl_test_util.cc b/net/socket/ssl_test_util.cc index b52dba5..ce3589a 100644 --- a/net/socket/ssl_test_util.cc +++ b/net/socket/ssl_test_util.cc @@ -222,7 +222,7 @@ bool TestServerLauncher::WaitToStart(const std::string& host_name, int port) { scoped_refptr<net::HostResolver> resolver( net::CreateSystemHostResolver(NULL)); net::HostResolver::RequestInfo info(host_name, port); - int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); if (rv != net::OK) return false; diff --git a/net/socket/tcp_client_socket_pool_unittest.cc b/net/socket/tcp_client_socket_pool_unittest.cc index aed9052..4986f32 100644 --- a/net/socket/tcp_client_socket_pool_unittest.cc +++ b/net/socket/tcp_client_socket_pool_unittest.cc @@ -282,7 +282,7 @@ TEST_F(TCPClientSocketPoolTest, Basic) { TestCompletionCallback callback; ClientSocketHandle handle; TCPSocketParams dest("www.google.com", 80, LOW, GURL(), false); - int rv = handle.Init("a", dest, LOW, &callback, pool_, NULL); + int rv = handle.Init("a", dest, LOW, &callback, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -300,7 +300,8 @@ TEST_F(TCPClientSocketPoolTest, InitHostResolutionFailure) { TCPSocketParams dest("unresolvable.host.name", 80, kDefaultPriority, GURL(), false); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, NULL)); + req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, + BoundNetLog())); EXPECT_EQ(ERR_NAME_NOT_RESOLVED, req.WaitForResult()); } @@ -310,13 +311,15 @@ TEST_F(TCPClientSocketPoolTest, InitConnectionFailure) { TestSocketRequest req(&request_order_, &completion_count_); TCPSocketParams dest("a", 80, kDefaultPriority, GURL(), false); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, NULL)); + req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, + BoundNetLog())); EXPECT_EQ(ERR_CONNECTION_FAILED, req.WaitForResult()); // Make the host resolutions complete synchronously this time. host_resolver_->set_synchronous_mode(true); EXPECT_EQ(ERR_CONNECTION_FAILED, - req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, NULL)); + req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, + BoundNetLog())); } TEST_F(TCPClientSocketPoolTest, PendingRequests) { @@ -422,7 +425,8 @@ TEST_F(TCPClientSocketPoolTest, CancelRequestClearGroup) { TestSocketRequest req(&request_order_, &completion_count_); TCPSocketParams dest("www.google.com", 80, kDefaultPriority, GURL(), false); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, NULL)); + req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, + BoundNetLog())); req.handle()->Reset(); // There is a race condition here. If the worker pool doesn't post the task @@ -440,9 +444,11 @@ TEST_F(TCPClientSocketPoolTest, TwoRequestsCancelOne) { TCPSocketParams dest("www.google.com", 80, kDefaultPriority, GURL(), false); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, NULL)); + req.handle()->Init("a", dest, kDefaultPriority, &req, pool_, + BoundNetLog())); EXPECT_EQ(ERR_IO_PENDING, - req2.handle()->Init("a", dest, kDefaultPriority, &req2, pool_, NULL)); + req2.handle()->Init("a", dest, kDefaultPriority, &req2, pool_, + BoundNetLog())); req.handle()->Reset(); @@ -459,13 +465,15 @@ TEST_F(TCPClientSocketPoolTest, ConnectCancelConnect) { TCPSocketParams dest("www.google.com", 80, kDefaultPriority, GURL(), false); EXPECT_EQ(ERR_IO_PENDING, - handle.Init("a", dest, kDefaultPriority, &callback, pool_, NULL)); + handle.Init("a", dest, kDefaultPriority, &callback, pool_, + BoundNetLog())); handle.Reset(); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, - handle.Init("a", dest, kDefaultPriority, &callback2, pool_, NULL)); + handle.Init("a", dest, kDefaultPriority, &callback2, pool_, + BoundNetLog())); host_resolver_->set_synchronous_mode(true); // At this point, handle has two ConnectingSockets out for it. Due to the @@ -564,7 +572,7 @@ class RequestSocketCallback : public CallbackRunner< Tuple1<int> > { } within_callback_ = true; TCPSocketParams dest("www.google.com", 80, LOWEST, GURL(), false); - int rv = handle_->Init("a", dest, LOWEST, this, pool_, NULL); + int rv = handle_->Init("a", dest, LOWEST, this, pool_, BoundNetLog()); EXPECT_EQ(OK, rv); } } @@ -584,7 +592,7 @@ TEST_F(TCPClientSocketPoolTest, RequestTwice) { ClientSocketHandle handle; RequestSocketCallback callback(&handle, pool_.get()); TCPSocketParams dest("www.google.com", 80, LOWEST, GURL(), false); - int rv = handle.Init("a", dest, LOWEST, &callback, pool_, NULL); + int rv = handle.Init("a", dest, LOWEST, &callback, pool_, BoundNetLog()); ASSERT_EQ(ERR_IO_PENDING, rv); // The callback is going to request "www.google.com". We want it to complete @@ -647,7 +655,7 @@ TEST_F(TCPClientSocketPoolTest, ResetIdleSocketsOnIPAddressChange) { TestCompletionCallback callback; ClientSocketHandle handle; TCPSocketParams dest("www.google.com", 80, LOW, GURL(), false); - int rv = handle.Init("a", dest, LOW, &callback, pool_, NULL); + int rv = handle.Init("a", dest, LOW, &callback, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -701,7 +709,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketConnect) { TestCompletionCallback callback; ClientSocketHandle handle; TCPSocketParams dest("www.google.com", 80, LOW, GURL(), false); - int rv = handle.Init("b", dest, LOW, &callback, pool_, NULL); + int rv = handle.Init("b", dest, LOW, &callback, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -739,7 +747,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketCancel) { TestCompletionCallback callback; ClientSocketHandle handle; TCPSocketParams dest("www.google.com", 80, LOW, GURL(), false); - int rv = handle.Init("c", dest, LOW, &callback, pool_, NULL); + int rv = handle.Init("c", dest, LOW, &callback, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -784,7 +792,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketFailAfterStall) { TestCompletionCallback callback; ClientSocketHandle handle; TCPSocketParams dest("www.google.com", 80, LOW, GURL(), false); - int rv = handle.Init("b", dest, LOW, &callback, pool_, NULL); + int rv = handle.Init("b", dest, LOW, &callback, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -830,7 +838,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketFailAfterDelay) { TestCompletionCallback callback; ClientSocketHandle handle; TCPSocketParams dest("www.google.com", 80, LOW, GURL(), false); - int rv = handle.Init("b", dest, LOW, &callback, pool_, NULL); + int rv = handle.Init("b", dest, LOW, &callback, pool_, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); diff --git a/net/socket/tcp_client_socket_unittest.cc b/net/socket/tcp_client_socket_unittest.cc index 53ec97b..0c16010 100644 --- a/net/socket/tcp_client_socket_unittest.cc +++ b/net/socket/tcp_client_socket_unittest.cc @@ -91,7 +91,7 @@ void TCPClientSocketTest::SetUp() { AddressList addr; scoped_refptr<HostResolver> resolver(CreateSystemHostResolver(NULL)); HostResolver::RequestInfo info("localhost", listen_port_); - int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); CHECK_EQ(rv, OK); sock_.reset(new TCPClientSocket(addr, &net_log_)); } diff --git a/net/socket/tcp_pinger_unittest.cc b/net/socket/tcp_pinger_unittest.cc index 2cffa8a..29fd78e 100644 --- a/net/socket/tcp_pinger_unittest.cc +++ b/net/socket/tcp_pinger_unittest.cc @@ -69,7 +69,7 @@ TEST_F(TCPPingerTest, Ping) { net::CreateSystemHostResolver(NULL)); net::HostResolver::RequestInfo info("localhost", listen_port_); - int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(rv, net::OK); net::TCPPinger pinger(addr); @@ -86,7 +86,7 @@ TEST_F(TCPPingerTest, PingFail) { listen_sock_ = NULL; net::HostResolver::RequestInfo info("localhost", listen_port_); - int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, net::BoundNetLog()); EXPECT_EQ(rv, net::OK); net::TCPPinger pinger(addr); diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index c257e66..ca31d95 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -731,7 +731,8 @@ TEST_F(SpdyNetworkTransactionTest, Get) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(OK, out.rv); EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); EXPECT_EQ("hello!", out.response_data); @@ -766,7 +767,8 @@ TEST_F(SpdyNetworkTransactionTest, Post) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(2, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(OK, out.rv); EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); EXPECT_EQ("hello!", out.response_data); @@ -814,7 +816,7 @@ static const unsigned char kEmptyPostSyn[] = { new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data, NULL); + TransactionHelperResult out = TransactionHelper(request, data, BoundNetLog()); EXPECT_EQ(OK, out.rv); EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); EXPECT_EQ("hello!", out.response_data); @@ -834,7 +836,8 @@ TEST_F(SpdyNetworkTransactionTest, ResponseWithoutSynReply) { request.load_flags = 0; scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), NULL, 0)); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(ERR_SYN_REPLY_NOT_RECEIVED, out.rv); } @@ -873,7 +876,7 @@ TEST_F(SpdyNetworkTransactionTest, CancelledTransaction) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); trans.reset(); // Cancel the transaction. @@ -983,7 +986,8 @@ TEST_F(SpdyNetworkTransactionTest, SynReplyHeaders) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(OK, out.rv); EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); EXPECT_EQ("hello!", out.response_data); @@ -1136,7 +1140,8 @@ TEST_F(SpdyNetworkTransactionTest, SynReplyHeadersVary) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(OK, out.rv) << i; EXPECT_EQ("HTTP/1.1 200 OK", out.status_line) << i; EXPECT_EQ("hello!", out.response_data) << i; @@ -1233,7 +1238,8 @@ TEST_F(SpdyNetworkTransactionTest, InvalidSynReply) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(ERR_INVALID_RESPONSE, out.rv); } } @@ -1280,7 +1286,8 @@ TEST_F(SpdyNetworkTransactionTest, CorruptFrameSessionError) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv); } } @@ -1351,7 +1358,7 @@ static void MakeRequest(scoped_refptr<HttpNetworkSession> session, data->SetCompletionCallback(&callback); // Sends a request. In pass 1, this goes on the wire; in pass 2, it is // preempted by the push data. - int rv = trans.Start(&request, &callback, NULL); + int rv = trans.Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // In the case where we are pushing beforehand, complete the next read now. @@ -1625,7 +1632,8 @@ TEST_F(SpdyNetworkTransactionTest, WriteError) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(2, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(ERR_FAILED, out.rv); data->Reset(); } @@ -1652,7 +1660,8 @@ TEST_F(SpdyNetworkTransactionTest, PartialWrite) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(kChunks, reads, arraysize(reads), writes.get(), kChunks)); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(OK, out.rv); EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); EXPECT_EQ("hello!", out.response_data); @@ -1688,7 +1697,8 @@ TEST_F(SpdyNetworkTransactionTest, ConnectFailure) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(connects[index], 1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(connects[index].result, out.rv); } } @@ -1720,7 +1730,8 @@ TEST_F(SpdyNetworkTransactionTest, DecompressFailureOnSynReply) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(ERR_SYN_REPLY_NOT_RECEIVED, out.rv); data->Reset(); @@ -1851,7 +1862,7 @@ TEST_F(SpdyNetworkTransactionTest, BufferFull) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -1957,7 +1968,7 @@ TEST_F(SpdyNetworkTransactionTest, Buffering) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -2074,7 +2085,7 @@ TEST_F(SpdyNetworkTransactionTest, BufferedAll) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -2179,7 +2190,7 @@ TEST_F(SpdyNetworkTransactionTest, BufferedClosed) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -2274,7 +2285,7 @@ TEST_F(SpdyNetworkTransactionTest, BufferedCancelled) { TestCompletionCallback callback; - int rv = trans->Start(&request, &callback, NULL); + int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -2397,7 +2408,7 @@ TEST_F(SpdyNetworkTransactionTest, SettingsSaved) { writes, arraysize(writes))); TransactionHelperResult out = TransactionHelperWithSession(request, data.get(), - NULL, + BoundNetLog(), &session_deps, session.get()); EXPECT_EQ(OK, out.rv); @@ -2514,7 +2525,7 @@ TEST_F(SpdyNetworkTransactionTest, SettingsPlayback) { writes, arraysize(writes))); TransactionHelperResult out = TransactionHelperWithSession(request, data.get(), - NULL, + BoundNetLog(), &session_deps, session.get()); EXPECT_EQ(OK, out.rv); @@ -2562,7 +2573,8 @@ TEST_F(SpdyNetworkTransactionTest, GoAwayWithActiveStream) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(1, reads, arraysize(reads), writes, arraysize(writes))); - TransactionHelperResult out = TransactionHelper(request, data.get(), NULL); + TransactionHelperResult out = TransactionHelper(request, data.get(), + BoundNetLog()); EXPECT_EQ(ERR_CONNECTION_CLOSED, out.rv); } diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index d366fdf..3b818e6 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -967,7 +967,7 @@ void SpdySession::OnSyn(const spdy::SpdySynStreamControlFrame& frame, stream->set_stream_id(stream_id); } else { // TODO(mbelshe): can we figure out how to use a NetLog here? - stream = new SpdyStream(this, stream_id, true, NULL); + stream = new SpdyStream(this, stream_id, true, BoundNetLog()); // A new HttpResponseInfo object needs to be generated so the call to // OnResponseReceived below has something to fill in. diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index 4e95263..433ea8c 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc @@ -127,7 +127,7 @@ TEST_F(SpdySessionTest, GoAway) { EXPECT_TRUE(spdy_session_pool->HasSession(test_host_port_pair)); TCPSocketParams tcp_params(kTestHost, kTestPort, MEDIUM, GURL(), false); - int rv = session->Connect(kTestHost, tcp_params, MEDIUM, NULL); + int rv = session->Connect(kTestHost, tcp_params, MEDIUM, BoundNetLog()); ASSERT_EQ(OK, rv); // Flush the SpdySession::OnReadComplete() task. diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc index b8c4b7f..7a0d9b3 100644 --- a/net/spdy/spdy_stream_unittest.cc +++ b/net/spdy/spdy_stream_unittest.cc @@ -112,7 +112,8 @@ TEST_F(SpdyStreamTest, SendRequest) { TestCompletionCallback callback; HttpResponseInfo response; - scoped_refptr<SpdyStream> stream(new SpdyStream(session, 1, false, NULL)); + scoped_refptr<SpdyStream> stream(new SpdyStream(session, 1, false, + BoundNetLog())); stream->SetRequestInfo(request); EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(NULL, &response, &callback)); diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc index 197a0454..c34c6b6 100644 --- a/net/tools/fetch/fetch_client.cc +++ b/net/tools/fetch/fetch_client.cc @@ -63,7 +63,7 @@ class Client { request_info_.url = url_; request_info_.method = "GET"; int state = transaction_->Start( - &request_info_, &connect_callback_, NULL); + &request_info_, &connect_callback_, net::BoundNetLog()); DCHECK(state == net::ERR_IO_PENDING); }; diff --git a/net/tools/hresolv/hresolv.cc b/net/tools/hresolv/hresolv.cc index 0adc30a..77ea2e5 100644 --- a/net/tools/hresolv/hresolv.cc +++ b/net/tools/hresolv/hresolv.cc @@ -195,7 +195,7 @@ class DelayedResolve : public base::RefCounted<DelayedResolve> { &address_list_, callback, NULL, - NULL); + net::BoundNetLog()); if (rv != net::ERR_IO_PENDING) { OnResolveComplete(rv); } |