| Index: content/browser/fileapi/fileapi_message_filter.cc
|
| diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
|
| index 6bb05d869314e77512e58cd0aa17ad5e17997f09..a9a4d7819cbca50a2b5aa49c1c6b14d11a44a01d 100644
|
| --- a/content/browser/fileapi/fileapi_message_filter.cc
|
| +++ b/content/browser/fileapi/fileapi_message_filter.cc
|
| @@ -38,6 +38,7 @@
|
| #include "webkit/common/blob/blob_data.h"
|
| #include "webkit/common/blob/shareable_file_reference.h"
|
| #include "webkit/common/fileapi/directory_entry.h"
|
| +#include "webkit/common/fileapi/file_system_info.h"
|
| #include "webkit/common/fileapi/file_system_types.h"
|
| #include "webkit/common/fileapi/file_system_util.h"
|
|
|
| @@ -161,6 +162,7 @@ bool FileAPIMessageFilter::OnMessageReceived(
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP_EX(FileAPIMessageFilter, message, *message_was_ok)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_Open, OnOpen)
|
| + IPC_MESSAGE_HANDLER(FileSystemHostMsg_ResolveURL, OnResolveURL)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_DeleteFileSystem, OnDeleteFileSystem)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_Move, OnMove)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_Copy, OnCopy)
|
| @@ -241,6 +243,21 @@ void FileAPIMessageFilter::OnOpen(
|
| &FileAPIMessageFilter::DidOpenFileSystem, this, request_id));
|
| }
|
|
|
| +void FileAPIMessageFilter::OnResolveURL(
|
| + int request_id,
|
| + const GURL& filesystem_url) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| + base::PlatformFileError error;
|
| + FileSystemURL url(context_->CrackURL(filesystem_url));
|
| + if (!HasPermissionsForFile(url, fileapi::kReadFilePermissions, &error)) {
|
| + Send(new FileSystemMsg_DidFail(request_id, error));
|
| + return;
|
| + }
|
| +
|
| + context_->ResolveURL(url, base::Bind(
|
| + &FileAPIMessageFilter::DidResolveURL, this, request_id));
|
| +}
|
| +
|
| void FileAPIMessageFilter::OnDeleteFileSystem(
|
| int request_id,
|
| const GURL& origin_url,
|
| @@ -833,18 +850,35 @@ void FileAPIMessageFilter::DidWrite(int request_id,
|
|
|
| void FileAPIMessageFilter::DidOpenFileSystem(int request_id,
|
| base::PlatformFileError result,
|
| - const std::string& name,
|
| + const std::string& filesystem_name,
|
| const GURL& root) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| if (result == base::PLATFORM_FILE_OK) {
|
| DCHECK(root.is_valid());
|
| - Send(new FileSystemMsg_DidOpenFileSystem(request_id, name, root));
|
| + Send(new FileSystemMsg_DidOpenFileSystem(
|
| + request_id, filesystem_name, root));
|
| } else {
|
| Send(new FileSystemMsg_DidFail(request_id, result));
|
| }
|
| // For OpenFileSystem we do not create a new operation, so no unregister here.
|
| }
|
|
|
| +void FileAPIMessageFilter::DidResolveURL(int request_id,
|
| + base::PlatformFileError result,
|
| + const fileapi::FileSystemInfo& info,
|
| + const base::FilePath& file_path,
|
| + bool is_directory) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| + if (result == base::PLATFORM_FILE_OK) {
|
| + DCHECK(info.root_url.is_valid());
|
| + Send(new FileSystemMsg_DidResolveURL(
|
| + request_id, info, file_path, is_directory));
|
| + } else {
|
| + Send(new FileSystemMsg_DidFail(request_id, result));
|
| + }
|
| + // For ResolveURL we do not create a new operation, so no unregister here.
|
| +}
|
| +
|
| void FileAPIMessageFilter::DidDeleteFileSystem(
|
| int request_id,
|
| base::PlatformFileError result) {
|
|
|