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

Unified Diff: chrome/browser/renderer_host/download_resource_handler.h

Issue 7192016: chrome.experimental.downloads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merged db_handle, id; onCreated, onErased Created 9 years, 5 months 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
« no previous file with comments | « chrome/browser/history/history_types.h ('k') | chrome/browser/renderer_host/download_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « chrome/browser/history/history_types.h ('k') | chrome/browser/renderer_host/download_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698