Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: chrome/browser/chromeos/extensions/file_handler_util.cc

Issue 10873055: Changed FileSystemPointProvider::IsAcccessAllowed() to take a single FileSystemURL instead of a tri… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698