Index: chrome/browser/renderer_host/download_resource_handler.h |
diff --git a/chrome/browser/renderer_host/download_resource_handler.h b/chrome/browser/renderer_host/download_resource_handler.h |
index 67ad0eecd41f9db8a5cde8a3d8ca164e610072d7..7e2e8c3f4a2bf2e068ad230ba7cc03bc90944ae4 100644 |
--- a/chrome/browser/renderer_host/download_resource_handler.h |
+++ b/chrome/browser/renderer_host/download_resource_handler.h |
@@ -8,6 +8,7 @@ |
#include <string> |
+#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/timer.h" |
#include "chrome/browser/download/download_file.h" |
@@ -25,6 +26,10 @@ class URLRequest; |
// Forwards data to the download thread. |
class DownloadResourceHandler : public ResourceHandler { |
public: |
+ typedef base::Callback<void(int/*download_id*/, int/*error*/)> |
+ OnStartedCallback; |
+ |
+ // started_cb will be called exactly once. |
DownloadResourceHandler(ResourceDispatcherHost* rdh, |
int render_process_host_id, |
int render_view_id, |
@@ -33,6 +38,7 @@ class DownloadResourceHandler : public ResourceHandler { |
DownloadFileManager* download_file_manager, |
net::URLRequest* request, |
bool save_as, |
+ OnStartedCallback started_cb, |
const DownloadSaveInfo& save_info); |
virtual bool OnUploadProgress(int request_id, uint64 position, uint64 size); |
@@ -74,6 +80,8 @@ class DownloadResourceHandler : public ResourceHandler { |
virtual ~DownloadResourceHandler(); |
void StartPauseTimer(); |
+ void OnResponseStartedOnUIThread(DownloadCreateInfo* info); |
+ void CallStartedCB(int error); |
int download_id_; |
GlobalRequestID global_id_; |
@@ -84,6 +92,7 @@ class DownloadResourceHandler : public ResourceHandler { |
DownloadFileManager* download_file_manager_; |
net::URLRequest* request_; |
bool save_as_; // Request was initiated via "Save As" by the user. |
+ OnStartedCallback started_cb_; |
DownloadSaveInfo save_info_; |
scoped_ptr<DownloadBuffer> buffer_; |
ResourceDispatcherHost* rdh_; |