diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 04:54:46 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 04:54:46 +0000 |
commit | 684970b638fbfe1a2137fd162f630c86d2859828 (patch) | |
tree | b74fafda6801aa5c9e8746c230b8a2880a1de585 /net | |
parent | c4deb899d3293782beeb8d83eefc226a5fb1813e (diff) | |
download | chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.zip chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.tar.gz chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.tar.bz2 |
LoadLog is used as an output parameter, reorder it to the last parameter.
Review URL: http://codereview.chromium.org/164531
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
43 files changed, 367 insertions, 371 deletions
diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc index 4208492..b953443 100644 --- a/net/base/host_resolver.cc +++ b/net/base/host_resolver.cc @@ -25,10 +25,10 @@ SingleRequestHostResolver::~SingleRequestHostResolver() { } } -int SingleRequestHostResolver::Resolve(LoadLog* load_log, - const HostResolver::RequestInfo& info, +int SingleRequestHostResolver::Resolve(const HostResolver::RequestInfo& info, AddressList* addresses, - CompletionCallback* callback) { + CompletionCallback* callback, + LoadLog* load_log) { DCHECK(!cur_request_ && !cur_request_callback_) << "resolver already in use"; HostResolver::RequestHandle request = NULL; @@ -38,7 +38,7 @@ int SingleRequestHostResolver::Resolve(LoadLog* load_log, CompletionCallback* transient_callback = callback ? &callback_ : NULL; int rv = resolver_->Resolve( - load_log, info, addresses, transient_callback, &request); + info, addresses, transient_callback, &request, load_log); if (rv == ERR_IO_PENDING) { // Cleared in OnResolveCompletion(). diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index b6b4180..bc32c55 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -114,11 +114,11 @@ class HostResolver : public base::RefCounted<HostResolver> { // This handle is not valid after the request has completed. // // Profiling information for the request is saved to |load_log| if non-NULL. - virtual int Resolve(LoadLog* load_log, - const RequestInfo& info, + virtual int Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, - RequestHandle* out_req) = 0; + RequestHandle* out_req, + LoadLog* load_log) = 0; // Cancels the specified request. |req| is the handle returned by Resolve(). // After a request is cancelled, its completion callback will not be called. @@ -152,10 +152,10 @@ class SingleRequestHostResolver { // Resolves the given hostname (or IP address literal), filling out the // |addresses| object upon success. See HostResolver::Resolve() for details. - int Resolve(LoadLog* load_log, - const HostResolver::RequestInfo& info, + int Resolve(const HostResolver::RequestInfo& info, AddressList* addresses, - CompletionCallback* callback); + CompletionCallback* callback, + LoadLog* load_log); private: // Callback for when the request to |resolver_| completes, so we dispatch diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc index 20e57e5..eed116a 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -304,11 +304,11 @@ HostResolverImpl::~HostResolverImpl() { // TODO(eroman): Don't create cache entries for hostnames which are simply IP // address literals. -int HostResolverImpl::Resolve(LoadLog* load_log, - const RequestInfo& info, +int HostResolverImpl::Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, - RequestHandle* out_req) { + RequestHandle* out_req, + LoadLog* load_log) { if (shutdown_) return ERR_UNEXPECTED; diff --git a/net/base/host_resolver_impl.h b/net/base/host_resolver_impl.h index ede3d18..45c8841 100644 --- a/net/base/host_resolver_impl.h +++ b/net/base/host_resolver_impl.h @@ -57,11 +57,11 @@ class HostResolverImpl : public HostResolver { virtual ~HostResolverImpl(); // HostResolver methods: - virtual int Resolve(LoadLog* load_log, - const RequestInfo& info, + virtual int Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, - RequestHandle* out_req); + RequestHandle* out_req, + LoadLog* load_log); virtual void CancelRequest(RequestHandle req); virtual void AddObserver(Observer* observer); virtual void RemoveObserver(Observer* observer); diff --git a/net/base/host_resolver_impl_unittest.cc b/net/base/host_resolver_impl_unittest.cc index c59e477..3fbf041 100644 --- a/net/base/host_resolver_impl_unittest.cc +++ b/net/base/host_resolver_impl_unittest.cc @@ -93,7 +93,7 @@ class ResolveRequest { ALLOW_THIS_IN_INITIALIZER_LIST( callback_(this, &ResolveRequest::OnLookupFinished)) { // Start the request. - int err = resolver->Resolve(NULL, info_, &addrlist_, &callback_, &req_); + int err = resolver->Resolve(info_, &addrlist_, &callback_, &req_, NULL); EXPECT_EQ(net::ERR_IO_PENDING, err); } @@ -104,7 +104,7 @@ class ResolveRequest { ALLOW_THIS_IN_INITIALIZER_LIST( callback_(this, &ResolveRequest::OnLookupFinished)) { // Start the request. - int err = resolver->Resolve(NULL, info, &addrlist_, &callback_, &req_); + int err = resolver->Resolve(info, &addrlist_, &callback_, &req_, NULL); EXPECT_EQ(net::ERR_IO_PENDING, err); } @@ -190,7 +190,7 @@ TEST_F(HostResolverImplTest, SynchronousLookup) { net::HostResolver::RequestInfo info("just.testing", kPortnum); scoped_refptr<LoadLog> log(new LoadLog); - int err = host_resolver->Resolve(log, info, &adrlist, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, log); EXPECT_EQ(net::OK, err); EXPECT_EQ(2u, log->events().size()); @@ -222,7 +222,7 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) { net::HostResolver::RequestInfo info("just.testing", kPortnum); scoped_refptr<LoadLog> log(new LoadLog); - int err = host_resolver->Resolve(log, info, &adrlist, &callback_, NULL); + int err = host_resolver->Resolve(info, &adrlist, &callback_, NULL, log); EXPECT_EQ(net::ERR_IO_PENDING, err); EXPECT_EQ(1u, log->events().size()); @@ -260,7 +260,7 @@ TEST_F(HostResolverImplTest, CanceledAsynchronousLookup) { const int kPortnum = 80; net::HostResolver::RequestInfo info("just.testing", kPortnum); - int err = host_resolver->Resolve(log, info, &adrlist, &callback_, NULL); + int err = host_resolver->Resolve(info, &adrlist, &callback_, NULL, log); EXPECT_EQ(net::ERR_IO_PENDING, err); // Make sure we will exit the queue even when callback is not called. @@ -294,7 +294,7 @@ TEST_F(HostResolverImplTest, NumericIPv4Address) { net::AddressList adrlist; const int kPortnum = 5555; net::HostResolver::RequestInfo info("127.1.2.3", kPortnum); - int err = host_resolver->Resolve(NULL, info, &adrlist, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL); EXPECT_EQ(net::OK, err); const struct addrinfo* ainfo = adrlist.head(); @@ -319,7 +319,7 @@ TEST_F(HostResolverImplTest, NumericIPv6Address) { net::AddressList adrlist; const int kPortnum = 5555; net::HostResolver::RequestInfo info("2001:db8::1", kPortnum); - int err = host_resolver->Resolve(NULL, info, &adrlist, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL); // 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. @@ -359,7 +359,7 @@ TEST_F(HostResolverImplTest, DISABLED_EmptyHost) { net::AddressList adrlist; const int kPortnum = 5555; net::HostResolver::RequestInfo info("", kPortnum); - int err = host_resolver->Resolve(NULL, info, &adrlist, NULL, NULL); + int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL); EXPECT_EQ(net::ERR_NAME_NOT_RESOLVED, err); } @@ -710,7 +710,7 @@ class BypassCacheVerifier : public ResolveRequest::Delegate { net::AddressList addrlist; net::HostResolver::RequestInfo info("a", 70); - int error = resolver->Resolve(NULL, info, &addrlist, junk_callback, NULL); + int error = resolver->Resolve(info, &addrlist, junk_callback, NULL, NULL); EXPECT_EQ(net::OK, error); // Ok good. Now make sure that if we ask to bypass the cache, it can no @@ -828,7 +828,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host1". net::HostResolver::RequestInfo info1("host1", 70); scoped_refptr<LoadLog> log(new LoadLog); - int rv = host_resolver->Resolve(log, info1, &addrlist, NULL, NULL); + int rv = host_resolver->Resolve(info1, &addrlist, NULL, NULL, log); EXPECT_EQ(net::OK, rv); EXPECT_EQ(6u, log->events().size()); @@ -856,7 +856,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(NULL, info1, &addrlist, &callback, NULL); + rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, NULL); ASSERT_EQ(net::OK, rv); // Should complete synchronously. EXPECT_EQ(2U, observer.start_log.size()); @@ -870,7 +870,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host2", setting referrer to "http://foobar.com" net::HostResolver::RequestInfo info2("host2", 70); info2.set_referrer(GURL("http://foobar.com")); - rv = host_resolver->Resolve(NULL, info2, &addrlist, NULL, NULL); + rv = host_resolver->Resolve(info2, &addrlist, NULL, NULL, NULL); EXPECT_EQ(net::OK, rv); EXPECT_EQ(3U, observer.start_log.size()); @@ -886,7 +886,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host3" net::HostResolver::RequestInfo info3("host3", 70); - host_resolver->Resolve(NULL, info3, &addrlist, NULL, NULL); + host_resolver->Resolve(info3, &addrlist, NULL, NULL, NULL); // No effect this time, since observer was removed. EXPECT_EQ(3U, observer.start_log.size()); @@ -916,7 +916,7 @@ TEST_F(HostResolverImplTest, CancellationObserver) { net::HostResolver::RequestInfo info1("host1", 70); net::HostResolver::RequestHandle req = NULL; net::AddressList addrlist; - int rv = host_resolver->Resolve(NULL, info1, &addrlist, &callback, &req); + int rv = host_resolver->Resolve(info1, &addrlist, &callback, &req, NULL); EXPECT_EQ(net::ERR_IO_PENDING, rv); EXPECT_TRUE(NULL != req); @@ -939,7 +939,7 @@ TEST_F(HostResolverImplTest, CancellationObserver) { // Start an async request for (host2:60) net::HostResolver::RequestInfo info2("host2", 60); - rv = host_resolver->Resolve(NULL, info2, &addrlist, &callback, NULL); + rv = host_resolver->Resolve(info2, &addrlist, &callback, NULL, NULL); EXPECT_EQ(net::ERR_IO_PENDING, rv); EXPECT_TRUE(NULL != req); diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index eeabb39..3c09e15 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -42,16 +42,16 @@ MockHostResolverBase::MockHostResolverBase(bool use_caching) Reset(NULL); } -int MockHostResolverBase::Resolve(LoadLog* load_log, - const RequestInfo& info, +int MockHostResolverBase::Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, - RequestHandle* out_req) { + RequestHandle* out_req, + LoadLog* load_log) { if (synchronous_mode_) { callback = NULL; out_req = NULL; } - return impl_->Resolve(load_log, info, addresses, callback, out_req); + return impl_->Resolve(info, addresses, callback, out_req, load_log); } void MockHostResolverBase::CancelRequest(RequestHandle req) { diff --git a/net/base/mock_host_resolver.h b/net/base/mock_host_resolver.h index 2dd97b9..548cd0a 100644 --- a/net/base/mock_host_resolver.h +++ b/net/base/mock_host_resolver.h @@ -41,11 +41,11 @@ class MockHostResolverBase : public HostResolver { virtual ~MockHostResolverBase() {} // HostResolver methods: - virtual int Resolve(LoadLog* load_log, - const RequestInfo& info, + virtual int Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, - RequestHandle* out_req); + RequestHandle* out_req, + LoadLog* load_log); virtual void CancelRequest(RequestHandle req); virtual void AddObserver(Observer* observer); virtual void RemoveObserver(Observer* observer); diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc index b5b06fe..ef896b8 100644 --- a/net/ftp/ftp_network_transaction.cc +++ b/net/ftp/ftp_network_transaction.cc @@ -50,9 +50,9 @@ FtpNetworkTransaction::FtpNetworkTransaction( FtpNetworkTransaction::~FtpNetworkTransaction() { } -int FtpNetworkTransaction::Start(LoadLog* load_log, - const FtpRequestInfo* request_info, - CompletionCallback* callback) { +int FtpNetworkTransaction::Start(const FtpRequestInfo* request_info, + CompletionCallback* callback, + LoadLog* load_log) { load_log_ = load_log; request_ = request_info; @@ -410,7 +410,7 @@ int FtpNetworkTransaction::DoCtrlResolveHost() { HostResolver::RequestInfo info(host, port); // No known referrer. - return resolver_.Resolve(load_log_, info, &addresses_, &io_callback_); + return resolver_.Resolve(info, &addresses_, &io_callback_, load_log_); } int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { @@ -935,7 +935,7 @@ int FtpNetworkTransaction::DoDataResolveHost() { HostResolver::RequestInfo info(data_connection_ip_, data_connection_port_); // No known referrer. - return resolver_.Resolve(load_log_, info, &addresses_, &io_callback_); + return resolver_.Resolve(info, &addresses_, &io_callback_, load_log_); } int FtpNetworkTransaction::DoDataResolveHostComplete(int result) { diff --git a/net/ftp/ftp_network_transaction.h b/net/ftp/ftp_network_transaction.h index 1a9c521f..447d271 100644 --- a/net/ftp/ftp_network_transaction.h +++ b/net/ftp/ftp_network_transaction.h @@ -31,9 +31,9 @@ class FtpNetworkTransaction : public FtpTransaction { virtual ~FtpNetworkTransaction(); // FtpTransaction methods: - virtual int Start(LoadLog* load_log, - const FtpRequestInfo* request_info, - CompletionCallback* callback); + virtual int Start(const FtpRequestInfo* request_info, + CompletionCallback* callback, + LoadLog* load_log); virtual int Stop(int error); virtual int RestartWithAuth(const std::wstring& username, const std::wstring& password, diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc index 9ee5d50..032227e 100644 --- a/net/ftp/ftp_network_transaction_unittest.cc +++ b/net/ftp/ftp_network_transaction_unittest.cc @@ -311,7 +311,7 @@ class FtpNetworkTransactionTest : public PlatformTest { FtpRequestInfo request_info = GetRequestInfo(request); EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState()); ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(NULL, &request_info, &callback_)); + transaction_.Start(&request_info, &callback_, NULL)); EXPECT_NE(LOAD_STATE_IDLE, transaction_.GetLoadState()); EXPECT_EQ(expected_result, callback_.WaitForResult()); EXPECT_EQ(FtpMockControlSocket::QUIT, ctrl_socket->state()); @@ -349,7 +349,7 @@ TEST_F(FtpNetworkTransactionTest, FailedLookup) { host_resolver_->rules()->AddSimulatedFailure("badhost"); EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState()); ASSERT_EQ(ERR_IO_PENDING, - transaction_.Start(NULL, &request_info, &callback_)); + transaction_.Start(&request_info, &callback_, NULL)); EXPECT_EQ(ERR_NAME_NOT_RESOLVED, callback_.WaitForResult()); EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState()); } diff --git a/net/ftp/ftp_transaction.h b/net/ftp/ftp_transaction.h index d0620f6..3d629746 100644 --- a/net/ftp/ftp_transaction.h +++ b/net/ftp/ftp_transaction.h @@ -36,9 +36,9 @@ class FtpTransaction { // NOTE: The transaction is not responsible for deleting the callback object. // // Profiling information for the request is saved to |load_log| if non-NULL. - virtual int Start(LoadLog* load_log, - const FtpRequestInfo* request_info, - CompletionCallback* callback) = 0; + virtual int Start(const FtpRequestInfo* request_info, + CompletionCallback* callback, + LoadLog* load_log) = 0; // Restarts the FTP transaction with authentication credentials. virtual int RestartWithAuth(const std::wstring& username, diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 5265ca7..f40f463 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -194,7 +194,7 @@ class HttpCache::Transaction virtual ~Transaction(); // HttpTransaction methods: - virtual int Start(LoadLog*, const HttpRequestInfo*, CompletionCallback*); + virtual int Start(const HttpRequestInfo*, CompletionCallback*, LoadLog*); virtual int RestartIgnoringLastError(CompletionCallback*); virtual int RestartWithCertificate(X509Certificate* client_cert, CompletionCallback* callback); @@ -410,9 +410,9 @@ HttpCache::Transaction::~Transaction() { cache_ = NULL; } -int HttpCache::Transaction::Start(LoadLog* load_log, - const HttpRequestInfo* request, - CompletionCallback* callback) { +int HttpCache::Transaction::Start(const HttpRequestInfo* request, + CompletionCallback* callback, + LoadLog* load_log) { DCHECK(request); DCHECK(callback); @@ -982,7 +982,7 @@ int HttpCache::Transaction::BeginNetworkRequest() { if (!network_trans_.get()) return net::ERR_CACHE_CANNOT_CREATE_NETWORK_TRANSACTION; - int rv = network_trans_->Start(load_log_, request_, &network_info_callback_); + int rv = network_trans_->Start(request_, &network_info_callback_, load_log_); if (rv != ERR_IO_PENDING) OnNetworkInfoAvailable(rv); return rv; diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index a7b93e0..482b463 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -394,7 +394,7 @@ void RunTransactionTestWithRequest(net::HttpCache* cache, scoped_ptr<net::HttpTransaction> trans(cache->CreateTransaction()); ASSERT_TRUE(trans.get()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -680,7 +680,7 @@ TEST(HttpCache, SimpleGET_LoadOnlyFromCache_Miss) { cache.http_cache()->CreateTransaction()); ASSERT_TRUE(trans.get()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::ERR_CACHE_MISS, rv); @@ -837,7 +837,7 @@ TEST(HttpCache, SimpleGET_ManyReaders) { new Context(cache.http_cache()->CreateTransaction())); Context* c = context_list[i]; - int rv = c->trans->Start(NULL, &request, &c->callback); + int rv = c->trans->Start(&request, &c->callback, NULL); if (rv != net::ERR_IO_PENDING) c->result = rv; } @@ -891,7 +891,7 @@ TEST(HttpCache, SimpleGET_RacingReaders) { if (i == 1 || i == 2) this_request = &reader_request; - int rv = c->trans->Start(NULL, this_request, &c->callback); + int rv = c->trans->Start(this_request, &c->callback, NULL); if (rv != net::ERR_IO_PENDING) c->result = rv; } @@ -963,7 +963,7 @@ TEST(HttpCache, FastNoStoreGET_DoneWithPending) { new Context(cache.http_cache()->CreateTransaction())); Context* c = context_list[i]; - int rv = c->trans->Start(NULL, &request, &c->callback); + int rv = c->trans->Start(&request, &c->callback, NULL); if (rv != net::ERR_IO_PENDING) c->result = rv; } @@ -1006,7 +1006,7 @@ TEST(HttpCache, SimpleGET_ManyWriters_CancelFirst) { new Context(cache.http_cache()->CreateTransaction())); Context* c = context_list[i]; - int rv = c->trans->Start(NULL, &request, &c->callback); + int rv = c->trans->Start(&request, &c->callback, NULL); if (rv != net::ERR_IO_PENDING) c->result = rv; } @@ -1058,7 +1058,7 @@ TEST(HttpCache, SimpleGET_AbandonedCacheRead) { scoped_ptr<net::HttpTransaction> trans( cache.http_cache()->CreateTransaction()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -1573,7 +1573,7 @@ TEST(HttpCache, SimplePOST_LoadOnlyFromCache_Miss) { cache.http_cache()->CreateTransaction()); ASSERT_TRUE(trans.get()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::ERR_CACHE_MISS, rv); @@ -1977,13 +1977,13 @@ TEST(HttpCache, SyncRead) { c2(cache.http_cache()), c3(cache.http_cache()); - c1.Start(NULL, &r1); + c1.Start(&r1, NULL); r2.load_flags |= net::LOAD_ONLY_FROM_CACHE; - c2.Start(NULL, &r2); + c2.Start(&r2, NULL); r3.load_flags |= net::LOAD_ONLY_FROM_CACHE; - c3.Start(NULL, &r3); + c3.Start(&r3, NULL); MessageLoop::current()->Run(); @@ -2030,7 +2030,7 @@ TEST(HttpCache, CachedRedirect) { cache.http_cache()->CreateTransaction()); ASSERT_TRUE(trans.get()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -2057,7 +2057,7 @@ TEST(HttpCache, CachedRedirect) { cache.http_cache()->CreateTransaction()); ASSERT_TRUE(trans.get()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); @@ -2184,7 +2184,7 @@ TEST(HttpCache, SimpleGET_SSLError) { cache.http_cache()->CreateTransaction()); ASSERT_TRUE(trans.get()); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::ERR_CACHE_MISS, rv); diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc index 064a8e4..d70aa65 100644 --- a/net/http/http_network_layer_unittest.cc +++ b/net/http/http_network_layer_unittest.cc @@ -69,7 +69,7 @@ TEST_F(HttpNetworkLayerTest, GET) { request_info.user_agent = "Foo/1.0"; request_info.load_flags = net::LOAD_NORMAL; - int rv = trans->Start(NULL, &request_info, &callback); + int rv = trans->Start(&request_info, &callback, NULL); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); ASSERT_EQ(net::OK, rv); diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 4b44cdc..0c0bc48 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -161,9 +161,9 @@ HttpNetworkTransaction::HttpNetworkTransaction(HttpNetworkSession* session, #endif } -int HttpNetworkTransaction::Start(LoadLog* load_log, - const HttpRequestInfo* request_info, - CompletionCallback* callback) { +int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, + CompletionCallback* callback, + LoadLog* load_log) { UpdateConnectionTypeHistograms(CONNECTION_ANY); load_log_ = load_log; @@ -542,7 +542,7 @@ int HttpNetworkTransaction::DoResolveProxy() { } return session_->proxy_service()->ResolveProxy( - load_log_, request_->url, &proxy_info_, &io_callback_, &pac_request_); + request_->url, &proxy_info_, &io_callback_, &pac_request_, load_log_); } int HttpNetworkTransaction::DoResolveProxyComplete(int result) { @@ -629,8 +629,8 @@ int HttpNetworkTransaction::DoInitConnection() { transport_socket_request_time_ = base::TimeTicks::Now(); - int rv = connection_.Init(NULL, connection_group, resolve_info, - request_->priority, &io_callback_); + int rv = connection_.Init(connection_group, resolve_info, + request_->priority, &io_callback_, NULL); return rv; } @@ -1549,7 +1549,7 @@ int HttpNetworkTransaction::ReconsiderProxyAfterError(int error) { } int rv = session_->proxy_service()->ReconsiderProxyAfterError( - load_log_, request_->url, &proxy_info_, &io_callback_, &pac_request_); + request_->url, &proxy_info_, &io_callback_, &pac_request_, load_log_); if (rv == OK || rv == ERR_IO_PENDING) { // If the error was during connection setup, there is no socket to // disconnect. diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 5f489fc..0c5f014 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -41,9 +41,9 @@ class HttpNetworkTransaction : public HttpTransaction { virtual ~HttpNetworkTransaction(); // HttpTransaction methods: - virtual int Start(LoadLog* load_log, - const HttpRequestInfo* request_info, - CompletionCallback* callback); + virtual int Start(const HttpRequestInfo* request_info, + CompletionCallback* callback, + LoadLog* load_log); virtual int RestartIgnoringLastError(CompletionCallback* callback); virtual int RestartWithCertificate(X509Certificate* client_cert, CompletionCallback* callback); diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 28465b3..91c0d0b 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -96,7 +96,7 @@ class HttpNetworkTransactionTest : public PlatformTest { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); out.rv = callback.WaitForResult(); @@ -169,12 +169,12 @@ class CaptureGroupNameSocketPool : public ClientSocketPool { public: CaptureGroupNameSocketPool() { } - virtual int RequestSocket(LoadLog* load_log, - const std::string& group_name, + virtual int RequestSocket(const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback) { + CompletionCallback* callback, + LoadLog* load_log) { last_group_name_ = group_name; return ERR_IO_PENDING; } @@ -352,7 +352,7 @@ TEST_F(HttpNetworkTransactionTest, Head) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -410,7 +410,7 @@ TEST_F(HttpNetworkTransactionTest, ReuseConnection) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -454,7 +454,7 @@ TEST_F(HttpNetworkTransactionTest, Ignores100) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -498,7 +498,7 @@ TEST_F(HttpNetworkTransactionTest, Ignores1xx) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -554,7 +554,7 @@ void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest( scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(session, &session_deps.socket_factory)); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -606,7 +606,7 @@ TEST_F(HttpNetworkTransactionTest, NonKeepAliveConnectionReset) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -693,7 +693,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuth) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -769,7 +769,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -848,7 +848,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -930,7 +930,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1011,7 +1011,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1093,7 +1093,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -1146,7 +1146,7 @@ void HttpNetworkTransactionTest::ConnectStatusHelperWithExpectedStatus( TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -1406,7 +1406,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1541,7 +1541,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth1) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1715,7 +1715,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1810,7 +1810,7 @@ TEST_F(HttpNetworkTransactionTest, LargeHeadersNoBody) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -1858,7 +1858,7 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -1908,7 +1908,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocket) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -1966,7 +1966,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2060,7 +2060,7 @@ TEST_F(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request[i], &callback); + int rv = trans->Start(&request[i], &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2135,7 +2135,7 @@ TEST_F(HttpNetworkTransactionTest, AuthIdentityInUrl) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2211,7 +2211,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2295,7 +2295,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2360,7 +2360,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2421,7 +2421,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2508,7 +2508,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { TestCompletionCallback callback1; - int rv = trans->Start(NULL, &request, &callback1); + int rv = trans->Start(&request, &callback1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback1.WaitForResult(); @@ -2645,7 +2645,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificate) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2721,7 +2721,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { CreateSession(&session_deps), &session_deps.socket_factory)); - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2772,7 +2772,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_UserAgent) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2812,7 +2812,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_Referer) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2850,7 +2850,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_PostContentLengthZero) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2888,7 +2888,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_PutContentLengthZero) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2926,7 +2926,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_HeadContentLengthZero) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -2966,7 +2966,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_CacheControlNoCache) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3006,7 +3006,7 @@ TEST_F(HttpNetworkTransactionTest, TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3045,7 +3045,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3090,7 +3090,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3148,7 +3148,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3207,7 +3207,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3270,7 +3270,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3350,7 +3350,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(NULL, &request, &callback)); + EXPECT_EQ(ERR_IO_PENDING, trans->Start(&request, &callback, NULL)); EXPECT_EQ(tests[i].expected_group_name, conn_pool->last_group_name_received()); } @@ -3373,7 +3373,7 @@ TEST_F(HttpNetworkTransactionTest, ReconsiderProxyAfterFailedConnection) { TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -3449,7 +3449,7 @@ TEST_F(HttpNetworkTransactionTest, ResolveMadeWithReferrer) { // Run the request until it fails reading from the socket. TestCompletionCallback callback; - int rv = trans->Start(NULL, &request, &callback); + int rv = trans->Start(&request, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); EXPECT_EQ(ERR_FAILED, rv); @@ -3473,16 +3473,16 @@ TEST_F(HttpNetworkTransactionTest, BypassHostCacheOnRefresh) { // a synchronous lookup.) AddressList addrlist; int rv = session_deps.host_resolver->Resolve( - NULL, HostResolver::RequestInfo("www.google.com", 80), &addrlist, - NULL, NULL); + HostResolver::RequestInfo("www.google.com", 80), &addrlist, + NULL, NULL, NULL); EXPECT_EQ(OK, rv); // Verify that it was added to host cache, by doing a subsequent async lookup // and confirming it completes synchronously. TestCompletionCallback resolve_callback; - rv = session_deps.host_resolver->Resolve(NULL, + rv = session_deps.host_resolver->Resolve( HostResolver::RequestInfo("www.google.com", 80), &addrlist, - &resolve_callback, NULL); + &resolve_callback, NULL, NULL); ASSERT_EQ(OK, rv); // Inject a failure the next time that "www.google.com" is resolved. This way @@ -3504,7 +3504,7 @@ TEST_F(HttpNetworkTransactionTest, BypassHostCacheOnRefresh) { // Run the request. TestCompletionCallback callback; - rv = trans->Start(NULL, &request, &callback); + rv = trans->Start(&request, &callback, NULL); ASSERT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); diff --git a/net/http/http_transaction.h b/net/http/http_transaction.h index 962a7ac..9dfd658 100644 --- a/net/http/http_transaction.h +++ b/net/http/http_transaction.h @@ -38,9 +38,9 @@ class HttpTransaction { // NOTE: The transaction is not responsible for deleting the callback object. // // Profiling information for the request is saved to |load_log| if non-NULL. - virtual int Start(LoadLog* load_log, - const HttpRequestInfo* request_info, - CompletionCallback* callback) = 0; + virtual int Start(const HttpRequestInfo* request_info, + CompletionCallback* callback, + LoadLog* load_log) = 0; // Restarts the HTTP transaction, ignoring the last error. This call can // only be made after a call to Start (or RestartIgnoringLastError) failed. diff --git a/net/http/http_transaction_unittest.h b/net/http/http_transaction_unittest.h index 7aee84f..aef6693 100644 --- a/net/http/http_transaction_unittest.h +++ b/net/http/http_transaction_unittest.h @@ -108,9 +108,9 @@ class TestTransactionConsumer : public CallbackRunner< Tuple1<int> > { ~TestTransactionConsumer() { } - void Start(net::LoadLog* load_log, const net::HttpRequestInfo* request) { + void Start(const net::HttpRequestInfo* request, net::LoadLog* load_log) { state_ = STARTING; - int result = trans_->Start(load_log, request, this); + int result = trans_->Start(request, this, load_log); if (result != net::ERR_IO_PENDING) DidStart(result); } @@ -199,9 +199,9 @@ class MockNetworkTransaction : public net::HttpTransaction { ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)), data_cursor_(0) { } - virtual int Start(net::LoadLog* load_log, - const net::HttpRequestInfo* request, - net::CompletionCallback* callback) { + virtual int Start(const net::HttpRequestInfo* request, + net::CompletionCallback* callback, + net::LoadLog* load_log) { const MockTransaction* t = FindMockTransaction(request->url); if (!t) return net::ERR_FAILED; diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc index 723c91e..94d6448 100644 --- a/net/proxy/proxy_resolver_js_bindings.cc +++ b/net/proxy/proxy_resolver_js_bindings.cc @@ -38,7 +38,7 @@ class SyncHostResolverBridge // Hack for tests -- run synchronously on current thread. if (!host_resolver_loop_) - return host_resolver_->Resolve(NULL, info, addresses, NULL, NULL); + return host_resolver_->Resolve(info, addresses, NULL, NULL, NULL); // Otherwise start an async resolve on the resolver's thread. host_resolver_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, @@ -55,7 +55,7 @@ class SyncHostResolverBridge net::AddressList* addresses) { DCHECK_EQ(host_resolver_loop_, MessageLoop::current()); int error = host_resolver_->Resolve( - NULL, info, addresses, &callback_, NULL); + info, addresses, &callback_, NULL, NULL); if (error != ERR_IO_PENDING) OnResolveCompletion(error); // Completed synchronously. } diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index 43b7cfe..43e6808 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -246,11 +246,11 @@ ProxyService* ProxyService::CreateNull() { return new ProxyService(new ProxyConfigServiceNull, new ProxyResolverNull); } -int ProxyService::ResolveProxy(LoadLog* load_log, - const GURL& raw_url, +int ProxyService::ResolveProxy(const GURL& raw_url, ProxyInfo* result, CompletionCallback* callback, - PacRequest** pac_request) { + PacRequest** pac_request, + LoadLog* load_log) { DCHECK(callback); // Strip away any reference fragments and the username/password, as they @@ -405,11 +405,11 @@ void ProxyService::OnInitProxyResolverComplete(int result) { ResumeAllPendingRequests(); } -int ProxyService::ReconsiderProxyAfterError(LoadLog* load_log, - const GURL& url, +int ProxyService::ReconsiderProxyAfterError(const GURL& url, ProxyInfo* result, CompletionCallback* callback, - PacRequest** pac_request) { + PacRequest** pac_request, + LoadLog* load_log) { // Check to see if we have a new config since ResolveProxy was called. We // want to re-run ResolveProxy in two cases: 1) we have a new config, or 2) a // direct connection failed and we never tried the current config. @@ -432,7 +432,7 @@ int ProxyService::ReconsiderProxyAfterError(LoadLog* load_log, // If we have a new config or the config was never tried, we delete the // list of bad proxies and we try again. proxy_retry_info_.clear(); - return ResolveProxy(load_log, url, result, callback, pac_request); + return ResolveProxy(url, result, callback, pac_request, load_log); } // We don't have new proxy settings to try, fallback to the next proxy @@ -702,13 +702,13 @@ SyncProxyServiceHelper::SyncProxyServiceHelper(MessageLoop* io_message_loop, DCHECK(io_message_loop_ != MessageLoop::current()); } -int SyncProxyServiceHelper::ResolveProxy(LoadLog* load_log, - const GURL& url, - ProxyInfo* proxy_info) { +int SyncProxyServiceHelper::ResolveProxy(const GURL& url, + ProxyInfo* proxy_info, + LoadLog* load_log) { DCHECK(io_message_loop_ != MessageLoop::current()); io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( - this, &SyncProxyServiceHelper::StartAsyncResolve, load_log, url)); + this, &SyncProxyServiceHelper::StartAsyncResolve, url, load_log)); event_.Wait(); @@ -719,11 +719,11 @@ int SyncProxyServiceHelper::ResolveProxy(LoadLog* load_log, } int SyncProxyServiceHelper::ReconsiderProxyAfterError( - LoadLog* load_log, const GURL& url, ProxyInfo* proxy_info) { + const GURL& url, ProxyInfo* proxy_info, LoadLog* load_log) { DCHECK(io_message_loop_ != MessageLoop::current()); io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( - this, &SyncProxyServiceHelper::StartAsyncReconsider, load_log, url)); + this, &SyncProxyServiceHelper::StartAsyncReconsider, url, load_log)); event_.Wait(); @@ -733,19 +733,19 @@ int SyncProxyServiceHelper::ReconsiderProxyAfterError( return result_; } -void SyncProxyServiceHelper::StartAsyncResolve(LoadLog* load_log, - const GURL& url) { +void SyncProxyServiceHelper::StartAsyncResolve(const GURL& url, + LoadLog* load_log) { result_ = proxy_service_->ResolveProxy( - load_log, url, &proxy_info_, &callback_, NULL); + url, &proxy_info_, &callback_, NULL, load_log); if (result_ != net::ERR_IO_PENDING) { OnCompletion(result_); } } -void SyncProxyServiceHelper::StartAsyncReconsider(LoadLog* load_log, - const GURL& url) { +void SyncProxyServiceHelper::StartAsyncReconsider(const GURL& url, + LoadLog* load_log) { result_ = proxy_service_->ReconsiderProxyAfterError( - load_log, url, &proxy_info_, &callback_, NULL); + url, &proxy_info_, &callback_, NULL, load_log); if (result_ != net::ERR_IO_PENDING) { OnCompletion(result_); } diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index 12b5262..994cb5a 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -64,11 +64,11 @@ class ProxyService { // 3. named proxy // // Profiling information for the request is saved to |load_log| if non-NULL. - int ResolveProxy(LoadLog* load_log, - const GURL& url, + int ResolveProxy(const GURL& url, ProxyInfo* results, CompletionCallback* callback, - PacRequest** pac_request); + PacRequest** pac_request, + LoadLog* load_log); // This method is called after a failure to connect or resolve a host name. // It gives the proxy service an opportunity to reconsider the proxy to use. @@ -82,11 +82,11 @@ class ProxyService { // Returns ERR_FAILED if there is not another proxy config to try. // // Profiling information for the request is saved to |load_log| if non-NULL. - int ReconsiderProxyAfterError(LoadLog* load_log, - const GURL& url, + int ReconsiderProxyAfterError(const GURL& url, ProxyInfo* results, CompletionCallback* callback, - PacRequest** pac_request); + PacRequest** pac_request, + LoadLog* load_log); // Call this method with a non-null |pac_request| to cancel the PAC request. void CancelPacRequest(PacRequest* pac_request); @@ -266,14 +266,13 @@ class SyncProxyServiceHelper SyncProxyServiceHelper(MessageLoop* io_message_loop, ProxyService* proxy_service); - int ResolveProxy(LoadLog* load_log, const GURL& url, ProxyInfo* proxy_info); - int ReconsiderProxyAfterError(LoadLog* load_log, - const GURL& url, - ProxyInfo* proxy_info); + int ResolveProxy(const GURL& url, ProxyInfo* proxy_info, LoadLog* load_log); + int ReconsiderProxyAfterError(const GURL& url, + ProxyInfo* proxy_info, LoadLog* load_log); private: - void StartAsyncResolve(LoadLog* load_log, const GURL& url); - void StartAsyncReconsider(LoadLog* load_log, const GURL& url); + void StartAsyncResolve(const GURL& url, LoadLog* load_log); + void StartAsyncReconsider(const GURL& url, LoadLog* load_log); void OnCompletion(int result); diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc index 8a2fb98..3fde148 100644 --- a/net/proxy/proxy_service_unittest.cc +++ b/net/proxy/proxy_service_unittest.cc @@ -92,7 +92,7 @@ TEST(ProxyServiceTest, Direct) { ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL); + int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(resolver->pending_requests().empty()); @@ -111,7 +111,7 @@ TEST(ProxyServiceTest, PAC) { ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL); + int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -144,7 +144,7 @@ TEST(ProxyServiceTest, PAC_NoIdentityOrHash) { ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL); + int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -171,7 +171,7 @@ TEST(ProxyServiceTest, PAC_FailoverToDirect) { ProxyInfo info; TestCompletionCallback callback1; - int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL); + int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -191,7 +191,7 @@ TEST(ProxyServiceTest, PAC_FailoverToDirect) { // Now, imagine that connecting to foopy:8080 fails. TestCompletionCallback callback2; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -213,7 +213,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) { GURL url("http://www.google.com/"); ProxyInfo info; TestCompletionCallback callback1; - int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL); + int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -231,7 +231,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) { // The second resolve request will automatically select direct connect, // because it has cached the configuration as being bad. TestCompletionCallback callback2; - rv = service.ResolveProxy(NULL, url, &info, &callback2, NULL); + rv = service.ResolveProxy(url, &info, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); EXPECT_TRUE(resolver->pending_requests().empty()); @@ -239,7 +239,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) { // But, if that fails, then we should give the proxy config another shot // since we have never tried it with this URL before. TestCompletionCallback callback3; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback3, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -270,7 +270,7 @@ TEST(ProxyServiceTest, ProxyFallback) { // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL); + int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -292,14 +292,14 @@ TEST(ProxyServiceTest, ProxyFallback) { // Fake an error on the proxy. TestCompletionCallback callback2; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); // The second proxy should be specified. EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); TestCompletionCallback callback3; - rv = service.ResolveProxy(NULL, url, &info, &callback3, NULL); + rv = service.ResolveProxy(url, &info, &callback3, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -317,19 +317,19 @@ TEST(ProxyServiceTest, ProxyFallback) { // We fake another error. It should now try the third one. TestCompletionCallback callback4; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback4, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); // Fake another error, the last proxy is gone, the list should now be empty. TestCompletionCallback callback5; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback5, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback5, NULL, NULL); EXPECT_EQ(OK, rv); // We try direct. EXPECT_TRUE(info.is_direct()); // If it fails again, we don't have anything else to try. TestCompletionCallback callback6; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback6, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback6, NULL, NULL); EXPECT_EQ(ERR_FAILED, rv); // TODO(nsylvain): Test that the proxy can be retried after the delay. @@ -350,7 +350,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL); + int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -375,7 +375,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { config_service->config.pac_url = GURL("http://foopy-new/proxy.pac"); TestCompletionCallback callback2; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy-new/proxy.pac"), @@ -395,7 +395,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { // We fake another error. It should now ignore the first one. TestCompletionCallback callback3; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback3, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); @@ -405,7 +405,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) { // We fake another error. It should go back to the first proxy. TestCompletionCallback callback4; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback4, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy-new2/proxy.pac"), @@ -438,7 +438,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // Get the proxy information. ProxyInfo info; TestCompletionCallback callback1; - int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL); + int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(GURL("http://foopy/proxy.pac"), @@ -458,7 +458,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // Fake a proxy error. TestCompletionCallback callback2; - rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL); + rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); // The first proxy is ignored, and the second one is selected. @@ -468,7 +468,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // Fake a PAC failure. ProxyInfo info2; TestCompletionCallback callback3; - rv = service.ResolveProxy(NULL, url, &info2, &callback3, NULL); + rv = service.ResolveProxy(url, &info2, &callback3, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -487,7 +487,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // to check the config since everything works. ProxyInfo info3; TestCompletionCallback callback4; - rv = service.ResolveProxy(NULL, url, &info3, &callback4, NULL); + rv = service.ResolveProxy(url, &info3, &callback4, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info3.is_direct()); @@ -495,7 +495,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) { // resolve the proxy before, and if not (like in this case), we give the // PAC another try. TestCompletionCallback callback5; - rv = service.ReconsiderProxyAfterError(NULL, url, &info3, &callback5, NULL); + rv = service.ReconsiderProxyAfterError(url, &info3, &callback5, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -526,7 +526,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { GURL url("http://www.google.com/"); // Get the proxy information. TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL); + int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); } @@ -536,7 +536,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { new MockAsyncProxyResolver()); GURL test_url("http://local"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -549,7 +549,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { new MockAsyncProxyResolver); GURL test_url("http://www.webkit.org"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -563,7 +563,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { new MockAsyncProxyResolver); GURL test_url("http://74.125.19.147"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -576,7 +576,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { new MockAsyncProxyResolver); GURL test_url("http://www.msn.com"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); } @@ -589,7 +589,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { new MockAsyncProxyResolver); GURL test_url("http://www.msnbc.msn.com"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -602,7 +602,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { new MockAsyncProxyResolver); GURL test_url("HTTP://WWW.MSNBC.MSN.COM"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -624,21 +624,21 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) { { GURL test_url("http://www.example.com:99"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } { GURL test_url("http://www.example.com:100"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); } { GURL test_url("http://www.example.com"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); } @@ -651,7 +651,7 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) { new MockAsyncProxyResolver); GURL test_url("http://www.example.com"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -663,7 +663,7 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) { new MockAsyncProxyResolver); GURL test_url("http://www.example.com:99"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -677,14 +677,14 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) { { GURL test_url("http://[3ffe:2a00:100:7031::1]:99/"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } { GURL test_url("http://[3ffe:2a00:100:7031::1]/"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); } @@ -701,14 +701,14 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) { { GURL test_url("http://[3ffe:2a00:100:7031::1]:99/"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } { GURL test_url("http://[3ffe:2a00:100:7031::1]/"); TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); } @@ -725,7 +725,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { GURL test_url("http://www.msn.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -736,7 +736,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { GURL test_url("ftp://ftp.google.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info.is_direct()); EXPECT_EQ("direct://", info.proxy_server().ToURI()); @@ -747,7 +747,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { GURL test_url("https://webbranch.techcu.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI()); @@ -759,7 +759,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { GURL test_url("http://www.microsoft.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -781,7 +781,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { GURL test_url("http://www.msn.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -792,7 +792,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { GURL test_url("ftp://ftp.google.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI()); @@ -803,7 +803,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { GURL test_url("https://webbranch.techcu.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI()); @@ -814,7 +814,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) { GURL test_url("unknown://www.microsoft.com"); ProxyInfo info; TestCompletionCallback callback; - int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL); + int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(info.is_direct()); EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI()); @@ -835,7 +835,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info1, &callback1, NULL); + GURL("http://request1"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Nothing has been sent to the proxy resolver yet, since the proxy @@ -854,7 +854,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) { TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info2, &callback2, &request2); + GURL("http://request2"), &info2, &callback2, &request2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(2u, resolver->pending_requests().size()); EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url()); @@ -862,7 +862,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) { ProxyInfo info3; TestCompletionCallback callback3; rv = service.ResolveProxy( - NULL, GURL("http://request3"), &info3, &callback3, NULL); + GURL("http://request3"), &info3, &callback3, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(3u, resolver->pending_requests().size()); EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[2]->url()); @@ -912,7 +912,7 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info1, &callback1, NULL); + GURL("http://request1"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // The first request should have triggered download of PAC script. @@ -922,13 +922,13 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) { ProxyInfo info2; TestCompletionCallback callback2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info2, &callback2, NULL); + GURL("http://request2"), &info2, &callback2, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info3; TestCompletionCallback callback3; rv = service.ResolveProxy( - NULL, GURL("http://request3"), &info3, &callback3, NULL); + GURL("http://request3"), &info3, &callback3, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Nothing has been sent to the resolver yet. @@ -990,7 +990,7 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) { TestCompletionCallback callback1; ProxyService::PacRequest* request1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info1, &callback1, &request1); + GURL("http://request1"), &info1, &callback1, &request1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // The first request should have triggered download of PAC script. @@ -1001,13 +1001,13 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) { TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info2, &callback2, &request2); + GURL("http://request2"), &info2, &callback2, &request2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info3; TestCompletionCallback callback3; rv = service.ResolveProxy( - NULL, GURL("http://request3"), &info3, &callback3, NULL); + GURL("http://request3"), &info3, &callback3, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Nothing has been sent to the resolver yet. @@ -1063,14 +1063,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info1, &callback1, NULL); + GURL("http://request1"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info2; TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info2, &callback2, &request2); + GURL("http://request2"), &info2, &callback2, &request2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1133,14 +1133,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac2) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info1, &callback1, NULL); + GURL("http://request1"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info2; TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info2, &callback2, &request2); + GURL("http://request2"), &info2, &callback2, &request2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1208,14 +1208,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info1, &callback1, NULL); + GURL("http://request1"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ProxyInfo info2; TestCompletionCallback callback2; ProxyService::PacRequest* request2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info2, &callback2, &request2); + GURL("http://request2"), &info2, &callback2, &request2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1265,7 +1265,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://www.google.com"), &info1, &callback1, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1296,7 +1296,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) { ProxyInfo info2; TestCompletionCallback callback2; rv = service.ResolveProxy( - NULL, GURL("http://www.google.com"), &info2, &callback2, NULL); + GURL("http://www.google.com"), &info2, &callback2, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); ASSERT_EQ(1u, resolver->pending_requests().size()); @@ -1321,7 +1321,7 @@ TEST(ProxyServiceTest, ResetProxyConfigService) { ProxyInfo info; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://request1"), &info, &callback1, NULL); + GURL("http://request1"), &info, &callback1, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI()); @@ -1331,7 +1331,7 @@ TEST(ProxyServiceTest, ResetProxyConfigService) { service.ResetConfigService(new MockProxyConfigService(config2)); TestCompletionCallback callback2; rv = service.ResolveProxy( - NULL, GURL("http://request2"), &info, &callback2, NULL); + GURL("http://request2"), &info, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI()); } @@ -1395,7 +1395,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://www.google.com"), &info1, &callback1, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1419,7 +1419,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) { ProxyInfo info2; TestCompletionCallback callback2; rv = service.ResolveProxy( - NULL, GURL("http://www.google.com"), &info2, &callback2, NULL); + GURL("http://www.google.com"), &info2, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info2.is_direct()); @@ -1440,7 +1440,7 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) { ProxyInfo info1; TestCompletionCallback callback1; int rv = service.ResolveProxy( - NULL, GURL("http://www.google.com"), &info1, &callback1, NULL); + GURL("http://www.google.com"), &info1, &callback1, NULL, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Check that nothing has been sent to the proxy resolver yet. @@ -1472,7 +1472,7 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) { ProxyInfo info2; TestCompletionCallback callback2; rv = service.ResolveProxy( - NULL, GURL("http://www.google.com"), &info2, &callback2, NULL); + GURL("http://www.google.com"), &info2, &callback2, NULL, NULL); EXPECT_EQ(OK, rv); EXPECT_TRUE(info2.is_direct()); diff --git a/net/socket/client_socket_handle.cc b/net/socket/client_socket_handle.cc index 6c12f70..7c3b182 100644 --- a/net/socket/client_socket_handle.cc +++ b/net/socket/client_socket_handle.cc @@ -23,16 +23,16 @@ ClientSocketHandle::~ClientSocketHandle() { Reset(); } -int ClientSocketHandle::Init(LoadLog* load_log, - const std::string& group_name, +int ClientSocketHandle::Init(const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, - CompletionCallback* callback) { + CompletionCallback* callback, + LoadLog* load_log) { CHECK(!group_name.empty()); ResetInternal(true); group_name_ = group_name; int rv = pool_->RequestSocket( - load_log, group_name, resolve_info, priority, this, &callback_); + group_name, resolve_info, priority, this, &callback_, load_log); if (rv == ERR_IO_PENDING) { user_callback_ = callback; } else { diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h index f1d85899..0dbb1bc 100644 --- a/net/socket/client_socket_handle.h +++ b/net/socket/client_socket_handle.h @@ -47,11 +47,11 @@ class ClientSocketHandle { // Init may be called multiple times. // // Profiling information for the request is saved to |load_log| if non-NULL. - int Init(LoadLog* load_log, - const std::string& group_name, + int Init(const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, - CompletionCallback* callback); + CompletionCallback* callback, + LoadLog* load_log); // An initialized handle can be reset, which causes it to return to the // un-initialized state. This releases the underlying socket, which in the diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h index b6a740d..ae0f48a 100644 --- a/net/socket/client_socket_pool.h +++ b/net/socket/client_socket_pool.h @@ -47,12 +47,12 @@ class ClientSocketPool : public base::RefCounted<ClientSocketPool> { // client of completion. // // Profiling information for the request is saved to |load_log| if non-NULL. - virtual int RequestSocket(LoadLog* load_log, - const std::string& group_name, + virtual int RequestSocket(const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback) = 0; + CompletionCallback* callback, + LoadLog* load_log) = 0; // Called to cancel a RequestSocket call that returned ERR_IO_PENDING. The // same handle parameter must be passed to this method as was passed to the diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc index 4261c55..a45d74a 100644 --- a/net/socket/client_socket_pool_base.cc +++ b/net/socket/client_socket_pool_base.cc @@ -103,12 +103,12 @@ void ClientSocketPoolBase::InsertRequestIntoQueue( } int ClientSocketPoolBase::RequestSocket( - LoadLog* load_log, const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback) { + CompletionCallback* callback, + LoadLog* load_log) { DCHECK(!resolve_info.hostname().empty()); DCHECK_GE(priority, 0); DCHECK(callback); @@ -123,7 +123,7 @@ int ClientSocketPoolBase::RequestSocket( may_have_stalled_group_ = true; } CHECK(callback); - Request r(load_log, handle, callback, priority, resolve_info); + Request r(handle, callback, priority, resolve_info, load_log); InsertRequestIntoQueue(r, &group.pending_requests); return ERR_IO_PENDING; } @@ -143,7 +143,7 @@ int ClientSocketPoolBase::RequestSocket( // We couldn't find a socket to reuse, so allocate and connect a new one. CHECK(callback); - Request r(load_log, handle, callback, priority, resolve_info); + Request r(handle, callback, priority, resolve_info, load_log); scoped_ptr<ConnectJob> connect_job( connect_job_factory_->NewConnectJob(group_name, r, this)); @@ -499,7 +499,7 @@ void ClientSocketPoolBase::ProcessPendingRequest(const std::string& group_name, group->pending_requests.pop_front(); int rv = RequestSocket( - r.load_log, group_name, r.resolve_info, r.priority, r.handle, r.callback); + group_name, r.resolve_info, r.priority, r.handle, r.callback, r.load_log); if (rv != ERR_IO_PENDING) { r.callback->Run(rv); diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h index 762c0ed..4ae96f8 100644 --- a/net/socket/client_socket_pool_base.h +++ b/net/socket/client_socket_pool_base.h @@ -110,11 +110,11 @@ class ClientSocketPoolBase priority(0), resolve_info(std::string(), 0) {} - Request(LoadLog* load_log, - ClientSocketHandle* handle, + Request(ClientSocketHandle* handle, CompletionCallback* callback, int priority, - const HostResolver::RequestInfo& resolve_info) + const HostResolver::RequestInfo& resolve_info, + LoadLog* load_log) : load_log(load_log), handle(handle), callback(callback), priority(priority), resolve_info(resolve_info) { } @@ -146,12 +146,12 @@ class ClientSocketPoolBase ~ClientSocketPoolBase(); - int RequestSocket(LoadLog* load_log, - const std::string& group_name, + int RequestSocket(const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback); + CompletionCallback* callback, + LoadLog* load_log); void CancelRequest(const std::string& group_name, const ClientSocketHandle* handle); diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index 3139b27..963d017 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -248,14 +248,14 @@ class TestClientSocketPool : public ClientSocketPool { max_sockets, max_sockets_per_group, connect_job_factory)) {} virtual int RequestSocket( - LoadLog* load_log, const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback) { + CompletionCallback* callback, + LoadLog* load_log) { return base_->RequestSocket( - NULL, group_name, resolve_info, priority, handle, callback); + group_name, resolve_info, priority, handle, callback, load_log); } virtual void CancelRequest( @@ -416,8 +416,8 @@ TEST_F(ClientSocketPoolBaseTest, BasicSynchronous) { TestCompletionCallback callback; ClientSocketHandle handle(pool_.get()); - EXPECT_EQ(OK, handle.Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &callback)); + EXPECT_EQ(OK, handle.Init("a", ignored_request_info_, + kDefaultPriority, &callback, NULL)); EXPECT_TRUE(handle.is_initialized()); EXPECT_TRUE(handle.socket()); handle.Reset(); @@ -428,7 +428,7 @@ TEST_F(ClientSocketPoolBaseTest, BasicAsynchronous) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); - int rv = req.handle()->Init(NULL, "a", ignored_request_info_, 0, &req); + int rv = req.handle()->Init("a", ignored_request_info_, 0, &req, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_CONNECTING, pool_->GetLoadState("a", req.handle())); EXPECT_EQ(OK, req.WaitForResult()); @@ -443,8 +443,8 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) { connect_job_factory_->set_job_type(TestConnectJob::kMockFailingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_CONNECTION_FAILED, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); } TEST_F(ClientSocketPoolBaseTest, InitConnectionAsynchronousFailure) { @@ -453,8 +453,8 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionAsynchronousFailure) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingFailingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); EXPECT_EQ(LOAD_STATE_CONNECTING, pool_->GetLoadState("a", req.handle())); EXPECT_EQ(ERR_CONNECTION_FAILED, req.WaitForResult()); } @@ -745,8 +745,8 @@ TEST_F(ClientSocketPoolBaseTest, CancelRequestClearGroup) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); req.handle()->Reset(); } @@ -758,11 +758,11 @@ TEST_F(ClientSocketPoolBaseTest, TwoRequestsCancelOne) { TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); EXPECT_EQ(ERR_IO_PENDING, - req2.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req2)); + req2.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req2, NULL)); req.handle()->Reset(); @@ -779,15 +779,15 @@ TEST_F(ClientSocketPoolBaseTest, ConnectCancelConnect) { TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - handle.Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &callback)); + handle.Init("a", ignored_request_info_, + kDefaultPriority, &callback, NULL)); handle.Reset(); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, - handle.Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &callback2)); + handle.Init("a", ignored_request_info_, + kDefaultPriority, &callback2, NULL)); EXPECT_EQ(OK, callback2.WaitForResult()); EXPECT_FALSE(callback.have_result()); @@ -849,8 +849,8 @@ class RequestSocketCallback : public CallbackRunner< Tuple1<int> > { handle_->Reset(); within_callback_ = true; int rv = handle_->Init( - NULL, "a", HostResolver::RequestInfo("www.google.com", 80), - kDefaultPriority, this); + "a", HostResolver::RequestInfo("www.google.com", 80), + kDefaultPriority, this, NULL); switch (next_job_type_) { case TestConnectJob::kMockJob: EXPECT_EQ(OK, rv); @@ -885,7 +885,7 @@ TEST_F(ClientSocketPoolBaseTest, RequestPendingJobTwice) { RequestSocketCallback callback( &handle, connect_job_factory_, TestConnectJob::kMockPendingJob); int rv = handle.Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &callback); + "a", ignored_request_info_, kDefaultPriority, &callback, NULL); ASSERT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -900,7 +900,7 @@ TEST_F(ClientSocketPoolBaseTest, RequestPendingJobThenSynchronous) { RequestSocketCallback callback( &handle, connect_job_factory_, TestConnectJob::kMockJob); int rv = handle.Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &callback); + "a", ignored_request_info_, kDefaultPriority, &callback, NULL); ASSERT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -963,14 +963,14 @@ TEST_F(ClientSocketPoolBaseTest, CancelActiveRequestThenRequestSocket) { TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); int rv = req.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req); + "a", ignored_request_info_, kDefaultPriority, &req, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Cancel the active request. req.handle()->Reset(); rv = req.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req); + "a", ignored_request_info_, kDefaultPriority, &req, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, req.WaitForResult()); @@ -990,14 +990,14 @@ TEST_F(ClientSocketPoolBaseTest, PendingJobCompletionOrder) { // Start job 1 (async error). TestSocketRequest req1(pool_.get(), &request_order_, &completion_count_); - int rv = req1.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req1); + int rv = req1.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Start job 2 (async error). TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); rv = req2.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req2); + "a", ignored_request_info_, kDefaultPriority, &req2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // The pending job is sync. @@ -1006,7 +1006,7 @@ TEST_F(ClientSocketPoolBaseTest, PendingJobCompletionOrder) { // Request 3 does not have a ConnectJob yet. It's just pending. TestSocketRequest req3(pool_.get(), &request_order_, &completion_count_); rv = req3.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req3); + "a", ignored_request_info_, kDefaultPriority, &req3, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(ERR_CONNECTION_FAILED, req1.WaitForResult()); @@ -1033,8 +1033,8 @@ TEST_F(ClientSocketPoolBaseTest, ReleaseSockets) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req1(pool_.get(), &request_order_, &completion_count_); - int rv = req1.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req1); + int rv = req1.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, req1.WaitForResult()); @@ -1043,7 +1043,7 @@ TEST_F(ClientSocketPoolBaseTest, ReleaseSockets) { TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); rv = req2.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req2); + "a", ignored_request_info_, kDefaultPriority, &req2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); req1.handle()->Reset(); MessageLoop::current()->RunAllPending(); // Run the DoReleaseSocket() @@ -1053,7 +1053,7 @@ TEST_F(ClientSocketPoolBaseTest, ReleaseSockets) { TestSocketRequest req3(pool_.get(), &request_order_, &completion_count_); rv = req3.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req3); + "a", ignored_request_info_, kDefaultPriority, &req3, NULL); EXPECT_EQ(OK, rv); EXPECT_FALSE(req2.handle()->socket()); @@ -1150,8 +1150,8 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, BasicSynchronous) { TestCompletionCallback callback; ClientSocketHandle handle(pool_.get()); - EXPECT_EQ(OK, handle.Init(NULL, "a", ignored_request_info_, kDefaultPriority, - &callback)); + EXPECT_EQ(OK, handle.Init("a", ignored_request_info_, kDefaultPriority, + &callback, NULL)); EXPECT_TRUE(handle.is_initialized()); EXPECT_TRUE(handle.socket()); handle.Reset(); @@ -1162,7 +1162,7 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, BasicAsynchronous) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); - int rv = req.handle()->Init(NULL, "a", ignored_request_info_, 0, &req); + int rv = req.handle()->Init("a", ignored_request_info_, 0, &req, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_CONNECTING, pool_->GetLoadState("a", req.handle())); EXPECT_EQ(OK, req.WaitForResult()); @@ -1177,8 +1177,8 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, InitConnectionFailure) { connect_job_factory_->set_job_type(TestConnectJob::kMockFailingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_CONNECTION_FAILED, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); } TEST_F(ClientSocketPoolBaseTest_LateBinding, @@ -1188,8 +1188,8 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, connect_job_factory_->set_job_type(TestConnectJob::kMockPendingFailingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); EXPECT_EQ(LOAD_STATE_CONNECTING, pool_->GetLoadState("a", req.handle())); EXPECT_EQ(ERR_CONNECTION_FAILED, req.WaitForResult()); } @@ -1253,8 +1253,8 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, CancelRequestClearGroup) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); req.handle()->Reset(); } @@ -1266,11 +1266,11 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, TwoRequestsCancelOne) { TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req)); + req.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req, NULL)); EXPECT_EQ(ERR_IO_PENDING, - req2.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req2)); + req2.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req2, NULL)); req.handle()->Reset(); @@ -1287,15 +1287,15 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, ConnectCancelConnect) { TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); EXPECT_EQ(ERR_IO_PENDING, - handle.Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &callback)); + handle.Init("a", ignored_request_info_, + kDefaultPriority, &callback, NULL)); handle.Reset(); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, - handle.Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &callback2)); + handle.Init("a", ignored_request_info_, + kDefaultPriority, &callback2, NULL)); EXPECT_EQ(OK, callback2.WaitForResult()); EXPECT_FALSE(callback.have_result()); @@ -1368,7 +1368,7 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, RequestPendingJobTwice) { RequestSocketCallback callback( &handle, connect_job_factory_, TestConnectJob::kMockPendingJob); int rv = handle.Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &callback); + "a", ignored_request_info_, kDefaultPriority, &callback, NULL); ASSERT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -1383,7 +1383,7 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, RequestPendingJobThenSynchronous) { RequestSocketCallback callback( &handle, connect_job_factory_, TestConnectJob::kMockJob); int rv = handle.Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &callback); + "a", ignored_request_info_, kDefaultPriority, &callback, NULL); ASSERT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback.WaitForResult()); @@ -1449,14 +1449,14 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); int rv = req.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req); + "a", ignored_request_info_, kDefaultPriority, &req, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Cancel the active request. req.handle()->Reset(); rv = req.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req); + "a", ignored_request_info_, kDefaultPriority, &req, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, req.WaitForResult()); @@ -1474,8 +1474,8 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, ReleaseSockets) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); TestSocketRequest req1(pool_.get(), &request_order_, &completion_count_); - int rv = req1.handle()->Init(NULL, "a", ignored_request_info_, - kDefaultPriority, &req1); + int rv = req1.handle()->Init("a", ignored_request_info_, + kDefaultPriority, &req1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, req1.WaitForResult()); @@ -1485,11 +1485,11 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, ReleaseSockets) { TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); rv = req2.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req2); + "a", ignored_request_info_, kDefaultPriority, &req2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); TestSocketRequest req3(pool_.get(), &request_order_, &completion_count_); rv = req3.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req3); + "a", ignored_request_info_, kDefaultPriority, &req3, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // Both Requests 2 and 3 are pending. We release socket 1 which should @@ -1521,12 +1521,12 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, PendingJobCompletionOrder) { TestSocketRequest req1(pool_.get(), &request_order_, &completion_count_); int rv = req1.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req1); + "a", ignored_request_info_, kDefaultPriority, &req1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); rv = req2.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req2); + "a", ignored_request_info_, kDefaultPriority, &req2, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); // The pending job is sync. @@ -1534,7 +1534,7 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, PendingJobCompletionOrder) { TestSocketRequest req3(pool_.get(), &request_order_, &completion_count_); rv = req3.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req3); + "a", ignored_request_info_, kDefaultPriority, &req3, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(ERR_CONNECTION_FAILED, req1.WaitForResult()); @@ -1554,7 +1554,7 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, DISABLED_LoadState) { TestSocketRequest req1(pool_.get(), &request_order_, &completion_count_); int rv = req1.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req1); + "a", ignored_request_info_, kDefaultPriority, &req1, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(LOAD_STATE_IDLE, req1.handle()->GetLoadState()); @@ -1562,7 +1562,7 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, DISABLED_LoadState) { TestSocketRequest req2(pool_.get(), &request_order_, &completion_count_); rv = req2.handle()->Init( - NULL, "a", ignored_request_info_, kDefaultPriority, &req2); + "a", ignored_request_info_, kDefaultPriority, &req2, NULL); 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()); diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 0f61714..30927ad 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -337,8 +337,8 @@ int ClientSocketPoolTest::StartRequestUsingPool(ClientSocketPool* socket_pool, &request_order_, &completion_count_); requests_.push_back(request); - int rv = request->handle()->Init(NULL, group_name, ignored_request_info_, - priority, request); + int rv = request->handle()->Init(group_name, ignored_request_info_, + priority, request, NULL); if (rv != ERR_IO_PENDING) request_order_.push_back(request); return rv; diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc index bb058cb..a4fca1a 100644 --- a/net/socket/socks5_client_socket.cc +++ b/net/socket/socks5_client_socket.cc @@ -177,7 +177,7 @@ int SOCKS5ClientSocket::DoResolveHost() { next_state_ = STATE_RESOLVE_HOST_COMPLETE; return host_resolver_.Resolve( - NULL, host_request_info_, &addresses_, &io_callback_); + host_request_info_, &addresses_, &io_callback_, NULL); } int SOCKS5ClientSocket::DoResolveHostComplete(int result) { @@ -428,4 +428,3 @@ int SOCKS5ClientSocket::GetPeerName(struct sockaddr* name, #endif } // namespace net - diff --git a/net/socket/socks5_client_socket_unittest.cc b/net/socket/socks5_client_socket_unittest.cc index 3ad5bab..9dedc39 100644 --- a/net/socket/socks5_client_socket_unittest.cc +++ b/net/socket/socks5_client_socket_unittest.cc @@ -59,7 +59,7 @@ 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(NULL, info, &address_list_, NULL, NULL); + int rv = host_resolver_->Resolve(info, &address_list_, NULL, NULL, NULL); ASSERT_EQ(OK, rv); } @@ -285,4 +285,3 @@ TEST_F(SOCKS5ClientSocketTest, PartialReadWrites) { } } // namespace net - diff --git a/net/socket/socks_client_socket.cc b/net/socket/socks_client_socket.cc index 8b08dc1..31f362e 100644 --- a/net/socket/socks_client_socket.cc +++ b/net/socket/socks_client_socket.cc @@ -197,7 +197,7 @@ int SOCKSClientSocket::DoResolveHost() { next_state_ = STATE_RESOLVE_HOST_COMPLETE; return host_resolver_.Resolve( - NULL, host_request_info_, &addresses_, &io_callback_); + host_request_info_, &addresses_, &io_callback_, NULL); } int SOCKSClientSocket::DoResolveHostComplete(int result) { @@ -383,4 +383,3 @@ int SOCKSClientSocket::GetPeerName(struct sockaddr* name, #endif } // namespace net - diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc index cb8efe1..d565ab6 100644 --- a/net/socket/ssl_client_socket_unittest.cc +++ b/net/socket/ssl_client_socket_unittest.cc @@ -91,7 +91,7 @@ TEST_F(SSLClientSocketTest, MAYBE_Connect) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(net::OK, rv); net::ClientSocket *transport = new net::TCPClientSocket(addr); @@ -128,7 +128,7 @@ TEST_F(SSLClientSocketTest, MAYBE_ConnectExpired) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kBadHTTPSPort); - int rv = resolver_->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(net::OK, rv); net::ClientSocket *transport = new net::TCPClientSocket(addr); @@ -165,7 +165,7 @@ TEST_F(SSLClientSocketTest, MAYBE_ConnectMismatched) { net::HostResolver::RequestInfo info(server_.kMismatchedHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(net::OK, rv); net::ClientSocket *transport = new net::TCPClientSocket(addr); @@ -206,7 +206,7 @@ TEST_F(SSLClientSocketTest, MAYBE_Read) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(NULL, info, &addr, &callback, NULL); + int rv = resolver_->Resolve(info, &addr, &callback, NULL, NULL); EXPECT_EQ(net::ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -266,7 +266,7 @@ TEST_F(SSLClientSocketTest, MAYBE_Read_SmallChunks) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(net::OK, rv); net::ClientSocket *transport = new net::TCPClientSocket(addr); @@ -321,7 +321,7 @@ TEST_F(SSLClientSocketTest, MAYBE_Read_Interrupted) { TestCompletionCallback callback; net::HostResolver::RequestInfo info(server_.kHostName, server_.kOKHTTPSPort); - int rv = resolver_->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver_->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(net::OK, rv); net::ClientSocket *transport = new net::TCPClientSocket(addr); diff --git a/net/socket/ssl_test_util.cc b/net/socket/ssl_test_util.cc index 298db77..f6dc15e 100644 --- a/net/socket/ssl_test_util.cc +++ b/net/socket/ssl_test_util.cc @@ -266,7 +266,7 @@ bool TestServerLauncher::WaitToStart(const std::string& host_name, int port) { net::AddressList addr; scoped_refptr<net::HostResolver> resolver(net::CreateSystemHostResolver()); net::HostResolver::RequestInfo info(host_name, port); - int rv = resolver->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); if (rv != net::OK) return false; diff --git a/net/socket/tcp_client_socket_pool.cc b/net/socket/tcp_client_socket_pool.cc index 46aab4d..ae080dd 100644 --- a/net/socket/tcp_client_socket_pool.cc +++ b/net/socket/tcp_client_socket_pool.cc @@ -89,7 +89,7 @@ int TCPConnectJob::DoLoop(int result) { int TCPConnectJob::DoResolveHost() { set_load_state(LOAD_STATE_RESOLVING_HOST); next_state_ = kStateResolveHostComplete; - return resolver_.Resolve(NULL, resolve_info_, &addresses_, &callback_); + return resolver_.Resolve(resolve_info_, &addresses_, &callback_, NULL); } int TCPConnectJob::DoResolveHostComplete(int result) { @@ -149,14 +149,14 @@ TCPClientSocketPool::TCPClientSocketPool( TCPClientSocketPool::~TCPClientSocketPool() {} int TCPClientSocketPool::RequestSocket( - LoadLog* load_log, const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback) { + CompletionCallback* callback, + LoadLog* load_log) { return base_->RequestSocket( - load_log, group_name, resolve_info, priority, handle, callback); + group_name, resolve_info, priority, handle, callback, load_log); } void TCPClientSocketPool::CancelRequest( diff --git a/net/socket/tcp_client_socket_pool.h b/net/socket/tcp_client_socket_pool.h index 55a2f63..8533d0e 100644 --- a/net/socket/tcp_client_socket_pool.h +++ b/net/socket/tcp_client_socket_pool.h @@ -80,12 +80,12 @@ class TCPClientSocketPool : public ClientSocketPool { // ClientSocketPool methods: - virtual int RequestSocket(LoadLog* load_log, - const std::string& group_name, + virtual int RequestSocket(const std::string& group_name, const HostResolver::RequestInfo& resolve_info, int priority, ClientSocketHandle* handle, - CompletionCallback* callback); + CompletionCallback* callback, + LoadLog* load_log); virtual void CancelRequest(const std::string& group_name, const ClientSocketHandle* handle); diff --git a/net/socket/tcp_client_socket_pool_unittest.cc b/net/socket/tcp_client_socket_pool_unittest.cc index 649790a..9dd3974 100644 --- a/net/socket/tcp_client_socket_pool_unittest.cc +++ b/net/socket/tcp_client_socket_pool_unittest.cc @@ -209,7 +209,7 @@ TEST_F(TCPClientSocketPoolTest, Basic) { TestCompletionCallback callback; ClientSocketHandle handle(pool_.get()); HostResolver::RequestInfo info("www.google.com", 80); - int rv = handle.Init(NULL, "a", info, 0, &callback); + int rv = handle.Init("a", info, 0, &callback, NULL); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(handle.is_initialized()); EXPECT_FALSE(handle.socket()); @@ -226,7 +226,7 @@ TEST_F(TCPClientSocketPoolTest, InitHostResolutionFailure) { TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); HostResolver::RequestInfo info("unresolvable.host.name", 80); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", info, kDefaultPriority, &req)); + req.handle()->Init("a", info, kDefaultPriority, &req, NULL)); EXPECT_EQ(ERR_NAME_NOT_RESOLVED, req.WaitForResult()); } @@ -236,13 +236,13 @@ TEST_F(TCPClientSocketPoolTest, InitConnectionFailure) { TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); HostResolver::RequestInfo info("a", 80); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", info, kDefaultPriority, &req)); + req.handle()->Init("a", info, kDefaultPriority, &req, NULL)); 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(NULL, "a", info, kDefaultPriority, &req)); + req.handle()->Init("a", info, kDefaultPriority, &req, NULL)); } TEST_F(TCPClientSocketPoolTest, PendingRequests) { @@ -348,7 +348,7 @@ TEST_F(TCPClientSocketPoolTest, CancelRequestClearGroup) { TestSocketRequest req(pool_.get(), &request_order_, &completion_count_); HostResolver::RequestInfo info("www.google.com", 80); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", info, kDefaultPriority, &req)); + req.handle()->Init("a", info, kDefaultPriority, &req, NULL)); req.handle()->Reset(); PlatformThread::Sleep(100); @@ -367,9 +367,9 @@ TEST_F(TCPClientSocketPoolTest, TwoRequestsCancelOne) { HostResolver::RequestInfo info("www.google.com", 80); EXPECT_EQ(ERR_IO_PENDING, - req.handle()->Init(NULL, "a", info, kDefaultPriority, &req)); + req.handle()->Init("a", info, kDefaultPriority, &req, NULL)); EXPECT_EQ(ERR_IO_PENDING, - req2.handle()->Init(NULL, "a", info, kDefaultPriority, &req2)); + req2.handle()->Init("a", info, kDefaultPriority, &req2, NULL)); req.handle()->Reset(); @@ -386,13 +386,13 @@ TEST_F(TCPClientSocketPoolTest, ConnectCancelConnect) { HostResolver::RequestInfo info("www.google.com", 80); EXPECT_EQ(ERR_IO_PENDING, - handle.Init(NULL, "a", info, kDefaultPriority, &callback)); + handle.Init("a", info, kDefaultPriority, &callback, NULL)); handle.Reset(); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, - handle.Init(NULL, "a", info, kDefaultPriority, &callback2)); + handle.Init("a", info, kDefaultPriority, &callback2, NULL)); host_resolver_->set_synchronous_mode(true); // At this point, handle has two ConnectingSockets out for it. Due to the @@ -481,8 +481,8 @@ class RequestSocketCallback : public CallbackRunner< Tuple1<int> > { if (!within_callback_) { handle_->Reset(); within_callback_ = true; - int rv = handle_->Init(NULL, "a", - HostResolver::RequestInfo("www.google.com", 80), 0, this); + int rv = handle_->Init( + "a", HostResolver::RequestInfo("www.google.com", 80), 0, this, NULL); EXPECT_EQ(OK, rv); } } @@ -500,8 +500,8 @@ class RequestSocketCallback : public CallbackRunner< Tuple1<int> > { TEST_F(TCPClientSocketPoolTest, RequestTwice) { ClientSocketHandle handle(pool_.get()); RequestSocketCallback callback(&handle); - int rv = handle.Init(NULL, "a", - HostResolver::RequestInfo("www.google.com", 80), 0, &callback); + int rv = handle.Init( + "a", HostResolver::RequestInfo("www.google.com", 80), 0, &callback, NULL); ASSERT_EQ(ERR_IO_PENDING, rv); // The callback is going to request "www.google.com". We want it to complete diff --git a/net/socket/tcp_client_socket_unittest.cc b/net/socket/tcp_client_socket_unittest.cc index c2a8495..14d2305 100644 --- a/net/socket/tcp_client_socket_unittest.cc +++ b/net/socket/tcp_client_socket_unittest.cc @@ -88,7 +88,7 @@ void TCPClientSocketTest::SetUp() { AddressList addr; scoped_refptr<HostResolver> resolver(CreateSystemHostResolver()); HostResolver::RequestInfo info("localhost", listen_port_); - int rv = resolver->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); CHECK(rv == OK); sock_.reset(new TCPClientSocket(addr)); } diff --git a/net/socket/tcp_pinger_unittest.cc b/net/socket/tcp_pinger_unittest.cc index 0ca1138..1714ebe 100644 --- a/net/socket/tcp_pinger_unittest.cc +++ b/net/socket/tcp_pinger_unittest.cc @@ -68,7 +68,7 @@ TEST_F(TCPPingerTest, Ping) { scoped_refptr<net::HostResolver> resolver(net::CreateSystemHostResolver()); net::HostResolver::RequestInfo info("localhost", listen_port_); - int rv = resolver->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(rv, net::OK); net::TCPPinger pinger(addr); @@ -84,7 +84,7 @@ TEST_F(TCPPingerTest, PingFail) { listen_sock_ = NULL; net::HostResolver::RequestInfo info("localhost", listen_port_); - int rv = resolver->Resolve(NULL, info, &addr, NULL, NULL); + int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); EXPECT_EQ(rv, net::OK); net::TCPPinger pinger(addr); diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc index a472a27..0f9f911 100644 --- a/net/tools/fetch/fetch_client.cc +++ b/net/tools/fetch/fetch_client.cc @@ -58,7 +58,7 @@ class Client { request_info_.url = url_; request_info_.method = "GET"; int state = transaction_->Start( - NULL, &request_info_, &connect_callback_); + &request_info_, &connect_callback_, NULL); DCHECK(state == net::ERR_IO_PENDING); }; diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index bf554e8..b019c48 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -582,7 +582,7 @@ void URLRequestHttpJob::StartTransaction() { int rv; if (transaction_.get()) { rv = transaction_->Start( - request_->load_log(), &request_info_, &start_callback_); + &request_info_, &start_callback_, request_->load_log()); if (rv == net::ERR_IO_PENDING) return; } else { diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_new_ftp_job.cc index 0de6c78..f467357 100644 --- a/net/url_request/url_request_new_ftp_job.cc +++ b/net/url_request/url_request_new_ftp_job.cc @@ -288,7 +288,7 @@ void URLRequestNewFtpJob::StartTransaction() { int rv; if (transaction_.get()) { rv = transaction_->Start( - request_->load_log(), &request_info_, &start_callback_); + &request_info_, &start_callback_, request_->load_log()); if (rv == net::ERR_IO_PENDING) return; } else { |