diff options
Diffstat (limited to 'chromium/content/browser/download/drag_download_file.cc')
-rw-r--r-- | chromium/content/browser/download/drag_download_file.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chromium/content/browser/download/drag_download_file.cc b/chromium/content/browser/download/drag_download_file.cc index d81b04ccf6b..29b8b5caa5c 100644 --- a/chromium/content/browser/download/drag_download_file.cc +++ b/chromium/content/browser/download/drag_download_file.cc @@ -5,6 +5,7 @@ #include "content/browser/download/drag_download_file.h" #include "base/bind.h" +#include "base/files/file.h" #include "base/message_loop/message_loop.h" #include "content/browser/download/download_stats.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -13,7 +14,6 @@ #include "content/public/browser/download_item.h" #include "content/public/browser/download_save_info.h" #include "content/public/browser/download_url_parameters.h" -#include "net/base/file_stream.h" namespace content { @@ -53,7 +53,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { // Do not call weak_ptr_factory_.GetWeakPtr() outside the UI thread. } - void InitiateDownload(scoped_ptr<net::FileStream> file_stream, + void InitiateDownload(base::File file, const base::FilePath& file_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DownloadManager* download_manager = @@ -67,7 +67,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { params->set_callback(base::Bind(&DragDownloadFileUI::OnDownloadStarted, weak_ptr_factory_.GetWeakPtr())); params->set_file_path(file_path); - params->set_file_stream(file_stream.Pass()); // Nulls file_stream. + params->set_file(file.Pass()); // Nulls file. download_manager->DownloadUrl(params.Pass()); } @@ -89,14 +89,15 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { download_item_->RemoveObserver(this); } - void OnDownloadStarted(DownloadItem* item, net::Error error) { + void OnDownloadStarted(DownloadItem* item, + DownloadInterruptReason interrupt_reason) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!item) { - DCHECK_NE(net::OK, error); + DCHECK_NE(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason); on_completed_loop_->PostTask(FROM_HERE, base::Bind(on_completed_, false)); return; } - DCHECK_EQ(net::OK, error); + DCHECK_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason); download_item_ = item; download_item_->AddObserver(this); } @@ -149,13 +150,13 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { }; DragDownloadFile::DragDownloadFile(const base::FilePath& file_path, - scoped_ptr<net::FileStream> file_stream, + base::File file, const GURL& url, const Referrer& referrer, const std::string& referrer_encoding, WebContents* web_contents) : file_path_(file_path), - file_stream_(file_stream.Pass()), + file_(file.Pass()), drag_message_loop_(base::MessageLoop::current()), state_(INITIALIZED), drag_ui_(NULL), @@ -196,7 +197,7 @@ void DragDownloadFile::Start(ui::DownloadFileObserver* observer) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( &DragDownloadFileUI::InitiateDownload, base::Unretained(drag_ui_), - base::Passed(&file_stream_), file_path_)); + base::Passed(&file_), file_path_)); } bool DragDownloadFile::Wait() { |