Index: chrome/browser/extensions/api/image_writer_private/operation_manager.cc |
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc |
index 34c5beaacd4fb09adec4c0a44d9d2635861c3bb5..839e1553abaf7dc3d63fa75530b6bd6493d312a2 100644 |
--- a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc |
+++ b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc |
@@ -59,8 +59,10 @@ |
void OperationManager::StartWriteFromUrl( |
const ExtensionId& extension_id, |
GURL url, |
+ content::RenderViewHost* rvh, |
const std::string& hash, |
- const std::string& device_path, |
+ bool saveImageAsDownload, |
+ const std::string& storage_unit_id, |
const Operation::StartWriteCallback& callback) { |
OperationMap::iterator existing_operation = operations_.find(extension_id); |
@@ -71,10 +73,11 @@ |
scoped_refptr<Operation> operation( |
new WriteFromUrlOperation(weak_factory_.GetWeakPtr(), |
extension_id, |
- profile_->GetRequestContext(), |
+ rvh, |
url, |
hash, |
- device_path)); |
+ saveImageAsDownload, |
+ storage_unit_id)); |
operations_[extension_id] = operation; |
BrowserThread::PostTask(BrowserThread::FILE, |
FROM_HERE, |
@@ -85,7 +88,7 @@ |
void OperationManager::StartWriteFromFile( |
const ExtensionId& extension_id, |
const base::FilePath& path, |
- const std::string& device_path, |
+ const std::string& storage_unit_id, |
const Operation::StartWriteCallback& callback) { |
OperationMap::iterator existing_operation = operations_.find(extension_id); |
@@ -93,8 +96,11 @@ |
return callback.Run(false, error::kOperationAlreadyInProgress); |
} |
- scoped_refptr<Operation> operation(new WriteFromFileOperation( |
- weak_factory_.GetWeakPtr(), extension_id, path, device_path)); |
+ scoped_refptr<Operation> operation( |
+ new WriteFromFileOperation(weak_factory_.GetWeakPtr(), |
+ extension_id, |
+ path, |
+ storage_unit_id)); |
operations_[extension_id] = operation; |
BrowserThread::PostTask(BrowserThread::FILE, |
FROM_HERE, |
@@ -120,7 +126,7 @@ |
void OperationManager::DestroyPartitions( |
const ExtensionId& extension_id, |
- const std::string& device_path, |
+ const std::string& storage_unit_id, |
const Operation::StartWriteCallback& callback) { |
OperationMap::iterator existing_operation = operations_.find(extension_id); |
@@ -128,8 +134,10 @@ |
return callback.Run(false, error::kOperationAlreadyInProgress); |
} |
- scoped_refptr<Operation> operation(new DestroyPartitionsOperation( |
- weak_factory_.GetWeakPtr(), extension_id, device_path)); |
+ scoped_refptr<Operation> operation( |
+ new DestroyPartitionsOperation(weak_factory_.GetWeakPtr(), |
+ extension_id, |
+ storage_unit_id)); |
operations_[extension_id] = operation; |
BrowserThread::PostTask(BrowserThread::FILE, |
FROM_HERE, |
@@ -141,6 +149,7 @@ |
image_writer_api::Stage stage, |
int progress) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ DVLOG(2) << "progress - " << stage << " at " << progress << "%"; |
image_writer_api::ProgressInfo info; |
info.stage = stage; |