Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: content/browser/download/download_resource_handler.h

Issue 2526983002: Refactor ResourceHandler API. (Closed)
Patch Set: Fix stuff Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_resource_handler.h
diff --git a/content/browser/download/download_resource_handler.h b/content/browser/download/download_resource_handler.h
index b2820a39a9f1007cc54d3ffb7e3ad59b86d39387..2a4ac29773308e0be5a7074276b778d6deadfaa8 100644
--- a/content/browser/download/download_resource_handler.h
+++ b/content/browser/download/download_resource_handler.h
@@ -49,15 +49,19 @@ class CONTENT_EXPORT DownloadResourceHandler
// ResourceDispatcherHostImpl.
static std::unique_ptr<ResourceHandler> Create(net::URLRequest* request);
- bool OnRequestRedirected(const net::RedirectInfo& redirect_info,
- ResourceResponse* response,
- bool* defer) override;
+ void OnRequestRedirected(
+ const net::RedirectInfo& redirect_info,
+ ResourceResponse* response,
+ std::unique_ptr<ResourceController> controller) override;
// Send the download creation information to the download thread.
- bool OnResponseStarted(ResourceResponse* response, bool* defer) override;
+ void OnResponseStarted(
+ ResourceResponse* response,
+ std::unique_ptr<ResourceController> controller) override;
// Pass-through implementation.
- bool OnWillStart(const GURL& url, bool* defer) override;
+ void OnWillStart(const GURL& url,
+ std::unique_ptr<ResourceController> controller) override;
// Create a new buffer, which will be handed to the download thread for file
// writing and deletion.
@@ -65,10 +69,12 @@ class CONTENT_EXPORT DownloadResourceHandler
int* buf_size,
int min_size) override;
- bool OnReadCompleted(int bytes_read, bool* defer) override;
+ void OnReadCompleted(int bytes_read,
+ std::unique_ptr<ResourceController> controller) override;
- void OnResponseCompleted(const net::URLRequestStatus& status,
- bool* defer) override;
+ void OnResponseCompleted(
+ const net::URLRequestStatus& status,
+ std::unique_ptr<ResourceController> controller) override;
// N/A to this flavor of DownloadHandler.
void OnDataDownloaded(int bytes_downloaded) override;
@@ -100,6 +106,7 @@ class CONTENT_EXPORT DownloadResourceHandler
std::unique_ptr<DownloadTabInfo> tab_info_;
DownloadRequestCore core_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler);
};

Powered by Google App Engine
This is Rietveld 408576698