| Index: chrome/browser/extensions/extension_file_browser_private_api.cc
|
| diff --git a/chrome/browser/extensions/extension_file_browser_private_api.cc b/chrome/browser/extensions/extension_file_browser_private_api.cc
|
| index da6453e2719d57c861fa06f0b4acd8c489c1b56f..ff2079ae44743e5404f295088ddd925e8f2fd4e1 100644
|
| --- a/chrome/browser/extensions/extension_file_browser_private_api.cc
|
| +++ b/chrome/browser/extensions/extension_file_browser_private_api.cc
|
| @@ -314,41 +314,26 @@ base::DictionaryValue* MountPointToValue(Profile* profile,
|
|
|
| } // namespace
|
|
|
| -class RequestLocalFileSystemFunction::LocalFileSystemCallbackDispatcher
|
| - : public fileapi::FileSystemCallbackDispatcher {
|
| +class RequestLocalFileSystemFunction::LocalFileSystemCallbackDispatcher {
|
| public:
|
| - static scoped_ptr<FileSystemCallbackDispatcher> Create(
|
| + static fileapi::FileSystemContext::OpenFileSystemCallback CreateCallback(
|
| RequestLocalFileSystemFunction* function,
|
| Profile* profile,
|
| int child_id,
|
| scoped_refptr<const Extension> extension) {
|
| - return scoped_ptr<fileapi::FileSystemCallbackDispatcher>(
|
| - new LocalFileSystemCallbackDispatcher(
|
| - function, profile, child_id, extension));
|
| + return base::Bind(
|
| + &LocalFileSystemCallbackDispatcher::DidOpenFileSystem,
|
| + base::Owned(new LocalFileSystemCallbackDispatcher(
|
| + function, profile, child_id, extension)));
|
| }
|
|
|
| - // fileapi::FileSystemCallbackDispatcher overrides.
|
| - virtual void DidSucceed() OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidReadMetadata(const base::PlatformFileInfo& info,
|
| - const FilePath& unused) OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidReadDirectory(
|
| - const std::vector<base::FileUtilProxy::Entry>& entries,
|
| - bool has_more) OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidWrite(int64 bytes, bool complete) OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidOpenFileSystem(const std::string& name,
|
| - const GURL& root_path) OVERRIDE {
|
| + void DidOpenFileSystem(base::PlatformFileError result,
|
| + const std::string& name,
|
| + const GURL& root_path) {
|
| + if (result != base::PLATFORM_FILE_OK) {
|
| + DidFail(result);
|
| + return;
|
| + }
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
| // Set up file permission access.
|
| if (!SetupFileSystemAccessPermissions()) {
|
| @@ -365,7 +350,7 @@ class RequestLocalFileSystemFunction::LocalFileSystemCallbackDispatcher
|
| root_path));
|
| }
|
|
|
| - virtual void DidFail(base::PlatformFileError error_code) OVERRIDE {
|
| + void DidFail(base::PlatformFileError error_code) {
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| base::Bind(
|
| @@ -434,7 +419,7 @@ void RequestLocalFileSystemFunction::RequestOnFileThread(
|
| GURL origin_url = source_url.GetOrigin();
|
| profile()->GetFileSystemContext()->OpenFileSystem(
|
| origin_url, fileapi::kFileSystemTypeExternal, false, // create
|
| - LocalFileSystemCallbackDispatcher::Create(
|
| + LocalFileSystemCallbackDispatcher::CreateCallback(
|
| this,
|
| profile(),
|
| child_id,
|
| @@ -628,10 +613,10 @@ bool GetFileTasksFileBrowserFunction::RunImpl() {
|
| return true;
|
| }
|
|
|
| -class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
|
| - : public fileapi::FileSystemCallbackDispatcher {
|
| +class
|
| + ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher {
|
| public:
|
| - static scoped_ptr<fileapi::FileSystemCallbackDispatcher> Create(
|
| + static fileapi::FileSystemContext::OpenFileSystemCallback CreateCallback(
|
| ExecuteTasksFileBrowserFunction* function,
|
| Profile* profile,
|
| int child_id,
|
| @@ -639,34 +624,20 @@ class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
|
| scoped_refptr<const Extension> extension,
|
| const std::string task_id,
|
| const std::vector<GURL>& file_urls) {
|
| - return scoped_ptr<fileapi::FileSystemCallbackDispatcher>(
|
| - new ExecuteTasksFileSystemCallbackDispatcher(
|
| + return base::Bind(
|
| + &ExecuteTasksFileSystemCallbackDispatcher::DidOpenFileSystem,
|
| + base::Owned(new ExecuteTasksFileSystemCallbackDispatcher(
|
| function, profile, child_id, source_url, extension,
|
| - task_id, file_urls));
|
| + task_id, file_urls)));
|
| }
|
|
|
| - // fileapi::FileSystemCallbackDispatcher overrides.
|
| - virtual void DidSucceed() OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidReadMetadata(const base::PlatformFileInfo& info,
|
| - const FilePath& unused) OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidReadDirectory(
|
| - const std::vector<base::FileUtilProxy::Entry>& entries,
|
| - bool has_more) OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidWrite(int64 bytes, bool complete) OVERRIDE {
|
| - NOTREACHED();
|
| - }
|
| -
|
| - virtual void DidOpenFileSystem(const std::string& file_system_name,
|
| - const GURL& file_system_root) OVERRIDE {
|
| + void DidOpenFileSystem(base::PlatformFileError result,
|
| + const std::string& file_system_name,
|
| + const GURL& file_system_root) {
|
| + if (result != base::PLATFORM_FILE_OK) {
|
| + DidFail(result);
|
| + return;
|
| + }
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
| ExecuteTasksFileBrowserFunction::FileDefinitionList file_list;
|
| for (std::vector<GURL>::iterator iter = origin_file_urls_.begin();
|
| @@ -700,7 +671,7 @@ class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
|
| file_list));
|
| }
|
|
|
| - virtual void DidFail(base::PlatformFileError error_code) OVERRIDE {
|
| + void DidFail(base::PlatformFileError error_code) {
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| base::Bind(
|
| @@ -899,7 +870,7 @@ void ExecuteTasksFileBrowserFunction::RequestFileEntryOnFileThread(
|
| GURL origin_url = source_url.GetOrigin();
|
| profile()->GetFileSystemContext()->OpenFileSystem(
|
| origin_url, fileapi::kFileSystemTypeExternal, false, // create
|
| - ExecuteTasksFileSystemCallbackDispatcher::Create(
|
| + ExecuteTasksFileSystemCallbackDispatcher::CreateCallback(
|
| this,
|
| profile(),
|
| render_view_host()->process()->GetID(),
|
|
|