Chromium Code Reviews| Index: chrome/browser/chromeos/extensions/file_handler_util.cc |
| diff --git a/chrome/browser/chromeos/extensions/file_handler_util.cc b/chrome/browser/chromeos/extensions/file_handler_util.cc |
| index 396b5e9b836cd8b98e6e975bd3d9688826f87c00..cf8e6a95c3e178c82b2ecb9371f5ef105a88f81c 100644 |
| --- a/chrome/browser/chromeos/extensions/file_handler_util.cc |
| +++ b/chrome/browser/chromeos/extensions/file_handler_util.cc |
| @@ -36,6 +36,7 @@ |
| #include "net/base/escape.h" |
| #include "webkit/fileapi/file_system_context.h" |
| #include "webkit/fileapi/file_system_mount_point_provider.h" |
| +#include "webkit/fileapi/file_system_url.h" |
| #include "webkit/fileapi/file_system_util.h" |
| using content::BrowserContext; |
| @@ -566,15 +567,13 @@ class ExtensionTaskExecutor::ExecuteTasksFileSystemCallbackDispatcher { |
| if (handler_pid_ == 0) |
| return false; |
| - GURL file_origin_url; |
| - FilePath virtual_path; |
| - fileapi::FileSystemType type; |
| - if (!CrackFileSystemURL(origin_file_url, &file_origin_url, &type, |
| - &virtual_path)) { |
| + fileapi::FileSystemURL file_system_url = fileapi::FileSystemURL( |
| + origin_file_url); |
| + if (!file_system_url.is_valid()) { |
|
nhiroki (google)
2012/08/24 07:20:03
nit: can you remove brace?
calvinlo
2012/08/24 07:55:09
Done.
|
| return false; |
| } |
| - if (type != fileapi::kFileSystemTypeExternal) |
| + if (file_system_url.type() != fileapi::kFileSystemTypeExternal) |
| return false; |
| fileapi::ExternalFileSystemMountPointProvider* external_provider = |
| @@ -582,21 +581,20 @@ class ExtensionTaskExecutor::ExecuteTasksFileSystemCallbackDispatcher { |
| if (!external_provider) |
| return false; |
| - if (!external_provider->IsAccessAllowed(file_origin_url, |
| - type, |
| - virtual_path)) { |
| + if (!external_provider->IsAccessAllowed(file_system_url)) { |
|
nhiroki (google)
2012/08/24 07:20:03
ditto.
calvinlo
2012/08/24 07:55:09
Done. Sorry, this will take me some time to get us
|
| return false; |
| } |
| // Make sure this url really being used by the right caller extension. |
| - if (source_url_.GetOrigin() != file_origin_url) { |
| + if (source_url_.GetOrigin() != file_system_url.origin()) { |
| DidFail(base::PLATFORM_FILE_ERROR_SECURITY); |
| return false; |
| } |
| + FilePath virtual_path = file_system_url.path(); |
| FilePath root_path = |
| external_provider->GetFileSystemRootPathOnFileThread( |
| - file_origin_url, |
| + file_system_url.origin(), |
| fileapi::kFileSystemTypeExternal, |
| virtual_path, |
| false); // create |