Commit 971ae8d1 authored by tbarzic@chromium.org's avatar tbarzic@chromium.org

Fix file handler executer setting wrong cache path permissions on drive.

BUG=None
TEST=RemoteFileSystem.RemoteMountPoint


Review URL: https://chromiumcodereview.appspot.com/10536065

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141220 0039d316-1c4b-4281-b951-d872f2087c98
parent 5bbcd21b
...@@ -465,8 +465,7 @@ class FileTaskExecutor::ExecuteTasksFileSystemCallbackDispatcher { ...@@ -465,8 +465,7 @@ class FileTaskExecutor::ExecuteTasksFileSystemCallbackDispatcher {
GURL base_url = fileapi::GetFileSystemRootURI(target_origin_url, GURL base_url = fileapi::GetFileSystemRootURI(target_origin_url,
fileapi::kFileSystemTypeExternal); fileapi::kFileSystemTypeExternal);
file->target_file_url = GURL(base_url.spec() + virtual_path.value()); file->target_file_url = GURL(base_url.spec() + virtual_path.value());
FilePath root(FILE_PATH_LITERAL("/")); file->virtual_path = virtual_path;
file->virtual_path = root.Append(virtual_path);
file->is_directory = file_info.is_directory; file->is_directory = file_info.is_directory;
file->absolute_path = final_file_path; file->absolute_path = final_file_path;
return true; return true;
...@@ -624,7 +623,9 @@ void FileTaskExecutor::SetupPermissionsAndDispatchEvent( ...@@ -624,7 +623,9 @@ void FileTaskExecutor::SetupPermissionsAndDispatchEvent(
files_urls->Append(file_def); files_urls->Append(file_def);
file_def->SetString("fileSystemName", file_system_name); file_def->SetString("fileSystemName", file_system_name);
file_def->SetString("fileSystemRoot", file_system_root.spec()); file_def->SetString("fileSystemRoot", file_system_root.spec());
file_def->SetString("fileFullPath", iter->virtual_path.value()); FilePath root(FILE_PATH_LITERAL("/"));
FilePath full_path = root.Append(iter->virtual_path);
file_def->SetString("fileFullPath", full_path.value());
file_def->SetBoolean("fileIsDirectory", iter->is_directory); file_def->SetBoolean("fileIsDirectory", iter->is_directory);
} }
// Get tab id. // Get tab id.
...@@ -665,7 +666,7 @@ void FileTaskExecutor::InitHandlerHostFileAccessPermissions( ...@@ -665,7 +666,7 @@ void FileTaskExecutor::InitHandlerHostFileAccessPermissions(
// If the file is on gdata mount point, we'll have to give handler host // If the file is on gdata mount point, we'll have to give handler host
// permissions for file's gdata cache paths. // permissions for file's gdata cache paths.
// This has to be called on UI thread. // This has to be called on UI thread.
gdata::util::InsertGDataCachePathsPermissions(profile_, iter->absolute_path, gdata::util::InsertGDataCachePathsPermissions(profile_, iter->virtual_path,
&handler_host_permissions_); &handler_host_permissions_);
} }
} }
......
...@@ -240,7 +240,8 @@ void InsertGDataCachePathsPermissions( ...@@ -240,7 +240,8 @@ void InsertGDataCachePathsPermissions(
return; return;
GDataFileProperties file_properties; GDataFileProperties file_properties;
file_system->GetFileInfoByPath(gdata_path, &file_properties); if (!file_system->GetFileInfoByPath(gdata_path, &file_properties))
return;
std::string resource_id = file_properties.resource_id; std::string resource_id = file_properties.resource_id;
std::string file_md5 = file_properties.file_md5; std::string file_md5 = file_properties.file_md5;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment