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

Unified Diff: webkit/fileapi/isolated_file_util.cc

Issue 10825316: Invalid FileSystemURL should not be given to FileUtils (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_file_util.cc
diff --git a/webkit/fileapi/isolated_file_util.cc b/webkit/fileapi/isolated_file_util.cc
index d6189781ea72b08f175b1b92dfc56d26ba62e219..24ff4ab9a50d91b3c84b9878aee80b41c6768d1a 100644
--- a/webkit/fileapi/isolated_file_util.cc
+++ b/webkit/fileapi/isolated_file_util.cc
@@ -118,6 +118,7 @@ PlatformFileError IsolatedFileUtil::GetLocalFilePath(
const FileSystemURL& url,
FilePath* local_file_path) {
DCHECK(local_file_path);
+ DCHECK(url.is_valid());
if (url.path().empty()) {
// Root direcory case, which should not be accessed.
return base::PLATFORM_FILE_ERROR_ACCESS_DENIED;
@@ -137,6 +138,7 @@ PlatformFileError DraggedFileUtil::GetFileInfo(
FilePath* platform_path) {
DCHECK(file_info);
std::string filesystem_id;
+ DCHECK(url.is_valid());
if (url.path().empty()) {
// The root directory case.
// For now we leave three time fields (modified/accessed/creation time)
@@ -164,6 +166,7 @@ DraggedFileUtil::CreateFileEnumerator(
FileSystemOperationContext* context,
const FileSystemURL& root,
bool recursive) {
+ DCHECK(root.is_valid());
if (!root.path().empty())
return NativeFileUtil::CreateFileEnumerator(root.path(), recursive);
@@ -179,6 +182,7 @@ DraggedFileUtil::CreateFileEnumerator(
bool DraggedFileUtil::IsDirectoryEmpty(
FileSystemOperationContext* context,
const FileSystemURL& url) {
+ DCHECK(url.is_valid());
if (url.path().empty()) {
// The root directory case.
std::vector<FileInfo> toplevels;
« no previous file with comments | « no previous file | webkit/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698