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 /chrome/browser | |
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 'chrome/browser')
17 files changed, 36 insertions, 36 deletions
diff --git a/chrome/browser/browsing_data_appcache_helper.cc b/chrome/browser/browsing_data_appcache_helper.cc index 512e666..f7e7ae5 100644 --- a/chrome/browser/browsing_data_appcache_helper.cc +++ b/chrome/browser/browsing_data_appcache_helper.cc @@ -32,7 +32,7 @@ void BrowsingDataAppCacheHelper::StartFetching(Callback0::Type* callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); appcache_info_callback_ = - new net::CancelableCompletionCallback<BrowsingDataAppCacheHelper>( + new net::CancelableOldCompletionCallback<BrowsingDataAppCacheHelper>( this, &BrowsingDataAppCacheHelper::OnFetchComplete); appcache_service_->GetAllAppCacheInfo(info_collection_, appcache_info_callback_); diff --git a/chrome/browser/browsing_data_appcache_helper.h b/chrome/browser/browsing_data_appcache_helper.h index c40ff48..2a501e9 100644 --- a/chrome/browser/browsing_data_appcache_helper.h +++ b/chrome/browser/browsing_data_appcache_helper.h @@ -41,7 +41,7 @@ class BrowsingDataAppCacheHelper bool is_fetching_; scoped_refptr<ChromeAppCacheService> appcache_service_; - scoped_refptr<net::CancelableCompletionCallback<BrowsingDataAppCacheHelper> > + scoped_refptr<net::CancelableOldCompletionCallback<BrowsingDataAppCacheHelper> > appcache_info_callback_; DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h index 2a955fc..7c66f3a 100644 --- a/chrome/browser/browsing_data_remover.h +++ b/chrome/browser/browsing_data_remover.h @@ -228,7 +228,7 @@ class BrowsingDataRemover : public NotificationObserver, static bool removing_; // Used to delete data from the HTTP caches. - net::CompletionCallbackImpl<BrowsingDataRemover> cache_callback_; + net::OldCompletionCallbackImpl<BrowsingDataRemover> cache_callback_; CacheState next_cache_state_; disk_cache::Backend* cache_; diff --git a/chrome/browser/chrome_benchmarking_message_filter.cc b/chrome/browser/chrome_benchmarking_message_filter.cc index c1fb93e..ff5bed7 100644 --- a/chrome/browser/chrome_benchmarking_message_filter.cc +++ b/chrome/browser/chrome_benchmarking_message_filter.cc @@ -18,7 +18,7 @@ namespace { -class ClearCacheCompletion : public net::CompletionCallback { +class ClearCacheCompletion : public net::OldCompletionCallback { public: ClearCacheCompletion(ChromeBenchmarkingMessageFilter* filter, IPC::Message* reply_msg) @@ -82,7 +82,7 @@ class DoomEntriesHelper { disk_cache::Backend* backend_; disk_cache::Entry* entry_; void* iter_; - net::CompletionCallbackImpl<DoomEntriesHelper> callback_; + net::OldCompletionCallbackImpl<DoomEntriesHelper> callback_; ClearCacheCompletion* user_callback_; }; diff --git a/chrome/browser/chromeos/dbus/proxy_resolution_service_provider.cc b/chrome/browser/chromeos/dbus/proxy_resolution_service_provider.cc index 3d2fa4f..3e950a8 100644 --- a/chrome/browser/chromeos/dbus/proxy_resolution_service_provider.cc +++ b/chrome/browser/chromeos/dbus/proxy_resolution_service_provider.cc @@ -46,7 +46,7 @@ class ProxyResolverImpl : public ProxyResolverInterface { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, notify_task_); } - net::CompletionCallbackImpl<Request> completion_callback_; + net::OldCompletionCallbackImpl<Request> completion_callback_; std::string source_url_; // URL being resolved. int result_; // Result of proxy resolution. diff --git a/chrome/browser/extensions/extension_webrequest_api.cc b/chrome/browser/extensions/extension_webrequest_api.cc index a6add39..7e7bea0 100644 --- a/chrome/browser/extensions/extension_webrequest_api.cc +++ b/chrome/browser/extensions/extension_webrequest_api.cc @@ -318,7 +318,7 @@ struct ExtensionWebRequestEventRouter::BlockedRequest { const net::BoundNetLog* net_log; // The callback to call when we get a response from all event handlers. - net::CompletionCallback* callback; + net::OldCompletionCallback* callback; // If non-empty, this contains the new URL that the request will redirect to. // Only valid for OnBeforeRequest. @@ -464,7 +464,7 @@ int ExtensionWebRequestEventRouter::OnBeforeRequest( void* profile, ExtensionInfoMap* extension_info_map, net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, GURL* new_url) { // TODO(jochen): Figure out what to do with events from the system context. if (!profile) @@ -506,7 +506,7 @@ int ExtensionWebRequestEventRouter::OnBeforeSendHeaders( void* profile, ExtensionInfoMap* extension_info_map, net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, net::HttpRequestHeaders* headers) { // TODO(jochen): Figure out what to do with events from the system context. if (!profile) @@ -1282,7 +1282,7 @@ void ExtensionWebRequestEventRouter::DecrementBlockCount( // distinguished from a regular failure. if (blocked_request.callback) { int rv = canceled ? net::ERR_EMPTY_RESPONSE : net::OK; - net::CompletionCallback* callback = blocked_request.callback; + net::OldCompletionCallback* callback = blocked_request.callback; // Ensure that request is removed before callback because the callback // might trigger the next event. blocked_requests_.erase(request_id); diff --git a/chrome/browser/extensions/extension_webrequest_api.h b/chrome/browser/extensions/extension_webrequest_api.h index 8bc3429..72c6016 100644 --- a/chrome/browser/extensions/extension_webrequest_api.h +++ b/chrome/browser/extensions/extension_webrequest_api.h @@ -149,7 +149,7 @@ class ExtensionWebRequestEventRouter { int OnBeforeRequest(void* profile, ExtensionInfoMap* extension_info_map, net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, GURL* new_url); // Dispatches the onBeforeSendHeaders event. This is fired for HTTP(s) @@ -159,7 +159,7 @@ class ExtensionWebRequestEventRouter { int OnBeforeSendHeaders(void* profile, ExtensionInfoMap* extension_info_map, net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, net::HttpRequestHeaders* headers); // Dispatches the onSendHeaders event. This is fired for HTTP(s) requests diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc index 681799a..721ff38 100644 --- a/chrome/browser/net/chrome_network_delegate.cc +++ b/chrome/browser/net/chrome_network_delegate.cc @@ -73,7 +73,7 @@ void ChromeNetworkDelegate::InitializeReferrersEnabled( int ChromeNetworkDelegate::OnBeforeURLRequest( net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, GURL* new_url) { #if defined(ENABLE_CONFIGURATION_POLICY) // TODO(joaodasilva): This prevents extensions from seeing URLs that are @@ -98,7 +98,7 @@ int ChromeNetworkDelegate::OnBeforeURLRequest( int ChromeNetworkDelegate::OnBeforeSendHeaders( net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, net::HttpRequestHeaders* headers) { return ExtensionWebRequestEventRouter::GetInstance()->OnBeforeSendHeaders( profile_, extension_info_map_.get(), request, callback, headers); diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h index f36df17..1a76935 100644 --- a/chrome/browser/net/chrome_network_delegate.h +++ b/chrome/browser/net/chrome_network_delegate.h @@ -47,10 +47,10 @@ class ChromeNetworkDelegate : public net::NetworkDelegate { private: // NetworkDelegate methods: virtual int OnBeforeURLRequest(net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, GURL* new_url) OVERRIDE; virtual int OnBeforeSendHeaders(net::URLRequest* request, - net::CompletionCallback* callback, + net::OldCompletionCallback* callback, net::HttpRequestHeaders* headers) OVERRIDE; virtual void OnSendHeaders(net::URLRequest* request, const net::HttpRequestHeaders& headers) OVERRIDE; diff --git a/chrome/browser/net/network_stats.cc b/chrome/browser/net/network_stats.cc index 6b600b2..036b3708 100644 --- a/chrome/browser/net/network_stats.cc +++ b/chrome/browser/net/network_stats.cc @@ -97,7 +97,7 @@ NetworkStats::~NetworkStats() { bool NetworkStats::Start(net::HostResolver* host_resolver, const net::HostPortPair& server_host_port_pair, uint32 bytes_to_send, - net::CompletionCallback* finished_callback) { + net::OldCompletionCallback* finished_callback) { DCHECK(bytes_to_send); // We should have data to send. Initialize(bytes_to_send, finished_callback); @@ -114,7 +114,7 @@ bool NetworkStats::Start(net::HostResolver* host_resolver, } void NetworkStats::Initialize(uint32 bytes_to_send, - net::CompletionCallback* finished_callback) { + net::OldCompletionCallback* finished_callback) { DCHECK(bytes_to_send); // We should have data to send. load_size_ = bytes_to_send; @@ -156,7 +156,7 @@ bool NetworkStats::ConnectComplete(int result) { void NetworkStats::DoFinishCallback(int result) { if (finished_callback_ != NULL) { - net::CompletionCallback* callback = finished_callback_; + net::OldCompletionCallback* callback = finished_callback_; finished_callback_ = NULL; callback->Run(result); } diff --git a/chrome/browser/net/network_stats.h b/chrome/browser/net/network_stats.h index 59106d2..65742b6 100644 --- a/chrome/browser/net/network_stats.h +++ b/chrome/browser/net/network_stats.h @@ -74,7 +74,7 @@ class NetworkStats { bool Start(net::HostResolver* host_resolver, const net::HostPortPair& server, uint32 bytes_to_send, - net::CompletionCallback* callback); + net::OldCompletionCallback* callback); protected: // Constructs an NetworkStats object that collects metrics for network @@ -86,7 +86,7 @@ class NetworkStats { // server. |finished_callback| is called when we are done with the test. // |finished_callback| is mainly useful for unittests. void Initialize(uint32 bytes_to_send, - net::CompletionCallback* finished_callback); + net::OldCompletionCallback* finished_callback); // Called after host is resolved. UDPStatsClient and TCPStatsClient implement // this method. They create the socket and connect to the server. @@ -177,18 +177,18 @@ class NetworkStats { net::AddressList addresses_; // Callback to call when host resolution is completed. - net::CompletionCallbackImpl<NetworkStats> resolve_callback_; + net::OldCompletionCallbackImpl<NetworkStats> resolve_callback_; // Callback to call when data is read from the server. - net::CompletionCallbackImpl<NetworkStats> read_callback_; + net::OldCompletionCallbackImpl<NetworkStats> read_callback_; // Callback to call when data is sent to the server. - net::CompletionCallbackImpl<NetworkStats> write_callback_; + net::OldCompletionCallbackImpl<NetworkStats> write_callback_; // Callback to call when echo protocol is successefully finished or whenever // there is an error (this allows unittests to wait until echo protocol's // round trip is finished). - net::CompletionCallback* finished_callback_; + net::OldCompletionCallback* finished_callback_; // The time when the session was started. base::TimeTicks start_time_; @@ -252,7 +252,7 @@ class TCPStatsClient : public NetworkStats { void OnConnectComplete(int result); // Callback to call when connect is completed. - net::CompletionCallbackImpl<TCPStatsClient> connect_callback_; + net::OldCompletionCallbackImpl<TCPStatsClient> connect_callback_; }; // This collects the network connectivity stats for UDP and TCP for small diff --git a/chrome/browser/net/network_stats_unittest.cc b/chrome/browser/net/network_stats_unittest.cc index 260e24a..a956d08 100644 --- a/chrome/browser/net/network_stats_unittest.cc +++ b/chrome/browser/net/network_stats_unittest.cc @@ -34,7 +34,7 @@ class NetworkStatsTestUDP : public NetworkStatsTest { protected: void RunUDPEchoTest(int bytes) { - TestCompletionCallback cb; + TestOldCompletionCallback cb; scoped_ptr<net::MockHostResolver> host_resolver( new net::MockHostResolver()); @@ -61,7 +61,7 @@ class NetworkStatsTestTCP : public NetworkStatsTest { protected: void RunTCPEchoTest(int bytes) { - TestCompletionCallback cb; + TestOldCompletionCallback cb; scoped_ptr<net::MockHostResolver> host_resolver( new net::MockHostResolver()); diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc index ed4aa4b..20fa822 100644 --- a/chrome/browser/net/predictor.cc +++ b/chrome/browser/net/predictor.cc @@ -110,7 +110,7 @@ class Predictor::LookupRequest { } // HostResolver will call us using this callback when resolution is complete. - net::CompletionCallbackImpl<LookupRequest> net_callback_; + net::OldCompletionCallbackImpl<LookupRequest> net_callback_; Predictor* predictor_; // The predictor which started us. diff --git a/chrome/browser/net/view_http_cache_job_factory.cc b/chrome/browser/net/view_http_cache_job_factory.cc index 1c4437b..1441dd7 100644 --- a/chrome/browser/net/view_http_cache_job_factory.cc +++ b/chrome/browser/net/view_http_cache_job_factory.cc @@ -71,7 +71,7 @@ class ViewHttpCacheJob : public net::URLRequestJob { std::string data_; int data_offset_; net::ViewCacheHelper cache_helper_; - net::CompletionCallbackImpl<Core> callback_; + net::OldCompletionCallbackImpl<Core> callback_; Callback0::Type* user_callback_; DISALLOW_COPY_AND_ASSIGN(Core); diff --git a/chrome/browser/renderer_host/offline_resource_handler.cc b/chrome/browser/renderer_host/offline_resource_handler.cc index 0e32ba8..f722446 100644 --- a/chrome/browser/renderer_host/offline_resource_handler.cc +++ b/chrome/browser/renderer_host/offline_resource_handler.cc @@ -109,7 +109,7 @@ bool OfflineResourceHandler::OnWillStart(int request_id, AddRef(); // Balanced with OnCanHandleOfflineComplete DCHECK(!appcache_completion_callback_); appcache_completion_callback_ = - new net::CancelableCompletionCallback<OfflineResourceHandler>( + new net::CancelableOldCompletionCallback<OfflineResourceHandler>( this, &OfflineResourceHandler::OnCanHandleOfflineComplete); appcache_service_->CanHandleMainResourceOffline( url, request_->first_party_for_cookies(), diff --git a/chrome/browser/renderer_host/offline_resource_handler.h b/chrome/browser/renderer_host/offline_resource_handler.h index 7877536..8f5aba0 100644 --- a/chrome/browser/renderer_host/offline_resource_handler.h +++ b/chrome/browser/renderer_host/offline_resource_handler.h @@ -79,7 +79,7 @@ class OfflineResourceHandler : public ResourceHandler, int deferred_request_id_; GURL deferred_url_; - scoped_refptr<net::CancelableCompletionCallback<OfflineResourceHandler> > + scoped_refptr<net::CancelableOldCompletionCallback<OfflineResourceHandler> > appcache_completion_callback_; DISALLOW_COPY_AND_ASSIGN(OfflineResourceHandler); diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc index 8050a14..71e0453 100644 --- a/chrome/browser/safe_browsing/malware_details_unittest.cc +++ b/chrome/browser/safe_browsing/malware_details_unittest.cc @@ -69,7 +69,7 @@ void WriteHeaders(disk_cache::Entry* entry, const std::string headers) { reinterpret_cast<const char*>(pickle.data()))); int len = static_cast<int>(pickle.size()); - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = entry->WriteData(0, 0, buf, len, &cb, true); ASSERT_EQ(len, cb.GetResult(rv)); } @@ -82,14 +82,14 @@ void WriteData(disk_cache::Entry* entry, const std::string data) { scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(len)); memcpy(buf->data(), data.data(), data.length()); - TestCompletionCallback cb; + TestOldCompletionCallback cb; int rv = entry->WriteData(1, 0, buf, len, &cb, true); ASSERT_EQ(len, cb.GetResult(rv)); } void WriteToEntry(disk_cache::Backend* cache, const std::string key, const std::string headers, const std::string data) { - TestCompletionCallback cb; + TestOldCompletionCallback cb; disk_cache::Entry* entry; int rv = cache->CreateEntry(key, &entry, &cb); rv = cb.GetResult(rv); @@ -104,7 +104,7 @@ void WriteToEntry(disk_cache::Backend* cache, const std::string key, } void FillCache(net::URLRequestContextGetter* context_getter) { - TestCompletionCallback cb; + TestOldCompletionCallback cb; disk_cache::Backend* cache; int rv = context_getter->GetURLRequestContext()->http_transaction_factory()-> |