Index: content/browser/download/save_file_resource_handler.cc |
diff --git a/content/browser/download/save_file_resource_handler.cc b/content/browser/download/save_file_resource_handler.cc |
index 98b332de01c3998bdf7fa2aa7a9db292cdcc87b7..31ab9787f4e4ac40775cad5331e501b1675ac8f2 100644 |
--- a/content/browser/download/save_file_resource_handler.cc |
+++ b/content/browser/download/save_file_resource_handler.cc |
@@ -8,6 +8,7 @@ |
#include "base/logging.h" |
#include "base/message_loop/message_loop.h" |
#include "base/strings/string_number_conversions.h" |
+#include "content/browser/download/download_task_runner.h" |
#include "content/browser/download/save_file_manager.h" |
#include "content/browser/loader/resource_controller.h" |
#include "content/public/browser/browser_thread.h" |
@@ -54,9 +55,8 @@ void SaveFileResourceHandler::OnResponseStarted( |
url_, final_url_, save_item_id_, save_package_id_, render_process_id_, |
render_frame_routing_id_, GetRequestID(), content_disposition_, |
content_length_); |
- BrowserThread::PostTask( |
- BrowserThread::FILE, FROM_HERE, |
- base::Bind(&SaveFileManager::StartSave, save_manager_, info)); |
+ GetDownloadTaskRunner()->PostTask( |
+ FROM_HERE, base::Bind(&SaveFileManager::StartSave, save_manager_, info)); |
controller->Resume(); |
} |
@@ -92,8 +92,8 @@ void SaveFileResourceHandler::OnReadCompleted( |
// We are passing ownership of this buffer to the save file manager. |
scoped_refptr<net::IOBuffer> buffer; |
read_buffer_.swap(buffer); |
- BrowserThread::PostTask( |
- BrowserThread::FILE, FROM_HERE, |
+ GetDownloadTaskRunner()->PostTask( |
+ FROM_HERE, |
base::Bind(&SaveFileManager::UpdateSaveProgress, save_manager_, |
save_item_id_, base::RetainedRef(buffer), bytes_read)); |
controller->Resume(); |
@@ -105,11 +105,10 @@ void SaveFileResourceHandler::OnResponseCompleted( |
if (authorization_state_ != AuthorizationState::AUTHORIZED) |
DCHECK(!status.is_success()); |
- BrowserThread::PostTask( |
- BrowserThread::FILE, FROM_HERE, |
- base::Bind(&SaveFileManager::SaveFinished, save_manager_, save_item_id_, |
- save_package_id_, |
- status.is_success() && !status.is_io_pending())); |
+ GetDownloadTaskRunner()->PostTask( |
+ FROM_HERE, base::Bind(&SaveFileManager::SaveFinished, save_manager_, |
+ save_item_id_, save_package_id_, |
+ status.is_success() && !status.is_io_pending())); |
read_buffer_ = nullptr; |
controller->Resume(); |
} |