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

Unified Diff: webkit/chromeos/fileapi/cros_mount_point_provider.cc

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Couple of nits I noticed Created 7 years, 11 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
Index: webkit/chromeos/fileapi/cros_mount_point_provider.cc
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider.cc b/webkit/chromeos/fileapi/cros_mount_point_provider.cc
index 33bcbf16a963c378f7352d1d33ab3a4ab6025842..9a8aafb966289a14454ff07d6488728449a6570a 100644
--- a/webkit/chromeos/fileapi/cros_mount_point_provider.cc
+++ b/webkit/chromeos/fileapi/cros_mount_point_provider.cc
@@ -89,18 +89,21 @@ FilePath CrosMountPointProvider::GetFileSystemRootPathOnFileThread(
bool CrosMountPointProvider::IsAccessAllowed(
const fileapi::FileSystemURL& url) {
- if (!CanHandleURL(url))
+ if (!url.is_valid())
return false;
- // No extra check is needed for isolated file systems.
- if (url.mount_type() == fileapi::kFileSystemTypeIsolated)
- return true;
-
// Permit access to mount points from internal WebUI.
const GURL& origin_url = url.origin();
if (origin_url.SchemeIs(kChromeUIScheme))
return true;
+ // No extra check is needed for isolated file systems.
+ if (url.mount_type() == fileapi::kFileSystemTypeIsolated)
+ return true;
+
+ if (!CanHandleURL(url))
+ return false;
+
std::string extension_id = origin_url.host();
// Check first to make sure this extension has fileBrowserHander permissions.
if (!special_storage_policy_->IsFileHandler(extension_id))

Powered by Google App Engine
This is Rietveld 408576698