diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-01 20:38:10 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-01 20:38:10 +0000 |
commit | f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8 (patch) | |
tree | 6ccdd87ccfc89adbcb372c517559fa61fbc6c6b2 /net/http | |
parent | d1666539b57bf8552e203d355fd09909d36f9732 (diff) | |
download | chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.zip chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.tar.gz chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.tar.bz2 |
Begin CompletionCallback switchover.
Rename CompletionCallback to OldCompletionCallback in preparation for introducing a new CompletionCallback based on base::Callback.
Also renames other CompletionCallback types like CancelableCompletionCallback and TestCompletionCallback and CompletionCallbackImpl. All using sed with s/CompletionCallback/OldCompletionCallback/g.
BUG=98719
TEST=none
Review URL: http://codereview.chromium.org/8070013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
49 files changed, 387 insertions, 387 deletions
diff --git a/net/http/disk_cache_based_ssl_host_info.cc b/net/http/disk_cache_based_ssl_host_info.cc index 55f471d5..0b6d3ae 100644 --- a/net/http/disk_cache_based_ssl_host_info.cc +++ b/net/http/disk_cache_based_ssl_host_info.cc @@ -57,7 +57,7 @@ void DiskCacheBasedSSLHostInfo::Start() { DoLoop(OK); } -int DiskCacheBasedSSLHostInfo::WaitForDataReady(CompletionCallback* callback) { +int DiskCacheBasedSSLHostInfo::WaitForDataReady(OldCompletionCallback* callback) { DCHECK(CalledOnValidThread()); DCHECK(state_ != GET_BACKEND); @@ -101,7 +101,7 @@ std::string DiskCacheBasedSSLHostInfo::key() const { void DiskCacheBasedSSLHostInfo::OnIOComplete(int rv) { rv = DoLoop(rv); if (rv != ERR_IO_PENDING) { - CompletionCallback* callback = user_callback_; + OldCompletionCallback* callback = user_callback_; user_callback_ = NULL; if (callback) callback->Run(rv); diff --git a/net/http/disk_cache_based_ssl_host_info.h b/net/http/disk_cache_based_ssl_host_info.h index 56a1f5bb..7adce48 100644 --- a/net/http/disk_cache_based_ssl_host_info.h +++ b/net/http/disk_cache_based_ssl_host_info.h @@ -34,7 +34,7 @@ class NET_EXPORT_PRIVATE DiskCacheBasedSSLHostInfo // Implementation of SSLHostInfo virtual void Start(); - virtual int WaitForDataReady(CompletionCallback* callback); + virtual int WaitForDataReady(OldCompletionCallback* callback); virtual void Persist(); private: @@ -114,7 +114,7 @@ class NET_EXPORT_PRIVATE DiskCacheBasedSSLHostInfo HttpCache* const http_cache_; disk_cache::Backend* backend_; disk_cache::Entry* entry_; - CompletionCallback* user_callback_; + OldCompletionCallback* user_callback_; scoped_refptr<IOBuffer> read_buffer_; scoped_refptr<IOBuffer> write_buffer_; std::string data_; diff --git a/net/http/http_auth_cache_unittest.cc b/net/http/http_auth_cache_unittest.cc index d988f3c..b8eb479 100644 --- a/net/http/http_auth_cache_unittest.cc +++ b/net/http/http_auth_cache_unittest.cc @@ -43,7 +43,7 @@ class MockAuthHandler : public HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16*, const string16*, const HttpRequestInfo*, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) { *auth_token = "mock-credentials"; return OK; diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc index 4899a0c..d0ff551 100644 --- a/net/http/http_auth_controller.cc +++ b/net/http/http_auth_controller.cc @@ -173,7 +173,7 @@ HttpAuthController::~HttpAuthController() { } int HttpAuthController::MaybeGenerateAuthToken(const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) { DCHECK(CalledOnValidThread()); bool needs_auth = HaveAuth() || SelectPreemptiveAuth(net_log); @@ -552,7 +552,7 @@ void HttpAuthController::OnIOComplete(int result) { if (DisableOnAuthHandlerResult(result)) result = OK; if (user_callback_) { - CompletionCallback* c = user_callback_; + OldCompletionCallback* c = user_callback_; user_callback_ = NULL; c->Run(result); } diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h index 8dc9886..45a1339 100644 --- a/net/http/http_auth_controller.h +++ b/net/http/http_auth_controller.h @@ -45,7 +45,7 @@ class NET_EXPORT_PRIVATE HttpAuthController // a token is correctly generated synchronously, as well as when no tokens // were necessary. virtual int MaybeGenerateAuthToken(const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log); // Adds either the proxy auth header, or the origin server auth header, @@ -164,8 +164,8 @@ class NET_EXPORT_PRIVATE HttpAuthController std::set<HttpAuth::Scheme> disabled_schemes_; - CompletionCallbackImpl<HttpAuthController> io_callback_; - CompletionCallback* user_callback_; + OldCompletionCallbackImpl<HttpAuthController> io_callback_; + OldCompletionCallback* user_callback_; }; } // namespace net diff --git a/net/http/http_auth_controller_unittest.cc b/net/http/http_auth_controller_unittest.cc index f93b698..d1c82dc 100644 --- a/net/http/http_auth_controller_unittest.cc +++ b/net/http/http_auth_controller_unittest.cc @@ -77,7 +77,7 @@ void RunSingleRoundAuthTest(HandlerRunMode run_mode, controller->ResetAuth(string16(), string16()); EXPECT_TRUE(controller->HaveAuth()); - TestCompletionCallback callback; + TestOldCompletionCallback callback; EXPECT_EQ((run_mode == RUN_HANDLER_ASYNC)? ERR_IO_PENDING: expected_controller_rv, controller->MaybeGenerateAuthToken(&request, &callback, @@ -145,7 +145,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) OVERRIDE { int result = HttpAuthHandlerMock::GenerateAuthTokenImpl(username, password, diff --git a/net/http/http_auth_handler.cc b/net/http/http_auth_handler.cc index d123c21..3ba4109 100644 --- a/net/http/http_auth_handler.cc +++ b/net/http/http_auth_handler.cc @@ -65,7 +65,7 @@ NetLog::EventType EventTypeFromAuthTarget(HttpAuth::Target target) { int HttpAuthHandler::GenerateAuthToken(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) { // TODO(cbentzel): Enforce non-NULL callback after cleaning up SocketStream. DCHECK(request); @@ -95,7 +95,7 @@ bool HttpAuthHandler::AllowsExplicitCredentials() { } void HttpAuthHandler::OnGenerateAuthTokenComplete(int rv) { - CompletionCallback* callback = original_callback_; + OldCompletionCallback* callback = original_callback_; FinishGenerateAuthToken(); if (callback) callback->Run(rv); diff --git a/net/http/http_auth_handler.h b/net/http/http_auth_handler.h index 00f45f2..a78ae0c 100644 --- a/net/http/http_auth_handler.h +++ b/net/http/http_auth_handler.h @@ -73,7 +73,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandler { int GenerateAuthToken(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token); // The authentication scheme as an enumerated value. @@ -160,7 +160,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) = 0; // The auth-scheme as an enumerated value. @@ -192,8 +192,8 @@ class NET_EXPORT_PRIVATE HttpAuthHandler { void OnGenerateAuthTokenComplete(int rv); void FinishGenerateAuthToken(); - CompletionCallback* original_callback_; - CompletionCallbackImpl<HttpAuthHandler> wrapper_callback_; + OldCompletionCallback* original_callback_; + OldCompletionCallbackImpl<HttpAuthHandler> wrapper_callback_; }; } // namespace net diff --git a/net/http/http_auth_handler_basic.cc b/net/http/http_auth_handler_basic.cc index a618651..5303ac3 100644 --- a/net/http/http_auth_handler_basic.cc +++ b/net/http/http_auth_handler_basic.cc @@ -89,7 +89,7 @@ int HttpAuthHandlerBasic::GenerateAuthTokenImpl( const string16* username, const string16* password, const HttpRequestInfo*, - CompletionCallback*, + OldCompletionCallback*, std::string* auth_token) { // TODO(eroman): is this the right encoding of username/password? std::string base64_username_password; diff --git a/net/http/http_auth_handler_basic.h b/net/http/http_auth_handler_basic.h index 1df5367..ab1d397 100644 --- a/net/http/http_auth_handler_basic.h +++ b/net/http/http_auth_handler_basic.h @@ -41,7 +41,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token); private: diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc index fe93479..58c3c32 100644 --- a/net/http/http_auth_handler_digest.cc +++ b/net/http/http_auth_handler_digest.cc @@ -140,7 +140,7 @@ int HttpAuthHandlerDigest::GenerateAuthTokenImpl( const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) { // Generate a random client nonce. std::string cnonce = nonce_generator_->GenerateNonce(); diff --git a/net/http/http_auth_handler_digest.h b/net/http/http_auth_handler_digest.h index c1c5a21..1358a4a 100644 --- a/net/http/http_auth_handler_digest.h +++ b/net/http/http_auth_handler_digest.h @@ -87,7 +87,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerDigest : public HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token); private: diff --git a/net/http/http_auth_handler_digest_unittest.cc b/net/http/http_auth_handler_digest_unittest.cc index 302eaa1..1f154ca 100644 --- a/net/http/http_auth_handler_digest_unittest.cc +++ b/net/http/http_auth_handler_digest_unittest.cc @@ -63,8 +63,8 @@ bool RespondToChallenge(HttpAuth::Target target, // Create a token in response to the challenge. // NOTE: HttpAuthHandlerDigest's implementation of GenerateAuthToken always // completes synchronously. That's why this test can get away with a - // TestCompletionCallback without an IO thread. - TestCompletionCallback callback; + // TestOldCompletionCallback without an IO thread. + TestOldCompletionCallback callback; scoped_ptr<HttpRequestInfo> request(new HttpRequestInfo()); request->url = GURL(request_url); const string16 kFoo = ASCIIToUTF16("foo"); diff --git a/net/http/http_auth_handler_mock.cc b/net/http/http_auth_handler_mock.cc index 9331ae7..c7c70a8 100644 --- a/net/http/http_auth_handler_mock.cc +++ b/net/http/http_auth_handler_mock.cc @@ -46,7 +46,7 @@ bool HttpAuthHandlerMock::NeedsCanonicalName() { } int HttpAuthHandlerMock::ResolveCanonicalName(HostResolver* host_resolver, - CompletionCallback* callback) { + OldCompletionCallback* callback) { EXPECT_NE(RESOLVE_TESTED, resolve_); int rv = OK; switch (resolve_) { @@ -106,7 +106,7 @@ bool HttpAuthHandlerMock::Init(HttpAuth::ChallengeTokenizer* challenge) { int HttpAuthHandlerMock::GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) { first_round_ = false; request_url_ = request->url; @@ -130,7 +130,7 @@ void HttpAuthHandlerMock::OnResolveCanonicalName() { EXPECT_EQ(RESOLVE_ASYNC, resolve_); EXPECT_TRUE(user_callback_ != NULL); resolve_ = RESOLVE_TESTED; - CompletionCallback* callback = user_callback_; + OldCompletionCallback* callback = user_callback_; user_callback_ = NULL; callback->Run(OK); } @@ -141,7 +141,7 @@ void HttpAuthHandlerMock::OnGenerateAuthToken() { if (generate_rv_ == OK) *auth_token_ = "auth_token"; auth_token_ = NULL; - CompletionCallback* callback = user_callback_; + OldCompletionCallback* callback = user_callback_; user_callback_ = NULL; callback->Run(generate_rv_); } diff --git a/net/http/http_auth_handler_mock.h b/net/http/http_auth_handler_mock.h index 1406239..7d7a2cb 100644 --- a/net/http/http_auth_handler_mock.h +++ b/net/http/http_auth_handler_mock.h @@ -66,7 +66,7 @@ class HttpAuthHandlerMock : public HttpAuthHandler { virtual bool NeedsCanonicalName(); virtual int ResolveCanonicalName(HostResolver* host_resolver, - CompletionCallback* callback); + OldCompletionCallback* callback); void SetGenerateExpectation(bool async, int rv); @@ -100,7 +100,7 @@ class HttpAuthHandlerMock : public HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token); private: @@ -109,7 +109,7 @@ class HttpAuthHandlerMock : public HttpAuthHandler { void OnGenerateAuthToken(); Resolve resolve_; - CompletionCallback* user_callback_; + OldCompletionCallback* user_callback_; ScopedRunnableMethodFactory<HttpAuthHandlerMock> method_factory_; bool generate_async_; int generate_rv_; diff --git a/net/http/http_auth_handler_negotiate.cc b/net/http/http_auth_handler_negotiate.cc index d5d0f80..b499c5b 100644 --- a/net/http/http_auth_handler_negotiate.cc +++ b/net/http/http_auth_handler_negotiate.cc @@ -215,7 +215,7 @@ int HttpAuthHandlerNegotiate::GenerateAuthTokenImpl( const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) { DCHECK(user_callback_ == NULL); DCHECK((username == NULL) == (password == NULL)); @@ -250,7 +250,7 @@ void HttpAuthHandlerNegotiate::OnIOComplete(int result) { void HttpAuthHandlerNegotiate::DoCallback(int rv) { DCHECK(rv != ERR_IO_PENDING); DCHECK(user_callback_); - CompletionCallback* callback = user_callback_; + OldCompletionCallback* callback = user_callback_; user_callback_ = NULL; callback->Run(rv); } diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h index 2397bdb..4b04f7b 100644 --- a/net/http/http_auth_handler_negotiate.h +++ b/net/http/http_auth_handler_negotiate.h @@ -119,7 +119,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token); private: @@ -144,7 +144,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { AuthSystem auth_system_; bool disable_cname_lookup_; bool use_port_; - CompletionCallbackImpl<HttpAuthHandlerNegotiate> io_callback_; + OldCompletionCallbackImpl<HttpAuthHandlerNegotiate> io_callback_; HostResolver* const resolver_; // Members which are needed for DNS lookup + SPN. @@ -159,7 +159,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { std::wstring spn_; // Things which vary each round. - CompletionCallback* user_callback_; + OldCompletionCallback* user_callback_; std::string* auth_token_; State next_state_; diff --git a/net/http/http_auth_handler_negotiate_unittest.cc b/net/http/http_auth_handler_negotiate_unittest.cc index 63eab92..e43d994 100644 --- a/net/http/http_auth_handler_negotiate_unittest.cc +++ b/net/http/http_auth_handler_negotiate_unittest.cc @@ -220,7 +220,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, DisableCname) { true, false, true, "http://alias:500", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(OK, auth_handler->GenerateAuthToken(NULL, NULL, @@ -239,7 +239,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, DisableCnameStandardPort) { EXPECT_EQ(OK, CreateHandler( true, true, true, "http://alias:80", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(OK, auth_handler->GenerateAuthToken(NULL, NULL, @@ -258,7 +258,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, DisableCnameNonstandardPort) { EXPECT_EQ(OK, CreateHandler( true, true, true, "http://alias:500", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(OK, auth_handler->GenerateAuthToken(NULL, NULL, @@ -277,7 +277,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, CnameSync) { EXPECT_EQ(OK, CreateHandler( false, false, true, "http://alias:500", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(OK, auth_handler->GenerateAuthToken(NULL, NULL, @@ -296,7 +296,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, CnameAsync) { EXPECT_EQ(OK, CreateHandler( false, false, false, "http://alias:500", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(ERR_IO_PENDING, auth_handler->GenerateAuthToken( @@ -319,7 +319,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, ServerNotInKerberosDatabase) { EXPECT_EQ(OK, CreateHandler( false, false, false, "http://alias:500", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(ERR_IO_PENDING, auth_handler->GenerateAuthToken( @@ -335,7 +335,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, NoKerberosCredentials) { EXPECT_EQ(OK, CreateHandler( false, false, false, "http://alias:500", &auth_handler)); ASSERT_TRUE(auth_handler.get() != NULL); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; std::string token; EXPECT_EQ(ERR_IO_PENDING, auth_handler->GenerateAuthToken( diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc index 5090918..91fff61 100644 --- a/net/http/http_auth_handler_ntlm.cc +++ b/net/http/http_auth_handler_ntlm.cc @@ -32,7 +32,7 @@ int HttpAuthHandlerNTLM::GenerateAuthTokenImpl( const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token) { #if defined(NTLM_SSPI) return auth_sspi_.GenerateAuthToken( diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h index d0285dc..d3820f8 100644 --- a/net/http/http_auth_handler_ntlm.h +++ b/net/http/http_auth_handler_ntlm.h @@ -121,7 +121,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler { virtual int GenerateAuthTokenImpl(const string16* username, const string16* password, const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, std::string* auth_token); private: diff --git a/net/http/http_auth_handler_unittest.cc b/net/http/http_auth_handler_unittest.cc index c3d0114..9b3de57 100644 --- a/net/http/http_auth_handler_unittest.cc +++ b/net/http/http_auth_handler_unittest.cc @@ -30,7 +30,7 @@ TEST(HttpAuthHandlerTest, NetLog) { for (int j = 0; j < 2; ++j) { int rv = (j == 0) ? OK : ERR_UNEXPECTED; for (int k = 0; k < 2; ++k) { - TestCompletionCallback test_callback; + TestOldCompletionCallback test_callback; HttpAuth::Target target = (k == 0) ? HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER; NetLog::EventType event_type = diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc index 7c79d40..eb5ecc2 100644 --- a/net/http/http_basic_stream.cc +++ b/net/http/http_basic_stream.cc @@ -34,7 +34,7 @@ HttpBasicStream::~HttpBasicStream() {} int HttpBasicStream::InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(!parser_.get()); request_info_ = request_info; parser_.reset(new HttpStreamParser(connection_.get(), request_info, @@ -47,7 +47,7 @@ int HttpBasicStream::InitializeStream(const HttpRequestInfo* request_info, int HttpBasicStream::SendRequest(const HttpRequestHeaders& headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(parser_.get()); DCHECK(request_info_); const std::string path = using_proxy_ ? @@ -65,7 +65,7 @@ uint64 HttpBasicStream::GetUploadProgress() const { return parser_->GetUploadProgress(); } -int HttpBasicStream::ReadResponseHeaders(CompletionCallback* callback) { +int HttpBasicStream::ReadResponseHeaders(OldCompletionCallback* callback) { return parser_->ReadResponseHeaders(callback); } @@ -74,7 +74,7 @@ const HttpResponseInfo* HttpBasicStream::GetResponseInfo() const { } int HttpBasicStream::ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { return parser_->ReadResponseBody(buf, buf_len, callback); } diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h index 303d68f..3b38b93 100644 --- a/net/http/http_basic_stream.h +++ b/net/http/http_basic_stream.h @@ -42,21 +42,21 @@ class HttpBasicStream : public HttpStream { // HttpStream methods: virtual int InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback) OVERRIDE; + OldCompletionCallback* callback) OVERRIDE; virtual int SendRequest(const HttpRequestHeaders& headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback) OVERRIDE; + OldCompletionCallback* callback) OVERRIDE; virtual uint64 GetUploadProgress() const OVERRIDE; - virtual int ReadResponseHeaders(CompletionCallback* callback) OVERRIDE; + virtual int ReadResponseHeaders(OldCompletionCallback* callback) OVERRIDE; virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; virtual int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback) OVERRIDE; + OldCompletionCallback* callback) OVERRIDE; virtual void Close(bool not_reusable) OVERRIDE; diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 91ba1f3..9a23aab 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -88,7 +88,7 @@ HttpCache::BackendFactory* HttpCache::DefaultBackend::InMemory(int max_bytes) { int HttpCache::DefaultBackend::CreateBackend(NetLog* net_log, disk_cache::Backend** backend, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK_GE(max_bytes_, 0); return disk_cache::CreateCacheBackend(type_, path_, max_bytes_, true, thread_, net_log, backend, callback); @@ -121,7 +121,7 @@ struct HttpCache::PendingOp { disk_cache::Entry* disk_entry; disk_cache::Backend* backend; WorkItem* writer; - CompletionCallback* callback; // BackendCallback. + OldCompletionCallback* callback; // BackendCallback. WorkItemList pending_queue; }; @@ -143,7 +143,7 @@ class HttpCache::WorkItem { : operation_(operation), trans_(trans), entry_(entry), callback_(NULL), backend_(NULL) {} WorkItem(WorkItemOperation operation, Transaction* trans, - CompletionCallback* cb, disk_cache::Backend** backend) + OldCompletionCallback* cb, disk_cache::Backend** backend) : operation_(operation), trans_(trans), entry_(NULL), callback_(cb), backend_(backend) {} ~WorkItem() {} @@ -180,13 +180,13 @@ class HttpCache::WorkItem { WorkItemOperation operation_; Transaction* trans_; ActiveEntry** entry_; - CompletionCallback* callback_; // User callback. + OldCompletionCallback* callback_; // User callback. disk_cache::Backend** backend_; }; //----------------------------------------------------------------------------- -// This class is a specialized type of CompletionCallback that allows us to +// This class is a specialized type of OldCompletionCallback that allows us to // pass multiple arguments to the completion routine. class HttpCache::BackendCallback : public CallbackRunner<Tuple1<int> > { public: @@ -241,7 +241,7 @@ class HttpCache::MetadataWriter { scoped_refptr<IOBuffer> buf_; int buf_len_; base::Time expected_response_time_; - CompletionCallbackImpl<MetadataWriter> callback_; + OldCompletionCallbackImpl<MetadataWriter> callback_; HttpRequestInfo request_info_; DISALLOW_COPY_AND_ASSIGN(MetadataWriter); }; @@ -420,7 +420,7 @@ HttpCache::~HttpCache() { } int HttpCache::GetBackend(disk_cache::Backend** backend, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(callback != NULL); if (disk_cache_.get()) { @@ -510,7 +510,7 @@ HttpNetworkSession* HttpCache::GetSession() { //----------------------------------------------------------------------------- int HttpCache::CreateBackend(disk_cache::Backend** backend, - CompletionCallback* callback) { + OldCompletionCallback* callback) { if (!backend_factory_.get()) return ERR_FAILED; diff --git a/net/http/http_cache.h b/net/http/http_cache.h index c756185..f6b7ffe 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -90,7 +90,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // |callback| because the object can be deleted from within the callback. virtual int CreateBackend(NetLog* net_log, disk_cache::Backend** backend, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; }; // A default backend factory for the common use cases. @@ -109,7 +109,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // BackendFactory implementation. virtual int CreateBackend(NetLog* net_log, disk_cache::Backend** backend, - CompletionCallback* callback); + OldCompletionCallback* callback); private: CacheType type_; @@ -156,7 +156,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // a network error code, and it could be ERR_IO_PENDING, in which case the // |callback| will be notified when the operation completes. The pointer that // receives the |backend| must remain valid until the operation completes. - int GetBackend(disk_cache::Backend** backend, CompletionCallback* callback); + int GetBackend(disk_cache::Backend** backend, OldCompletionCallback* callback); // Returns the current backend (can be NULL). disk_cache::Backend* GetCurrentBackend() const; @@ -242,7 +242,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // Creates the |backend| object and notifies the |callback| when the operation // completes. Returns an error code. int CreateBackend(disk_cache::Backend** backend, - CompletionCallback* callback); + OldCompletionCallback* callback); // Makes sure that the backend creation is complete before allowing the // provided transaction to use the object. Returns an error code. |trans| diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index 9b3b6e8..675564f 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc @@ -124,10 +124,10 @@ HttpCache::Transaction::Transaction(HttpCache* cache) ALLOW_THIS_IN_INITIALIZER_LIST( io_callback_(this, &Transaction::OnIOComplete)), ALLOW_THIS_IN_INITIALIZER_LIST( - cache_callback_(new CancelableCompletionCallback<Transaction>( + cache_callback_(new CancelableOldCompletionCallback<Transaction>( this, &Transaction::OnIOComplete))), ALLOW_THIS_IN_INITIALIZER_LIST( - write_headers_callback_(new CancelableCompletionCallback<Transaction>( + write_headers_callback_(new CancelableOldCompletionCallback<Transaction>( this, &Transaction::OnIOComplete))) { COMPILE_ASSERT(HttpCache::Transaction::kNumValidationHeaders == arraysize(kValidationHeaders), @@ -167,7 +167,7 @@ HttpCache::Transaction::~Transaction() { } int HttpCache::Transaction::WriteMetadata(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(buf); DCHECK_GT(buf_len, 0); DCHECK(callback); @@ -216,7 +216,7 @@ const BoundNetLog& HttpCache::Transaction::net_log() const { } int HttpCache::Transaction::Start(const HttpRequestInfo* request, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) { DCHECK(request); DCHECK(callback); @@ -245,7 +245,7 @@ int HttpCache::Transaction::Start(const HttpRequestInfo* request, } int HttpCache::Transaction::RestartIgnoringLastError( - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(callback); // Ensure that we only have one asynchronous call at a time. @@ -264,7 +264,7 @@ int HttpCache::Transaction::RestartIgnoringLastError( int HttpCache::Transaction::RestartWithCertificate( X509Certificate* client_cert, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(callback); // Ensure that we only have one asynchronous call at a time. @@ -284,7 +284,7 @@ int HttpCache::Transaction::RestartWithCertificate( int HttpCache::Transaction::RestartWithAuth( const string16& username, const string16& password, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(auth_response_.headers); DCHECK(callback); @@ -312,7 +312,7 @@ bool HttpCache::Transaction::IsReadyToRestartForAuth() { } int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(buf); DCHECK_GT(buf_len, 0); DCHECK(callback); @@ -406,7 +406,7 @@ void HttpCache::Transaction::DoCallback(int rv) { DCHECK(callback_); // Since Run may result in Read being called, clear callback_ up front. - CompletionCallback* c = callback_; + OldCompletionCallback* c = callback_; callback_ = NULL; c->Run(rv); } @@ -1923,7 +1923,7 @@ int HttpCache::Transaction::ReadFromEntry(IOBuffer* data, int data_len) { int HttpCache::Transaction::WriteToEntry(int index, int offset, IOBuffer* data, int data_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { if (!entry_) return data_len; @@ -1979,7 +1979,7 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) { } int HttpCache::Transaction::AppendResponseDataToEntry( - IOBuffer* data, int data_len, CompletionCallback* callback) { + IOBuffer* data, int data_len, OldCompletionCallback* callback) { if (!entry_ || !data_len) return data_len; diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h index ce6e79e..665f92f 100644 --- a/net/http/http_cache_transaction.h +++ b/net/http/http_cache_transaction.h @@ -80,7 +80,7 @@ class HttpCache::Transaction : public HttpTransaction { // response (or response info) must be evaluated by the caller, for instance // to make sure that the response_time is as expected, before calling this // method. - int WriteMetadata(IOBuffer* buf, int buf_len, CompletionCallback* callback); + int WriteMetadata(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); // This transaction is being deleted and we are not done writing to the cache. // We need to indicate that the response data was truncated. Returns true on @@ -93,21 +93,21 @@ class HttpCache::Transaction : public HttpTransaction { // to the cache entry. LoadState GetWriterLoadState() const; - CompletionCallback* io_callback() { return &io_callback_; } + OldCompletionCallback* io_callback() { return &io_callback_; } const BoundNetLog& net_log() const; // HttpTransaction methods: - virtual int Start(const HttpRequestInfo*, CompletionCallback*, + virtual int Start(const HttpRequestInfo*, OldCompletionCallback*, const BoundNetLog&); - virtual int RestartIgnoringLastError(CompletionCallback* callback); + virtual int RestartIgnoringLastError(OldCompletionCallback* callback); virtual int RestartWithCertificate(X509Certificate* client_cert, - CompletionCallback* callback); + OldCompletionCallback* callback); virtual int RestartWithAuth(const string16& username, const string16& password, - CompletionCallback* callback); + OldCompletionCallback* callback); virtual bool IsReadyToRestartForAuth(); - virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); + virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); virtual void StopCaching(); virtual void DoneReading(); virtual const HttpResponseInfo* GetResponseInfo() const; @@ -290,7 +290,7 @@ class HttpCache::Transaction : public HttpTransaction { // cache entry is destroyed. Future calls to this function will just do // nothing without side-effect. Returns a network error code. int WriteToEntry(int index, int offset, IOBuffer* data, int data_len, - CompletionCallback* callback); + OldCompletionCallback* callback); // Called to write response_ to the cache entry. |truncated| indicates if the // entry should be marked as incomplete. @@ -299,7 +299,7 @@ class HttpCache::Transaction : public HttpTransaction { // Called to append response data to the cache entry. Returns a network error // code. int AppendResponseDataToEntry(IOBuffer* data, int data_len, - CompletionCallback* callback); + OldCompletionCallback* callback); // Called when we are done writing to the cache entry. void DoneWritingToEntry(bool success); @@ -337,7 +337,7 @@ class HttpCache::Transaction : public HttpTransaction { base::TimeTicks entry_lock_waiting_since_; HttpCache::ActiveEntry* new_entry_; scoped_ptr<HttpTransaction> network_trans_; - CompletionCallback* callback_; // Consumer's callback. + OldCompletionCallback* callback_; // Consumer's callback. HttpResponseInfo response_; HttpResponseInfo auth_response_; const HttpResponseInfo* new_response_; @@ -359,9 +359,9 @@ class HttpCache::Transaction : public HttpTransaction { int write_len_; scoped_ptr<PartialData> partial_; // We are dealing with range requests. uint64 final_upload_progress_; - CompletionCallbackImpl<Transaction> io_callback_; - scoped_refptr<CancelableCompletionCallback<Transaction> > cache_callback_; - scoped_refptr<CancelableCompletionCallback<Transaction> > + OldCompletionCallbackImpl<Transaction> io_callback_; + scoped_refptr<CancelableOldCompletionCallback<Transaction> > cache_callback_; + scoped_refptr<CancelableOldCompletionCallback<Transaction> > write_headers_callback_; }; diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index 970b3b6..f912dd5 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -114,7 +114,7 @@ class MockDiskEntry : public disk_cache::Entry, } virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(index >= 0 && index < kNumCacheEntryDataIndices); DCHECK(callback); @@ -137,7 +137,7 @@ class MockDiskEntry : public disk_cache::Entry, } virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback, bool truncate) { + net::OldCompletionCallback* callback, bool truncate) { DCHECK(index >= 0 && index < kNumCacheEntryDataIndices); DCHECK(callback); DCHECK(truncate); @@ -162,7 +162,7 @@ class MockDiskEntry : public disk_cache::Entry, } virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(callback); if (!sparse_ || busy_) return net::ERR_CACHE_OPERATION_NOT_SUPPORTED; @@ -191,7 +191,7 @@ class MockDiskEntry : public disk_cache::Entry, } virtual int WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(callback); if (busy_) return net::ERR_CACHE_OPERATION_NOT_SUPPORTED; @@ -223,7 +223,7 @@ class MockDiskEntry : public disk_cache::Entry, } virtual int GetAvailableRange(int64 offset, int len, int64* start, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(callback); if (!sparse_ || busy_) return net::ERR_CACHE_OPERATION_NOT_SUPPORTED; @@ -266,7 +266,7 @@ class MockDiskEntry : public disk_cache::Entry, virtual void CancelSparseIO() { cancel_ = true; } - virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback) { + virtual int ReadyForSparseIO(net::OldCompletionCallback* completion_callback) { if (!cancel_) return net::OK; @@ -300,7 +300,7 @@ class MockDiskEntry : public disk_cache::Entry, struct CallbackInfo { scoped_refptr<MockDiskEntry> entry; - net::CompletionCallback* callback; + net::OldCompletionCallback* callback; int result; }; @@ -309,13 +309,13 @@ class MockDiskEntry : public disk_cache::Entry, // Unlike the callbacks for MockHttpTransaction, we want this one to run even // if the consumer called Close on the MockDiskEntry. We achieve that by // leveraging the fact that this class is reference counted. - void CallbackLater(net::CompletionCallback* callback, int result) { + void CallbackLater(net::OldCompletionCallback* callback, int result) { if (ignore_callbacks_) return StoreAndDeliverCallbacks(true, this, callback, result); MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( this, &MockDiskEntry::RunCallback, callback, result)); } - void RunCallback(net::CompletionCallback* callback, int result) { + void RunCallback(net::OldCompletionCallback* callback, int result) { if (busy_) { // This is kind of hacky, but controlling the behavior of just this entry // from a test is sort of complicated. What we really want to do is @@ -337,7 +337,7 @@ class MockDiskEntry : public disk_cache::Entry, // When |store| is true, stores the callback to be delivered later; otherwise // delivers any callback previously stored. static void StoreAndDeliverCallbacks(bool store, MockDiskEntry* entry, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, int result) { static std::vector<CallbackInfo> callback_list; if (store) { @@ -384,7 +384,7 @@ class MockDiskCache : public disk_cache::Backend { } virtual int OpenEntry(const std::string& key, disk_cache::Entry** entry, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(callback); if (fail_requests_) return net::ERR_CACHE_OPEN_FAILURE; @@ -415,7 +415,7 @@ class MockDiskCache : public disk_cache::Backend { } virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(callback); if (fail_requests_) return net::ERR_CACHE_CREATE_FAILURE; @@ -448,7 +448,7 @@ class MockDiskCache : public disk_cache::Backend { } virtual int DoomEntry(const std::string& key, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { DCHECK(callback); EntryMap::iterator it = entries_.find(key); if (it != entries_.end()) { @@ -463,23 +463,23 @@ class MockDiskCache : public disk_cache::Backend { return net::ERR_IO_PENDING; } - virtual int DoomAllEntries(net::CompletionCallback* callback) { + virtual int DoomAllEntries(net::OldCompletionCallback* callback) { return net::ERR_NOT_IMPLEMENTED; } virtual int DoomEntriesBetween(const base::Time initial_time, const base::Time end_time, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_NOT_IMPLEMENTED; } virtual int DoomEntriesSince(const base::Time initial_time, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_NOT_IMPLEMENTED; } virtual int OpenNextEntry(void** iter, disk_cache::Entry** next_entry, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_NOT_IMPLEMENTED; } @@ -515,19 +515,19 @@ class MockDiskCache : public disk_cache::Backend { class CallbackRunner : public Task { public: - CallbackRunner(net::CompletionCallback* callback, int result) + CallbackRunner(net::OldCompletionCallback* callback, int result) : callback_(callback), result_(result) {} virtual void Run() { callback_->Run(result_); } private: - net::CompletionCallback* callback_; + net::OldCompletionCallback* callback_; int result_; DISALLOW_COPY_AND_ASSIGN(CallbackRunner); }; - void CallbackLater(net::CompletionCallback* callback, int result) { + void CallbackLater(net::OldCompletionCallback* callback, int result) { MessageLoop::current()->PostTask(FROM_HERE, new CallbackRunner(callback, result)); } @@ -543,7 +543,7 @@ class MockBackendFactory : public net::HttpCache::BackendFactory { public: virtual int CreateBackend(net::NetLog* /* net_log */, disk_cache::Backend** backend, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { *backend = new MockDiskCache(); return net::OK; } @@ -565,7 +565,7 @@ class MockHttpCache { return static_cast<MockNetworkLayer*>(http_cache_.network_layer()); } MockDiskCache* disk_cache() { - TestCompletionCallback cb; + TestOldCompletionCallback cb; disk_cache::Backend* backend; int rv = http_cache_.GetBackend(&backend, &cb); rv = cb.GetResult(rv); @@ -578,7 +578,7 @@ class MockHttpCache { bool* response_truncated) { int size = disk_entry->GetDataSize(0); - TestCompletionCallback cb; + TestOldCompletionCallback cb; scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(size)); int rv = disk_entry->ReadData(0, 0, buffer, size, &cb); rv = cb.GetResult(rv); @@ -598,7 +598,7 @@ class MockHttpCache { response_info->Persist( &pickle, skip_transient_headers, response_truncated); - TestCompletionCallback cb; + TestOldCompletionCallback cb; scoped_refptr<net::WrappedIOBuffer> data(new net::WrappedIOBuffer( reinterpret_cast<const char*>(pickle.data()))); int len = static_cast<int>(pickle.size()); @@ -610,7 +610,7 @@ class MockHttpCache { // Helper function to synchronously open a backend entry. bool OpenBackendEntry(const std::string& key, disk_cache::Entry** entry) { - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = disk_cache()->OpenEntry(key, entry, &cb); return (cb.GetResult(rv) == net::OK); } @@ -618,7 +618,7 @@ class MockHttpCache { // Helper function to synchronously create a backend entry. bool CreateBackendEntry(const std::string& key, disk_cache::Entry** entry, net::NetLog* /* net_log */) { - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = disk_cache()->CreateEntry(key, entry, &cb); return (cb.GetResult(rv) == net::OK); } @@ -630,7 +630,7 @@ class MockHttpCache { // This version of the disk cache doesn't invoke CreateEntry callbacks. class MockDiskCacheNoCB : public MockDiskCache { virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_IO_PENDING; } }; @@ -639,7 +639,7 @@ class MockBackendNoCbFactory : public net::HttpCache::BackendFactory { public: virtual int CreateBackend(net::NetLog* /* net_log */, disk_cache::Backend** backend, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { *backend = new MockDiskCacheNoCB(); return net::OK; } @@ -653,7 +653,7 @@ class MockBlockingBackendFactory : public net::HttpCache::BackendFactory { virtual int CreateBackend(net::NetLog* /* net_log */, disk_cache::Backend** backend, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { if (!block_) { if (!fail_) *backend = new MockDiskCache(); @@ -672,7 +672,7 @@ class MockBlockingBackendFactory : public net::HttpCache::BackendFactory { if (callback_) { if (!fail_) *backend_ = new MockDiskCache(); - net::CompletionCallback* cb = callback_; + net::OldCompletionCallback* cb = callback_; callback_ = NULL; cb->Run(Result()); // This object can be deleted here. } @@ -681,25 +681,25 @@ class MockBlockingBackendFactory : public net::HttpCache::BackendFactory { disk_cache::Backend** backend() { return backend_; } void set_fail(bool fail) { fail_ = fail; } - net::CompletionCallback* callback() { return callback_; } + net::OldCompletionCallback* callback() { return callback_; } private: int Result() { return fail_ ? net::ERR_FAILED : net::OK; } disk_cache::Backend** backend_; - net::CompletionCallback* callback_; + net::OldCompletionCallback* callback_; bool block_; bool fail_; }; -class DeleteCacheCompletionCallback : public TestCompletionCallback { +class DeleteCacheOldCompletionCallback : public TestOldCompletionCallback { public: - explicit DeleteCacheCompletionCallback(MockHttpCache* cache) + explicit DeleteCacheOldCompletionCallback(MockHttpCache* cache) : cache_(cache) {} virtual void RunWithParams(const Tuple1<int>& params) { delete cache_; - TestCompletionCallback::RunWithParams(params); + TestOldCompletionCallback::RunWithParams(params); } private: @@ -724,7 +724,7 @@ void RunTransactionTestWithRequestAndLog(net::HttpCache* cache, const MockHttpRequest& request, net::HttpResponseInfo* response_info, const net::BoundNetLog& net_log) { - TestCompletionCallback callback; + TestOldCompletionCallback callback; // write to the cache @@ -1004,7 +1004,7 @@ void CreateTruncatedEntry(std::string raw_headers, MockHttpCache* cache) { scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(100)); int len = static_cast<int>(base::strlcpy(buf->data(), "rg: 00-09 rg: 10-19 ", 100)); - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = entry->WriteData(1, 0, buf, len, &cb, true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -1032,7 +1032,7 @@ struct Context { Context() : result(net::ERR_IO_PENDING) {} int result; - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<net::HttpTransaction> trans; }; @@ -1055,7 +1055,7 @@ TEST(HttpCache, GetBackend) { MockHttpCache cache(net::HttpCache::DefaultBackend::InMemory(0)); disk_cache::Backend* backend; - TestCompletionCallback cb; + TestOldCompletionCallback cb; // This will lazily initialize the backend. int rv = cache.http_cache()->GetBackend(&backend, &cb); EXPECT_EQ(net::OK, cb.GetResult(rv)); @@ -1279,7 +1279,7 @@ TEST(HttpCache, SimpleGET_LoadOnlyFromCache_Miss) { transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE; MockHttpRequest request(transaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<net::HttpTransaction> trans; int rv = cache.http_cache()->CreateTransaction(&trans); @@ -1928,7 +1928,7 @@ TEST(HttpCache, SimpleGET_AbandonedCacheRead) { RunTransactionTest(cache.http_cache(), kSimpleGET_Transaction); MockHttpRequest request(kSimpleGET_Transaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<net::HttpTransaction> trans; int rv = cache.http_cache()->CreateTransaction(&trans); @@ -2109,7 +2109,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend) { // We cannot call FinishCreation because the factory itself will go away with // the cache, so grab the callback and attempt to use it. - net::CompletionCallback* callback = factory->callback(); + net::OldCompletionCallback* callback = factory->callback(); disk_cache::Backend** backend = factory->backend(); cache.reset(); @@ -2125,7 +2125,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend2) { MockBlockingBackendFactory* factory = new MockBlockingBackendFactory(); MockHttpCache* cache = new MockHttpCache(factory); - DeleteCacheCompletionCallback cb(cache); + DeleteCacheOldCompletionCallback cb(cache); disk_cache::Backend* backend; int rv = cache->http_cache()->GetBackend(&backend, &cb); EXPECT_EQ(net::ERR_IO_PENDING, rv); @@ -2140,7 +2140,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend2) { c->trans->Start(&request, &c->callback, net::BoundNetLog()); // And another direct backend request. - TestCompletionCallback cb2; + TestOldCompletionCallback cb2; rv = cache->http_cache()->GetBackend(&backend, &cb2); EXPECT_EQ(net::ERR_IO_PENDING, rv); @@ -2822,7 +2822,7 @@ TEST(HttpCache, SimplePOST_LoadOnlyFromCache_Miss) { transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE; MockHttpRequest request(transaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<net::HttpTransaction> trans; int rv = cache.http_cache()->CreateTransaction(&trans); @@ -3474,7 +3474,7 @@ TEST(HttpCache, GET_Previous206_NotSparse) { scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(500)); int len = static_cast<int>(base::strlcpy(buf->data(), kRangeGET_TransactionOK.data, 500)); - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = entry->WriteData(1, 0, buf, len, &cb, true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -3518,7 +3518,7 @@ TEST(HttpCache, RangeGET_Previous206_NotSparse_2) { scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(500)); int len = static_cast<int>(base::strlcpy(buf->data(), kRangeGET_TransactionOK.data, 500)); - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = entry->WriteData(1, 0, buf, len, &cb, true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -3560,7 +3560,7 @@ TEST(HttpCache, GET_Previous206_NotValidation) { scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(500)); int len = static_cast<int>(base::strlcpy(buf->data(), kRangeGET_TransactionOK.data, 500)); - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = entry->WriteData(1, 0, buf, len, &cb, true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -3958,7 +3958,7 @@ TEST(HttpCache, RangeGET_InvalidResponse3) { ASSERT_TRUE(cache.OpenBackendEntry(kRangeGET_TransactionOK.url, &en)); int64 cached_start = 0; - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = en->GetAvailableRange(40, 20, &cached_start, &cb); EXPECT_EQ(10, cb.GetResult(rv)); EXPECT_EQ(50, cached_start); @@ -4120,7 +4120,7 @@ TEST(HttpCache, RangeGET_OK_LoadOnlyFromCache) { transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE; MockHttpRequest request(transaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<net::HttpTransaction> trans; int rv = cache.http_cache()->CreateTransaction(&trans); @@ -4701,7 +4701,7 @@ TEST(HttpCache, CachedRedirect) { kTestTransaction.response_headers = "Location: http://www.bar.com/\n"; MockHttpRequest request(kTestTransaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; // write to the cache { @@ -4856,7 +4856,7 @@ TEST(HttpCache, SimpleGET_SSLError) { transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE; MockHttpRequest request(transaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<net::HttpTransaction> trans; int rv = cache.http_cache()->CreateTransaction(&trans); @@ -5108,7 +5108,7 @@ TEST(HttpCache, ReadMetadata) { // of the stream. TEST(HttpCache, FilterCompletion) { MockHttpCache cache; - TestCompletionCallback callback; + TestOldCompletionCallback callback; { scoped_ptr<net::HttpTransaction> trans; @@ -5142,7 +5142,7 @@ TEST(HttpCache, FilterCompletion) { // a Content-Length header. TEST(HttpCache, TruncatedByContentLength) { MockHttpCache cache; - TestCompletionCallback callback; + TestOldCompletionCallback callback; MockTransaction transaction(kSimpleGET_Transaction); AddMockTransaction(&transaction); @@ -5163,7 +5163,7 @@ TEST(HttpCache, TruncatedByContentLength) { // from the net. TEST(HttpCache, TruncatedByContentLength2) { MockHttpCache cache; - TestCompletionCallback callback; + TestOldCompletionCallback callback; MockTransaction transaction(kSimpleGET_Transaction); AddMockTransaction(&transaction); @@ -5186,14 +5186,14 @@ TEST(HttpCache, TruncatedByContentLength2) { //----------------------------------------------------------------------------- // DiskCacheBasedSSLHostInfo tests -class DeleteSSLHostInfoCompletionCallback : public TestCompletionCallback { +class DeleteSSLHostInfoOldCompletionCallback : public TestOldCompletionCallback { public: - explicit DeleteSSLHostInfoCompletionCallback(net::SSLHostInfo* ssl_host_info) + explicit DeleteSSLHostInfoOldCompletionCallback(net::SSLHostInfo* ssl_host_info) : ssl_host_info_(ssl_host_info) {} virtual void RunWithParams(const Tuple1<int>& params) { delete ssl_host_info_; - TestCompletionCallback::RunWithParams(params); + TestOldCompletionCallback::RunWithParams(params); } private: @@ -5213,7 +5213,7 @@ TEST(DiskCacheBasedSSLHostInfo, DeleteInCallback) { new net::DiskCacheBasedSSLHostInfo("https://www.verisign.com", ssl_config, &cert_verifier, cache.http_cache()); ssl_host_info->Start(); - DeleteSSLHostInfoCompletionCallback callback(ssl_host_info); + DeleteSSLHostInfoOldCompletionCallback callback(ssl_host_info); int rv = ssl_host_info->WaitForDataReady(&callback); EXPECT_EQ(net::ERR_IO_PENDING, rv); // Now complete the backend creation and let the callback run. diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc index 3c356e8..118ed20 100644 --- a/net/http/http_network_layer_unittest.cc +++ b/net/http/http_network_layer_unittest.cc @@ -86,7 +86,7 @@ TEST_F(HttpNetworkLayerTest, GET) { data_writes, arraysize(data_writes)); mock_socket_factory_.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request_info; request_info.url = GURL("http://www.google.com/"); diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index d1e7ec5..e88f254 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -150,7 +150,7 @@ HttpNetworkTransaction::~HttpNetworkTransaction() { } int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) { SIMPLE_STATS_COUNTER("HttpNetworkTransaction.Count"); @@ -169,7 +169,7 @@ int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, } int HttpNetworkTransaction::RestartIgnoringLastError( - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(!stream_.get()); DCHECK(!stream_request_.get()); DCHECK_EQ(STATE_NONE, next_state_); @@ -184,7 +184,7 @@ int HttpNetworkTransaction::RestartIgnoringLastError( int HttpNetworkTransaction::RestartWithCertificate( X509Certificate* client_cert, - CompletionCallback* callback) { + OldCompletionCallback* callback) { // In HandleCertificateRequest(), we always tear down existing stream // requests to force a new connection. So we shouldn't have one here. DCHECK(!stream_request_.get()); @@ -210,7 +210,7 @@ int HttpNetworkTransaction::RestartWithCertificate( int HttpNetworkTransaction::RestartWithAuth( const string16& username, const string16& password, - CompletionCallback* callback) { + OldCompletionCallback* callback) { HttpAuth::Target target = pending_auth_target_; if (target == HttpAuth::AUTH_NONE) { NOTREACHED(); @@ -303,7 +303,7 @@ bool HttpNetworkTransaction::IsReadyToRestartForAuth() { } int HttpNetworkTransaction::Read(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(buf); DCHECK_LT(0, buf_len); @@ -476,7 +476,7 @@ void HttpNetworkTransaction::DoCallback(int rv) { DCHECK(user_callback_); // Since Run may result in Read being called, clear user_callback_ up front. - CompletionCallback* c = user_callback_; + OldCompletionCallback* c = user_callback_; user_callback_ = NULL; c->Run(rv); } diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index c450bcb..770c6ba 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -42,17 +42,17 @@ class NET_EXPORT_PRIVATE HttpNetworkTransaction // HttpTransaction methods: virtual int Start(const HttpRequestInfo* request_info, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log); - virtual int RestartIgnoringLastError(CompletionCallback* callback); + virtual int RestartIgnoringLastError(OldCompletionCallback* callback); virtual int RestartWithCertificate(X509Certificate* client_cert, - CompletionCallback* callback); + OldCompletionCallback* callback); virtual int RestartWithAuth(const string16& username, const string16& password, - CompletionCallback* callback); + OldCompletionCallback* callback); virtual bool IsReadyToRestartForAuth(); - virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); + virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); virtual void StopCaching() {} virtual void DoneReading() {} virtual const HttpResponseInfo* GetResponseInfo() const; @@ -224,8 +224,8 @@ class NET_EXPORT_PRIVATE HttpNetworkTransaction // cleared by RestartWithAuth(). HttpAuth::Target pending_auth_target_; - CompletionCallbackImpl<HttpNetworkTransaction> io_callback_; - CompletionCallback* user_callback_; + OldCompletionCallbackImpl<HttpNetworkTransaction> io_callback_; + OldCompletionCallback* user_callback_; scoped_ptr<UploadDataStream> request_body_; scoped_refptr<HttpNetworkSession> session_; diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index b49b9e7..9817709 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -159,7 +159,7 @@ class HttpNetworkTransactionTest : public PlatformTest { StaticSocketDataProvider data(data_reads, reads_count, NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; CapturingBoundNetLog log(CapturingNetLog::kUnbounded); EXPECT_TRUE(log.bound().IsLoggingAllEvents()); @@ -270,7 +270,7 @@ class CaptureGroupNameSocketPool : public ParentPool { const void* socket_params, RequestPriority priority, ClientSocketHandle* handle, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) { last_group_name_ = group_name; return ERR_IO_PENDING; @@ -642,7 +642,7 @@ TEST_F(HttpNetworkTransactionTest, Head) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -699,7 +699,7 @@ TEST_F(HttpNetworkTransactionTest, ReuseConnection) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -741,7 +741,7 @@ TEST_F(HttpNetworkTransactionTest, Ignores100) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -783,7 +783,7 @@ TEST_F(HttpNetworkTransactionTest, Ignores1xx) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -820,7 +820,7 @@ TEST_F(HttpNetworkTransactionTest, Incomplete100ThenEOF) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -850,7 +850,7 @@ TEST_F(HttpNetworkTransactionTest, EmptyResponse) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -892,7 +892,7 @@ void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest( }; for (int i = 0; i < 2; ++i) { - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -944,7 +944,7 @@ TEST_F(HttpNetworkTransactionTest, NonKeepAliveConnectionReset) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1021,7 +1021,7 @@ TEST_F(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) { std::string response_lines[kNumUnreadBodies]; for (size_t i = 0; i < arraysize(data1_reads) - 2; ++i) { - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -1056,7 +1056,7 @@ TEST_F(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) { for (int i = 0; i < kNumUnreadBodies; ++i) EXPECT_EQ(kStatusLines[i], response_lines[i]); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1127,7 +1127,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuth) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1139,7 +1139,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuth) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1181,7 +1181,7 @@ TEST_F(HttpNetworkTransactionTest, DoNotSendAuth) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1245,7 +1245,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); int rv = trans->Start(&request, &callback1, BoundNetLog()); @@ -1258,7 +1258,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1320,7 +1320,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); int rv = trans->Start(&request, &callback1, BoundNetLog()); @@ -1333,7 +1333,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1403,7 +1403,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); int rv = trans->Start(&request, &callback1, BoundNetLog()); @@ -1416,7 +1416,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1488,7 +1488,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); int rv = trans->Start(&request, &callback1, BoundNetLog()); @@ -1501,7 +1501,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1570,7 +1570,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAlive) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -1596,7 +1596,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAlive) { EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1672,7 +1672,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1698,7 +1698,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) { EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; // Wrong password (should be "bar"). rv = trans->RestartWithAuth(kFoo, kBaz, &callback2); @@ -1755,7 +1755,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1810,7 +1810,7 @@ TEST_F(HttpNetworkTransactionTest, UnexpectedProxyAuth) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1862,7 +1862,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsServerRequestsProxyAuthThroughProxy) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -1914,7 +1914,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxyGet) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -1975,7 +1975,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyGet) { ssl.was_npn_negotiated = true; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -2061,7 +2061,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { ssl.was_npn_negotiated = true; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -2079,7 +2079,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2156,7 +2156,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { ssl2.was_npn_negotiated = false; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2230,7 +2230,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { ssl2.was_npn_negotiated = true; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2296,7 +2296,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { ssl2.was_npn_negotiated = true; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2359,7 +2359,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxyAuthRetry) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -2376,7 +2376,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxyAuthRetry) { EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2426,7 +2426,7 @@ void HttpNetworkTransactionTest::ConnectStatusHelperWithExpectedStatus( data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -2690,7 +2690,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { session_deps.socket_factory.AddSocketDataProvider(&data2); session_deps.socket_factory.AddSocketDataProvider(&data3); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2702,7 +2702,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2714,7 +2714,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; rv = trans->RestartWithAuth(kFoo2, kBar2, &callback3); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2819,7 +2819,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth1) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -2835,7 +2835,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth1) { ASSERT_FALSE(response == NULL); EXPECT_TRUE(CheckNTLMServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kTestingNTLM, kTestingNTLM, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2849,7 +2849,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth1) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(response->auth_challenge.get() == NULL); - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; rv = trans->RestartWithAuth(string16(), string16(), &callback3); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2998,7 +2998,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { session_deps.socket_factory.AddSocketDataProvider(&data2); session_deps.socket_factory.AddSocketDataProvider(&data3); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -3014,7 +3014,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckNTLMServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; // Enter the wrong password. rv = trans->RestartWithAuth(kTestingNTLM, kWrongPassword, &callback2); @@ -3024,7 +3024,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { EXPECT_EQ(OK, rv); EXPECT_TRUE(trans->IsReadyToRestartForAuth()); - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; rv = trans->RestartWithAuth(string16(), string16(), &callback3); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback3.WaitForResult(); @@ -3035,7 +3035,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { ASSERT_FALSE(response == NULL); EXPECT_TRUE(CheckNTLMServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback4; + TestOldCompletionCallback callback4; // Now enter the right password. rv = trans->RestartWithAuth(kTestingNTLM, kTestingNTLM, &callback4); @@ -3046,7 +3046,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) { EXPECT_TRUE(trans->IsReadyToRestartForAuth()); - TestCompletionCallback callback5; + TestOldCompletionCallback callback5; // One more roundtrip rv = trans->RestartWithAuth(string16(), string16(), &callback5); @@ -3087,7 +3087,7 @@ TEST_F(HttpNetworkTransactionTest, LargeHeadersNoBody) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3135,7 +3135,7 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTransportSocketForSSLTunnel) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3184,7 +3184,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocket) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3243,7 +3243,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSSLSocket) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -3311,7 +3311,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleDeadSSLSocket) { session_deps.socket_factory.AddSocketDataProvider(&data); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -3395,7 +3395,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3491,7 +3491,7 @@ TEST_F(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request[i], &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3566,7 +3566,7 @@ TEST_F(HttpNetworkTransactionTest, AuthIdentityInURL) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3575,7 +3575,7 @@ TEST_F(HttpNetworkTransactionTest, AuthIdentityInURL) { EXPECT_EQ(OK, rv); EXPECT_TRUE(trans->IsReadyToRestartForAuth()); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(string16(), string16(), &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback2.WaitForResult(); @@ -3664,7 +3664,7 @@ TEST_F(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { session_deps.socket_factory.AddSocketDataProvider(&data2); session_deps.socket_factory.AddSocketDataProvider(&data3); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3673,7 +3673,7 @@ TEST_F(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { EXPECT_EQ(OK, rv); EXPECT_TRUE(trans->IsReadyToRestartForAuth()); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(string16(), string16(), &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback2.WaitForResult(); @@ -3684,7 +3684,7 @@ TEST_F(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; rv = trans->RestartWithAuth(kFoo, kBar, &callback3); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback3.WaitForResult(); @@ -3752,7 +3752,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3764,7 +3764,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3830,7 +3830,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3847,7 +3847,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { EXPECT_EQ("MyRealm2", response->auth_challenge->realm); EXPECT_EQ("basic", response->auth_challenge->scheme); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo2, kBar2, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3893,7 +3893,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3955,7 +3955,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3964,7 +3964,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { EXPECT_EQ(OK, rv); EXPECT_TRUE(trans->IsReadyToRestartForAuth()); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(string16(), string16(), &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback2.WaitForResult(); @@ -4044,7 +4044,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { session_deps.socket_factory.AddSocketDataProvider(&data2); session_deps.socket_factory.AddSocketDataProvider(&data3); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4053,7 +4053,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { EXPECT_EQ(OK, rv); EXPECT_TRUE(trans->IsReadyToRestartForAuth()); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(string16(), string16(), &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback2.WaitForResult(); @@ -4064,7 +4064,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; rv = trans->RestartWithAuth(kFoo3, kBar3, &callback3); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4137,7 +4137,7 @@ TEST_F(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { session_deps.socket_factory.AddSocketDataProvider(&data1); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4149,7 +4149,7 @@ TEST_F(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckDigestServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4198,7 +4198,7 @@ TEST_F(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4290,7 +4290,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificate) { session_deps.socket_factory.AddSSLSocketDataProvider(&ssl_bad); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4361,7 +4361,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { session_deps.socket_factory.AddSSLSocketDataProvider(&ssl_bad); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; for (int i = 0; i < 2; i++) { session_deps.socket_factory.ResetNextMockIndexes(); @@ -4424,7 +4424,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSViaHttpsProxy) { session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); session_deps.socket_factory.AddSSLSocketDataProvider(&tunnel_ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -4474,7 +4474,7 @@ TEST_F(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaHttpsProxy) { session_deps.socket_factory.AddSocketDataProvider(&data); session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -4535,7 +4535,7 @@ TEST_F(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) { session_deps.socket_factory.AddSocketDataProvider(data.get()); session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -4585,7 +4585,7 @@ TEST_F(HttpNetworkTransactionTest, ErrorResponseTofHttpsConnectViaHttpsProxy) { session_deps.socket_factory.AddSocketDataProvider(&data); session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -4654,7 +4654,7 @@ TEST_F(HttpNetworkTransactionTest, ErrorResponseTofHttpsConnectViaSpdyProxy) { session_deps.socket_factory.AddSocketDataProvider(data.get()); session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -4734,7 +4734,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificateViaHttpsProxy) { session_deps.socket_factory.AddSocketDataProvider(&data); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -4787,7 +4787,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_UserAgent) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4825,7 +4825,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_UserAgentOverTunnel) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4865,7 +4865,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_Referer) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4902,7 +4902,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_PostContentLengthZero) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4939,7 +4939,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_PutContentLengthZero) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4976,7 +4976,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_HeadContentLengthZero) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5015,7 +5015,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_CacheControlNoCache) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5054,7 +5054,7 @@ TEST_F(HttpNetworkTransactionTest, data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5092,7 +5092,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5134,7 +5134,7 @@ TEST_F(HttpNetworkTransactionTest, BuildRequest_ExtraHeadersStripped) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5177,7 +5177,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5233,7 +5233,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5298,7 +5298,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5368,7 +5368,7 @@ TEST_F(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5417,7 +5417,7 @@ int GroupNameTransactionHelper( scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; // We do not complete this request, the dtor will clean the transaction up. return trans->Start(&request, &callback, BoundNetLog()); @@ -5629,7 +5629,7 @@ TEST_F(HttpNetworkTransactionTest, ReconsiderProxyAfterFailedConnection) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5707,7 +5707,7 @@ TEST_F(HttpNetworkTransactionTest, ResolveMadeWithReferrer) { session_deps.socket_factory.AddSocketDataProvider(&data); // Run the request until it fails reading from the socket. - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -5736,7 +5736,7 @@ void BypassHostCacheOnRefreshHelper(int load_flags) { // Warm up the host cache so it has an entry for "www.google.com". AddressList addrlist; - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = session_deps.host_resolver->Resolve( HostResolver::RequestInfo(HostPortPair("www.google.com", 80)), &addrlist, &callback, NULL, BoundNetLog()); @@ -5803,7 +5803,7 @@ TEST_F(HttpNetworkTransactionTest, RequestWriteError) { write_failure, arraysize(write_failure)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -5833,7 +5833,7 @@ TEST_F(HttpNetworkTransactionTest, ConnectionClosedAfterStartOfHeaders) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -5907,7 +5907,7 @@ TEST_F(HttpNetworkTransactionTest, DrainResetOK) { data_writes2, arraysize(data_writes2)); session_deps.socket_factory.AddSocketDataProvider(&data2); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -5921,7 +5921,7 @@ TEST_F(HttpNetworkTransactionTest, DrainResetOK) { ASSERT_TRUE(response != NULL); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5955,7 +5955,7 @@ TEST_F(HttpNetworkTransactionTest, HTTPSViaProxyWithExtraData) { session_deps.socket_factory.AddSocketDataProvider(&data); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback; + TestOldCompletionCallback callback; session_deps.socket_factory.ResetNextMockIndexes(); @@ -5987,7 +5987,7 @@ TEST_F(HttpNetworkTransactionTest, LargeContentLengthThenClose) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6036,7 +6036,7 @@ TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6099,7 +6099,7 @@ TEST_F(HttpNetworkTransactionTest, UploadUnreadableFile) { arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6167,7 +6167,7 @@ TEST_F(HttpNetworkTransactionTest, UnreadableUploadFileAfterAuthRestart) { arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; int rv = trans->Start(&request, &callback1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6184,7 +6184,7 @@ TEST_F(HttpNetworkTransactionTest, UnreadableUploadFileAfterAuthRestart) { // Now make the file unreadable and try again. ASSERT_TRUE(file_util::MakeFileUnreadable(temp_file)); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFoo, kBar, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6284,7 +6284,7 @@ TEST_F(HttpNetworkTransactionTest, ChangeAuthRealms) { session_deps.socket_factory.AddSocketDataProvider(&data3); session_deps.socket_factory.AddSocketDataProvider(&data4); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(CreateSession(&session_deps))); @@ -6308,7 +6308,7 @@ TEST_F(HttpNetworkTransactionTest, ChangeAuthRealms) { // Issue the second request with an incorrect password. There should be a // password prompt for second_realm waiting to be filled in after the // transaction completes. - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; rv = trans->RestartWithAuth(kFirst, kBaz, &callback2); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback2.WaitForResult(); @@ -6326,7 +6326,7 @@ TEST_F(HttpNetworkTransactionTest, ChangeAuthRealms) { // a password prompt for first_realm waiting to be filled in. If the password // prompt is not present, it indicates that the HttpAuthCacheEntry for // first_realm was not correctly removed. - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; rv = trans->RestartWithAuth(kSecond, kFou, &callback3); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback3.WaitForResult(); @@ -6341,7 +6341,7 @@ TEST_F(HttpNetworkTransactionTest, ChangeAuthRealms) { EXPECT_EQ("basic", challenge->scheme); // Issue the fourth request with the correct password and username. - TestCompletionCallback callback4; + TestOldCompletionCallback callback4; rv = trans->RestartWithAuth(kFirst, kBar, &callback4); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback4.WaitForResult(); @@ -6373,7 +6373,7 @@ TEST_F(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) { session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -6435,7 +6435,7 @@ TEST_F(HttpNetworkTransactionTest, MarkBrokenAlternateProtocolAndFallback) { data_reads, arraysize(data_reads), NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&second_data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); @@ -6522,7 +6522,7 @@ TEST_F(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { session_deps.socket_factory.AddSocketDataProvider( &hanging_non_alternate_protocol_socket); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); @@ -6627,7 +6627,7 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) { session_deps.socket_factory.AddSocketDataProvider(&hanging_socket); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; HttpNetworkTransaction trans1(session); int rv = trans1.Start(&request, &callback1, BoundNetLog()); @@ -6643,12 +6643,12 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) { ASSERT_EQ(OK, ReadTransaction(&trans1, &response_data)); EXPECT_EQ("hello world", response_data); - TestCompletionCallback callback2; + TestOldCompletionCallback callback2; HttpNetworkTransaction trans2(session); rv = trans2.Start(&request, &callback2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); - TestCompletionCallback callback3; + TestOldCompletionCallback callback3; HttpNetworkTransaction trans3(session); rv = trans3.Start(&request, &callback3, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6716,7 +6716,7 @@ TEST_F(HttpNetworkTransactionTest, StallAlternateProtocolForNpnSpdy) { // 2nd request is just a copy of the first one, over HTTP again. session_deps.socket_factory.AddSocketDataProvider(&first_transaction); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); @@ -6761,7 +6761,7 @@ class CapturingProxyResolver : public ProxyResolver { virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, - CompletionCallback* callback, + OldCompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log) { ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, @@ -6780,7 +6780,7 @@ class CapturingProxyResolver : public ProxyResolver { } virtual int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&, - CompletionCallback* /*callback*/) { + OldCompletionCallback* /*callback*/) { return OK; } @@ -6861,7 +6861,7 @@ TEST_F(HttpNetworkTransactionTest, UseAlternateProtocolForTunneledNpnSpdy) { session_deps.socket_factory.AddSocketDataProvider( &hanging_non_alternate_protocol_socket); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); @@ -6954,7 +6954,7 @@ TEST_F(HttpNetworkTransactionTest, spdy_writes, arraysize(spdy_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy_data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); @@ -7409,7 +7409,7 @@ TEST_F(HttpNetworkTransactionTest, GenerateAuthToken) { &ssl_socket_data_provider); // Start or restart the transaction. - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv; if (round == 0) { rv = trans.Start(&request, &callback, BoundNetLog()); @@ -7482,7 +7482,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) { session_peer.SetTransportSocketPool(transport_pool); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; const MockWrite kGet( "GET / HTTP/1.1\r\n" @@ -7552,7 +7552,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) { // claimed. scoped_ptr<HttpTransaction> trans_compete( new HttpNetworkTransaction(session)); - TestCompletionCallback callback_compete; + TestOldCompletionCallback callback_compete; rv = trans_compete->Start(&request, &callback_compete, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // callback_compete.WaitForResult at this point would stall forever, @@ -7675,7 +7675,7 @@ TEST_F(HttpNetworkTransactionTest, RestartAfterTLSDecompressionFailure) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7717,7 +7717,7 @@ TEST_F(HttpNetworkTransactionTest, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request, &callback, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7767,7 +7767,7 @@ TEST_F(HttpNetworkTransactionTest, NpnWithHttpOverSSL) { data_writes, arraysize(data_writes)); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -7826,7 +7826,7 @@ TEST_F(HttpNetworkTransactionTest, SpdyPostNPNServerHangup) { spdy_writes, arraysize(spdy_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy_data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); @@ -7957,14 +7957,14 @@ TEST_F(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // First round should work and provide the Alternate-Protocol state. - TestCompletionCallback callback_1; + TestOldCompletionCallback callback_1; scoped_ptr<HttpTransaction> trans_1(new HttpNetworkTransaction(session)); int rv = trans_1->Start(&request, &callback_1, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback_1.WaitForResult()); // Second round should attempt a tunnel connect and get an auth challenge. - TestCompletionCallback callback_2; + TestOldCompletionCallback callback_2; scoped_ptr<HttpTransaction> trans_2(new HttpNetworkTransaction(session)); rv = trans_2->Start(&request, &callback_2, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7974,7 +7974,7 @@ TEST_F(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { ASSERT_FALSE(response->auth_challenge.get() == NULL); // Restart with auth. Tunnel should work and response received. - TestCompletionCallback callback_3; + TestOldCompletionCallback callback_3; rv = trans_2->RestartWithAuth(kFoo, kBar, &callback_3); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback_3.WaitForResult()); @@ -8018,7 +8018,7 @@ TEST_F(HttpNetworkTransactionTest, SimpleCancel) { data.set_connect_data(mock_connect); session_deps.socket_factory.AddSocketDataProvider(&data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; CapturingBoundNetLog log(CapturingNetLog::kUnbounded); int rv = trans->Start(&request, &callback, log.bound()); @@ -8056,7 +8056,7 @@ TEST_F(HttpNetworkTransactionTest, ProxyGet) { data_writes1, arraysize(data_writes1)); session_deps.socket_factory.AddSocketDataProvider(&data1); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -8113,7 +8113,7 @@ TEST_F(HttpNetworkTransactionTest, ProxyTunnelGet) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -8177,7 +8177,7 @@ TEST_F(HttpNetworkTransactionTest, ProxyTunnelGetHangup) { SSLSocketDataProvider ssl(true, OK); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - TestCompletionCallback callback1; + TestOldCompletionCallback callback1; scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); @@ -8235,7 +8235,7 @@ TEST_F(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) { session->spdy_session_pool()->Get(pair, BoundNetLog()); scoped_refptr<TransportSocketParams> transport_params( new TransportSocketParams(host_port_pair, MEDIUM, GURL(), false, false)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); EXPECT_EQ(ERR_IO_PENDING, @@ -8282,7 +8282,7 @@ static void CheckErrorIsPassedBack(int error, bool async) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request_info, &callback, net::BoundNetLog()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); @@ -8360,7 +8360,7 @@ TEST_F(HttpNetworkTransactionTest, ClientAuthCertCache_Direct_NoFalseStart) { scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); // Begin the SSL handshake with the peer. This consumes ssl_data1. - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request_info, &callback, net::BoundNetLog()); ASSERT_EQ(net::ERR_IO_PENDING, rv); @@ -8465,7 +8465,7 @@ TEST_F(HttpNetworkTransactionTest, ClientAuthCertCache_Direct_FalseStart) { scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); // Begin the initial SSL handshake. - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&request_info, &callback, net::BoundNetLog()); ASSERT_EQ(net::ERR_IO_PENDING, rv); @@ -8559,7 +8559,7 @@ TEST_F(HttpNetworkTransactionTest, ClientAuthCertCache_Proxy_Fail) { new HttpNetworkTransaction(session)); // Begin the SSL handshake with the proxy. - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = trans->Start(&requests[i], &callback, net::BoundNetLog()); ASSERT_EQ(net::ERR_IO_PENDING, rv); @@ -8618,7 +8618,7 @@ void IPPoolingAddAlias(MockCachingHostResolver* host_resolver, // Resolve the host and port. AddressList addresses; HostResolver::RequestInfo info(host_port_pair); - TestCompletionCallback callback; + TestOldCompletionCallback callback; int rv = host_resolver->Resolve(info, &addresses, &callback, NULL, BoundNetLog()); if (rv == ERR_IO_PENDING) @@ -8686,7 +8686,7 @@ TEST_F(HttpNetworkTransactionTest, UseIPConnectionPooling) { spdy_writes, arraysize(spdy_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy_data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request1; request1.method = "GET"; request1.url = GURL("https://www.google.com/"); @@ -8756,7 +8756,7 @@ class OneTimeCachingHostResolver : public net::HostResolver { // HostResolver methods: virtual int Resolve(const RequestInfo& info, AddressList* addresses, - CompletionCallback* callback, + OldCompletionCallback* callback, RequestHandle* out_req, const BoundNetLog& net_log) OVERRIDE { return host_resolver_.Resolve( @@ -8846,7 +8846,7 @@ TEST_F(HttpNetworkTransactionTest, spdy_writes, arraysize(spdy_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy_data); - TestCompletionCallback callback; + TestOldCompletionCallback callback; HttpRequestInfo request1; request1.method = "GET"; request1.url = GURL("https://www.google.com/"); diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index 1466796..32ccb1b 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc @@ -63,7 +63,7 @@ HttpProxyClientSocket::~HttpProxyClientSocket() { Disconnect(); } -int HttpProxyClientSocket::RestartWithAuth(CompletionCallback* callback) { +int HttpProxyClientSocket::RestartWithAuth(OldCompletionCallback* callback) { DCHECK_EQ(STATE_NONE, next_state_); DCHECK(!user_callback_); @@ -87,7 +87,7 @@ HttpStream* HttpProxyClientSocket::CreateConnectResponseStream() { } -int HttpProxyClientSocket::Connect(CompletionCallback* callback) { +int HttpProxyClientSocket::Connect(OldCompletionCallback* callback) { DCHECK(transport_.get()); DCHECK(transport_->socket()); DCHECK(!user_callback_); @@ -183,7 +183,7 @@ base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { } int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(!user_callback_); if (next_state_ != STATE_DONE) { // We're trying to read the body of the response but we're still trying @@ -203,7 +203,7 @@ int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, } int HttpProxyClientSocket::Write(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK_EQ(STATE_DONE, next_state_); DCHECK(!user_callback_); @@ -290,7 +290,7 @@ void HttpProxyClientSocket::DoCallback(int result) { // Since Run() may result in Read being called, // clear user_callback_ up front. - CompletionCallback* c = user_callback_; + OldCompletionCallback* c = user_callback_; user_callback_ = NULL; c->Run(result); } diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h index b1f32a6..816a5cb 100644 --- a/net/http/http_proxy_client_socket.h +++ b/net/http/http_proxy_client_socket.h @@ -54,7 +54,7 @@ class HttpProxyClientSocket : public ProxyClientSocket { // If Connect (or its callback) returns PROXY_AUTH_REQUESTED, then // credentials should be added to the HttpAuthController before calling // RestartWithAuth. - int RestartWithAuth(CompletionCallback* callback); + int RestartWithAuth(OldCompletionCallback* callback); const scoped_refptr<HttpAuthController>& auth_controller() { return auth_; @@ -69,7 +69,7 @@ class HttpProxyClientSocket : public ProxyClientSocket { virtual HttpStream* CreateConnectResponseStream(); // StreamSocket methods: - virtual int Connect(CompletionCallback* callback); + virtual int Connect(OldCompletionCallback* callback); virtual void Disconnect(); virtual bool IsConnected() const; virtual bool IsConnectedAndIdle() const; @@ -82,8 +82,8 @@ class HttpProxyClientSocket : public ProxyClientSocket { virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: - virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); - virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); + virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); + virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); virtual bool SetReceiveBufferSize(int32 size); virtual bool SetSendBufferSize(int32 size); virtual int GetPeerAddress(AddressList* address) const; @@ -132,11 +132,11 @@ class HttpProxyClientSocket : public ProxyClientSocket { int DoTCPRestart(); int DoTCPRestartComplete(int result); - CompletionCallbackImpl<HttpProxyClientSocket> io_callback_; + OldCompletionCallbackImpl<HttpProxyClientSocket> io_callback_; State next_state_; // Stores the callback to the layer above, called on completing Connect(). - CompletionCallback* user_callback_; + OldCompletionCallback* user_callback_; HttpRequestInfo request_; HttpResponseInfo response_; diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc index 69af61f..b433f26 100644 --- a/net/http/http_proxy_client_socket_pool.cc +++ b/net/http/http_proxy_client_socket_pool.cc @@ -400,7 +400,7 @@ int HttpProxyClientSocketPool::RequestSocket(const std::string& group_name, const void* socket_params, RequestPriority priority, ClientSocketHandle* handle, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) { const scoped_refptr<HttpProxySocketParams>* casted_socket_params = static_cast<const scoped_refptr<HttpProxySocketParams>*>(socket_params); diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h index 07f67b0..66897d2 100644 --- a/net/http/http_proxy_client_socket_pool.h +++ b/net/http/http_proxy_client_socket_pool.h @@ -155,7 +155,7 @@ class HttpProxyConnectJob : public ConnectJob { HostResolver* const resolver_; State next_state_; - CompletionCallbackImpl<HttpProxyConnectJob> callback_; + OldCompletionCallbackImpl<HttpProxyConnectJob> callback_; scoped_ptr<ClientSocketHandle> transport_socket_handle_; scoped_ptr<ProxyClientSocket> transport_socket_; bool using_spdy_; @@ -185,7 +185,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool : public ClientSocketPool { const void* connect_params, RequestPriority priority, ClientSocketHandle* handle, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log); virtual void RequestSockets(const std::string& group_name, diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index 0a1a2d5..b43b8fc 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc @@ -213,7 +213,7 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam { scoped_refptr<DeterministicSocketData> data_; HttpProxyClientSocketPool pool_; ClientSocketHandle handle_; - TestCompletionCallback callback_; + TestOldCompletionCallback callback_; }; //----------------------------------------------------------------------------- diff --git a/net/http/http_response_body_drainer.h b/net/http/http_response_body_drainer.h index 57cfc5c..cdcd65c 100644 --- a/net/http/http_response_body_drainer.h +++ b/net/http/http_response_body_drainer.h @@ -56,8 +56,8 @@ class NET_EXPORT_PRIVATE HttpResponseBodyDrainer { const scoped_ptr<HttpStream> stream_; State next_state_; int total_read_; - CompletionCallbackImpl<HttpResponseBodyDrainer> io_callback_; - CompletionCallback* user_callback_; + OldCompletionCallbackImpl<HttpResponseBodyDrainer> io_callback_; + OldCompletionCallback* user_callback_; base::OneShotTimer<HttpResponseBodyDrainer> timer_; HttpNetworkSession* session_; diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 47602e9..fc3db49 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc @@ -74,17 +74,17 @@ class MockHttpStream : public HttpStream { // HttpStream implementation: virtual int InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback) OVERRIDE { + OldCompletionCallback* callback) OVERRIDE { return ERR_UNEXPECTED; } virtual int SendRequest(const HttpRequestHeaders& request_headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback) OVERRIDE { + OldCompletionCallback* callback) OVERRIDE { return ERR_UNEXPECTED; } virtual uint64 GetUploadProgress() const OVERRIDE { return 0; } - virtual int ReadResponseHeaders(CompletionCallback* callback) OVERRIDE { + virtual int ReadResponseHeaders(OldCompletionCallback* callback) OVERRIDE { return ERR_UNEXPECTED; } virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE { @@ -102,7 +102,7 @@ class MockHttpStream : public HttpStream { // Mocked API virtual int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback) OVERRIDE; + OldCompletionCallback* callback) OVERRIDE; virtual void Close(bool not_reusable) OVERRIDE { DCHECK(!closed_); closed_ = true; @@ -131,7 +131,7 @@ class MockHttpStream : public HttpStream { CloseResultWaiter* const result_waiter_; scoped_refptr<IOBuffer> user_buf_; - CompletionCallback* user_callback_; + OldCompletionCallback* user_callback_; bool closed_; bool stall_reads_forever_; int num_chunks_; @@ -140,7 +140,7 @@ class MockHttpStream : public HttpStream { }; int MockHttpStream::ReadResponseBody( - IOBuffer* buf, int buf_len, CompletionCallback* callback) { + IOBuffer* buf, int buf_len, OldCompletionCallback* callback) { DCHECK(callback); DCHECK(!user_callback_); DCHECK(buf); @@ -168,7 +168,7 @@ int MockHttpStream::ReadResponseBody( } void MockHttpStream::CompleteRead() { - CompletionCallback* callback = user_callback_; + OldCompletionCallback* callback = user_callback_; std::memset(user_buf_->data(), 1, kMagicChunkSize); user_buf_ = NULL; user_callback_ = NULL; @@ -238,7 +238,7 @@ TEST_F(HttpResponseBodyDrainerTest, CancelledBySession) { } TEST_F(HttpResponseBodyDrainerTest, DrainBodyTooLarge) { - TestCompletionCallback callback; + TestOldCompletionCallback callback; int too_many_chunks = HttpResponseBodyDrainer::kDrainBodyBufferSize / kMagicChunkSize; too_many_chunks += 1; // Now it's too large. diff --git a/net/http/http_stream.h b/net/http/http_stream.h index 45dc46c..7460fb7 100644 --- a/net/http/http_stream.h +++ b/net/http/http_stream.h @@ -40,7 +40,7 @@ class NET_EXPORT_PRIVATE HttpStream { // Returns a net error code, possibly ERR_IO_PENDING. virtual int InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; // Writes the headers and uploads body data to the underlying socket. // ERR_IO_PENDING is returned if the operation could not be completed @@ -50,7 +50,7 @@ class NET_EXPORT_PRIVATE HttpStream { virtual int SendRequest(const HttpRequestHeaders& request_headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; // Queries the UploadDataStream for its progress (bytes sent). virtual uint64 GetUploadProgress() const = 0; @@ -60,7 +60,7 @@ class NET_EXPORT_PRIVATE HttpStream { // not be completed synchronously, in which case the result will be passed // to the callback when available. Returns OK on success. The response // headers are available in the HttpResponseInfo returned by GetResponseInfo - virtual int ReadResponseHeaders(CompletionCallback* callback) = 0; + virtual int ReadResponseHeaders(OldCompletionCallback* callback) = 0; // Provides access to HttpResponseInfo (owned by HttpStream). virtual const HttpResponseInfo* GetResponseInfo() const = 0; @@ -76,7 +76,7 @@ class NET_EXPORT_PRIVATE HttpStream { // the socket acquires a reference to the provided buffer until the callback // is invoked or the socket is destroyed. virtual int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; // Closes the stream. // |not_reusable| indicates if the stream can be used for further requests. diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h index 48ef2a2..e553ddb 100644 --- a/net/http/http_stream_factory_impl_job.h +++ b/net/http/http_stream_factory_impl_job.h @@ -211,7 +211,7 @@ class HttpStreamFactoryImpl::Job { SSLConfig proxy_ssl_config_; const BoundNetLog net_log_; - CompletionCallbackImpl<Job> io_callback_; + OldCompletionCallbackImpl<Job> io_callback_; scoped_ptr<ClientSocketHandle> connection_; HttpNetworkSession* const session_; HttpStreamFactoryImpl* const stream_factory_; diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc index 2d2c24a..153b42e 100644 --- a/net/http/http_stream_factory_impl_unittest.cc +++ b/net/http/http_stream_factory_impl_unittest.cc @@ -173,7 +173,7 @@ void PreconnectHelper(const TestCase& test, request.load_flags = 0; ProxyInfo proxy_info; - TestCompletionCallback callback; + TestOldCompletionCallback callback; session->http_stream_factory()->PreconnectStreams( test.num_streams, request, ssl_config, ssl_config, BoundNetLog()); @@ -194,7 +194,7 @@ class CapturePreconnectsSocketPool : public ParentPool { const void* socket_params, RequestPriority priority, ClientSocketHandle* handle, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) { ADD_FAILURE(); return ERR_UNEXPECTED; diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index 31ce76b..b356517 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc @@ -75,7 +75,7 @@ int HttpStreamParser::SendRequest(const std::string& request_line, const HttpRequestHeaders& headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK_EQ(STATE_NONE, io_state_); DCHECK(!user_callback_); DCHECK(callback); @@ -119,7 +119,7 @@ int HttpStreamParser::SendRequest(const std::string& request_line, return result > 0 ? OK : result; } -int HttpStreamParser::ReadResponseHeaders(CompletionCallback* callback) { +int HttpStreamParser::ReadResponseHeaders(OldCompletionCallback* callback) { DCHECK(io_state_ == STATE_REQUEST_SENT || io_state_ == STATE_DONE); DCHECK(!user_callback_); DCHECK(callback); @@ -154,7 +154,7 @@ void HttpStreamParser::Close(bool not_reusable) { } int HttpStreamParser::ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK(io_state_ == STATE_BODY_PENDING || io_state_ == STATE_DONE); DCHECK(!user_callback_); DCHECK(callback); @@ -180,7 +180,7 @@ void HttpStreamParser::OnIOComplete(int result) { // The client callback can do anything, including destroying this class, // so any pending callback must be issued after everything else is done. if (result != ERR_IO_PENDING && user_callback_) { - CompletionCallback* c = user_callback_; + OldCompletionCallback* c = user_callback_; user_callback_ = NULL; c->Run(result); } diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h index 8853728..824a238 100644 --- a/net/http/http_stream_parser.h +++ b/net/http/http_stream_parser.h @@ -44,12 +44,12 @@ class HttpStreamParser : public ChunkCallback { int SendRequest(const std::string& request_line, const HttpRequestHeaders& headers, UploadDataStream* request_body, - HttpResponseInfo* response, CompletionCallback* callback); + HttpResponseInfo* response, OldCompletionCallback* callback); - int ReadResponseHeaders(CompletionCallback* callback); + int ReadResponseHeaders(OldCompletionCallback* callback); int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback); + OldCompletionCallback* callback); void Close(bool not_reusable); @@ -175,13 +175,13 @@ class HttpStreamParser : public ChunkCallback { // The callback to notify a user that their request or response is // complete or there was an error - CompletionCallback* user_callback_; + OldCompletionCallback* user_callback_; // In the client callback, the client can do anything, including // destroying this class, so any pending callback must be issued // after everything else is done. When it is time to issue the client // callback, move it from |user_callback_| to |scheduled_callback_|. - CompletionCallback* scheduled_callback_; + OldCompletionCallback* scheduled_callback_; // The underlying socket. ClientSocketHandle* const connection_; @@ -189,7 +189,7 @@ class HttpStreamParser : public ChunkCallback { BoundNetLog net_log_; // Callback to be used when doing IO. - CompletionCallbackImpl<HttpStreamParser> io_callback_; + OldCompletionCallbackImpl<HttpStreamParser> io_callback_; // Stores an encoded chunk for chunked uploads. // Note: This should perhaps be improved to not create copies of the data. diff --git a/net/http/http_transaction.h b/net/http/http_transaction.h index 3e702ea..3478da2 100644 --- a/net/http/http_transaction.h +++ b/net/http/http_transaction.h @@ -32,7 +32,7 @@ class NET_EXPORT_PRIVATE HttpTransaction { // // Returns OK if the transaction could be started synchronously, which means // that the request was served from the cache. ERR_IO_PENDING is returned to - // indicate that the CompletionCallback will be notified once response info + // indicate that the OldCompletionCallback will be notified once response info // is available or if an IO error occurs. Any other return value indicates // that the transaction could not be started. // @@ -43,7 +43,7 @@ class NET_EXPORT_PRIVATE HttpTransaction { // // Profiling information for the request is saved to |net_log| if non-NULL. virtual int Start(const HttpRequestInfo* request_info, - CompletionCallback* callback, + OldCompletionCallback* callback, const BoundNetLog& net_log) = 0; // Restarts the HTTP transaction, ignoring the last error. This call can @@ -56,16 +56,16 @@ class NET_EXPORT_PRIVATE HttpTransaction { // // NOTE: The transaction is not responsible for deleting the callback object. // - virtual int RestartIgnoringLastError(CompletionCallback* callback) = 0; + virtual int RestartIgnoringLastError(OldCompletionCallback* callback) = 0; // Restarts the HTTP transaction with a client certificate. virtual int RestartWithCertificate(X509Certificate* client_cert, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; // Restarts the HTTP transaction with authentication credentials. virtual int RestartWithAuth(const string16& username, const string16& password, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; // Returns true if auth is ready to be continued. Callers should check // this value anytime Start() completes: if it is true, the transaction @@ -80,9 +80,9 @@ class NET_EXPORT_PRIVATE HttpTransaction { // // Response data is copied into the given buffer and the number of bytes // copied is returned. ERR_IO_PENDING is returned if response data is not - // yet available. The CompletionCallback is notified when the data copy + // yet available. The OldCompletionCallback is notified when the data copy // completes, and it is passed the number of bytes that were successfully - // copied. Or, if a read error occurs, the CompletionCallback is notified of + // copied. Or, if a read error occurs, the OldCompletionCallback is notified of // the error. Any other negative return value indicates that the transaction // could not be read. // @@ -91,7 +91,7 @@ class NET_EXPORT_PRIVATE HttpTransaction { // a reference to the provided buffer. // virtual int Read(IOBuffer* buf, int buf_len, - CompletionCallback* callback) = 0; + OldCompletionCallback* callback) = 0; // Stops further caching of this request by the HTTP cache, if there is any. virtual void StopCaching() = 0; diff --git a/net/http/http_transaction_unittest.cc b/net/http/http_transaction_unittest.cc index 38347e0..a958d8b 100644 --- a/net/http/http_transaction_unittest.cc +++ b/net/http/http_transaction_unittest.cc @@ -221,7 +221,7 @@ MockNetworkTransaction::MockNetworkTransaction(MockNetworkLayer* factory) MockNetworkTransaction::~MockNetworkTransaction() {} int MockNetworkTransaction::Start(const net::HttpRequestInfo* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, const net::BoundNetLog& net_log) { const MockTransaction* t = FindMockTransaction(request->url); if (!t) @@ -260,19 +260,19 @@ int MockNetworkTransaction::Start(const net::HttpRequestInfo* request, } int MockNetworkTransaction::RestartIgnoringLastError( - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_FAILED; } int MockNetworkTransaction::RestartWithCertificate( net::X509Certificate* client_cert, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_FAILED; } int MockNetworkTransaction::RestartWithAuth(const string16& username, const string16& password, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { return net::ERR_FAILED; } @@ -281,7 +281,7 @@ bool MockNetworkTransaction::IsReadyToRestartForAuth() { } int MockNetworkTransaction::Read(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback) { + net::OldCompletionCallback* callback) { int data_len = static_cast<int>(data_.size()); int num = std::min(buf_len, data_len - data_cursor_); if (num) { @@ -316,13 +316,13 @@ uint64 MockNetworkTransaction::GetUploadProgress() const { return 0; } -void MockNetworkTransaction::CallbackLater(net::CompletionCallback* callback, +void MockNetworkTransaction::CallbackLater(net::OldCompletionCallback* callback, int result) { MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( &MockNetworkTransaction::RunCallback, callback, result)); } -void MockNetworkTransaction::RunCallback(net::CompletionCallback* callback, +void MockNetworkTransaction::RunCallback(net::OldCompletionCallback* callback, int result) { callback->Run(result); } @@ -357,7 +357,7 @@ net::HttpNetworkSession* MockNetworkLayer::GetSession() { int ReadTransaction(net::HttpTransaction* trans, std::string* result) { int rv; - TestCompletionCallback callback; + TestOldCompletionCallback callback; std::string content; do { diff --git a/net/http/http_transaction_unittest.h b/net/http/http_transaction_unittest.h index fa6572a..3573204 100644 --- a/net/http/http_transaction_unittest.h +++ b/net/http/http_transaction_unittest.h @@ -159,22 +159,22 @@ class MockNetworkTransaction : public net::HttpTransaction { virtual ~MockNetworkTransaction(); virtual int Start(const net::HttpRequestInfo* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, const net::BoundNetLog& net_log); - virtual int RestartIgnoringLastError(net::CompletionCallback* callback); + virtual int RestartIgnoringLastError(net::OldCompletionCallback* callback); virtual int RestartWithCertificate(net::X509Certificate* client_cert, - net::CompletionCallback* callback); + net::OldCompletionCallback* callback); virtual int RestartWithAuth(const string16& username, const string16& password, - net::CompletionCallback* callback); + net::OldCompletionCallback* callback); virtual bool IsReadyToRestartForAuth(); virtual int Read(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback); + net::OldCompletionCallback* callback); virtual void StopCaching(); @@ -187,8 +187,8 @@ class MockNetworkTransaction : public net::HttpTransaction { virtual uint64 GetUploadProgress() const; private: - void CallbackLater(net::CompletionCallback* callback, int result); - void RunCallback(net::CompletionCallback* callback, int result); + void CallbackLater(net::OldCompletionCallback* callback, int result); + void RunCallback(net::OldCompletionCallback* callback, int result); ScopedRunnableMethodFactory<MockNetworkTransaction> task_factory_; net::HttpResponseInfo response_; diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc index f991a95..290c0e7 100644 --- a/net/http/partial_data.cc +++ b/net/http/partial_data.cc @@ -66,7 +66,7 @@ class PartialData::Core { PartialData* owner_; int64 start_; - net::CompletionCallbackImpl<Core> callback_; + net::OldCompletionCallbackImpl<Core> callback_; DISALLOW_COPY_AND_ASSIGN(Core); }; @@ -159,7 +159,7 @@ void PartialData::RestoreHeaders(HttpRequestHeaders* headers) const { } int PartialData::ShouldValidateCache(disk_cache::Entry* entry, - CompletionCallback* callback) { + OldCompletionCallback* callback) { DCHECK_GE(current_range_start_, 0); // Scan the disk cache for the first cached portion within this range. @@ -417,7 +417,7 @@ void PartialData::FixContentLength(HttpResponseHeaders* headers) { } int PartialData::CacheRead(disk_cache::Entry* entry, IOBuffer* data, - int data_len, CompletionCallback* callback) { + int data_len, OldCompletionCallback* callback) { int read_len = std::min(data_len, cached_min_len_); if (!read_len) return 0; @@ -437,7 +437,7 @@ int PartialData::CacheRead(disk_cache::Entry* entry, IOBuffer* data, } int PartialData::CacheWrite(disk_cache::Entry* entry, IOBuffer* data, - int data_len, CompletionCallback* callback) { + int data_len, OldCompletionCallback* callback) { DVLOG(3) << "To write: " << data_len; if (sparse_entry_) { return entry->WriteSparseData(current_range_start_, data, data_len, @@ -484,7 +484,7 @@ void PartialData::GetAvailableRangeCompleted(int result, int64 start) { if (result >= 0) result = 1; // Return success, go ahead and validate the entry. - CompletionCallback* cb = callback_; + OldCompletionCallback* cb = callback_; callback_ = NULL; cb->Run(result); } diff --git a/net/http/partial_data.h b/net/http/partial_data.h index 6224fdf..bf14cf0 100644 --- a/net/http/partial_data.h +++ b/net/http/partial_data.h @@ -55,7 +55,7 @@ class PartialData { // error code. If this method returns ERR_IO_PENDING, the |callback| will be // notified when the result is ready. int ShouldValidateCache(disk_cache::Entry* entry, - CompletionCallback* callback); + OldCompletionCallback* callback); // Builds the required |headers| to perform the proper cache validation for // the next range to be fetched. @@ -98,12 +98,12 @@ class PartialData { // operation completes, OnCacheReadCompleted() must be called with the result // of the operation. int CacheRead(disk_cache::Entry* entry, IOBuffer* data, int data_len, - CompletionCallback* callback); + OldCompletionCallback* callback); // Writes |data_len| bytes to cache. This is basically a wrapper around the // API of the cache that provides the right arguments for the current range. int CacheWrite(disk_cache::Entry* entry, IOBuffer* data, int data_len, - CompletionCallback* callback); + OldCompletionCallback* callback); // This method should be called when CacheRead() finishes the read, to update // the internal state about the current range. @@ -136,7 +136,7 @@ class PartialData { bool truncated_; // We have an incomplete 200 stored. bool initial_validation_; // Only used for truncated entries. Core* core_; - CompletionCallback* callback_; + OldCompletionCallback* callback_; DISALLOW_COPY_AND_ASSIGN(PartialData); }; |