| Index: chrome/browser/chromeos/extensions/file_browser_private_api.cc
|
| diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
|
| index 6a65d74eb093fffcb201601cea3a9c48b1d2bc20..bb257ae9108fcfea4f94616b2f1737617bb18f89 100644
|
| --- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
|
| +++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
|
| @@ -576,7 +576,7 @@ bool GetFileTasksFileBrowserFunction::RunImpl() {
|
| return true;
|
| }
|
|
|
| -class ExecuteTasksFileBrowserFunction::Executor: public FileTaskExecutor {
|
| +class ExecuteTasksFileBrowserFunction::Executor : public FileTaskExecutor {
|
| public:
|
| Executor(Profile* profile,
|
| const GURL& source_url,
|
| @@ -584,13 +584,22 @@ class ExecuteTasksFileBrowserFunction::Executor: public FileTaskExecutor {
|
| const std::string& action_id,
|
| ExecuteTasksFileBrowserFunction* function)
|
| : FileTaskExecutor(profile, source_url, extension_id, action_id),
|
| - function_(function)
|
| - {}
|
| + function_(function) {
|
| + }
|
| +
|
| + virtual ~Executor() OVERRIDE {
|
| + if (function_)
|
| + function_->OnTaskExecuted(false);
|
| + }
|
|
|
| protected:
|
| // FileTaskExecutor overrides.
|
| virtual Browser* browser() { return function_->GetCurrentBrowser(); }
|
| - virtual void Done(bool success) { function_->SendResponse(success); }
|
| + virtual void Done(bool success) {
|
| + function_->OnTaskExecuted(success);
|
| + // Let's make sure |function_| gets notified only once.
|
| + function_ = NULL;
|
| + }
|
|
|
| private:
|
| scoped_refptr<ExecuteTasksFileBrowserFunction> function_;
|
| @@ -637,6 +646,7 @@ bool ExecuteTasksFileBrowserFunction::RunImpl() {
|
|
|
| scoped_refptr<Executor> executor =
|
| new Executor(profile(), source_url(), extension_id, action_id, this);
|
| +
|
| if (!executor->Execute(file_urls))
|
| return false;
|
|
|
| @@ -644,6 +654,10 @@ bool ExecuteTasksFileBrowserFunction::RunImpl() {
|
| return true;
|
| }
|
|
|
| +void ExecuteTasksFileBrowserFunction::OnTaskExecuted(bool success) {
|
| + SendResponse(success);
|
| +}
|
| +
|
| FileBrowserFunction::FileBrowserFunction() {
|
| }
|
|
|
|
|