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

Unified Diff: chrome/browser/extensions/extension_file_browser_private_api.cc

Issue 9004019: Cleanup: Removing FileSystemPathManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 9 years 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: chrome/browser/extensions/extension_file_browser_private_api.cc
diff --git a/chrome/browser/extensions/extension_file_browser_private_api.cc b/chrome/browser/extensions/extension_file_browser_private_api.cc
index 3d305df38d3653caa71a9048d1a2f2a401c1d6de..80d40a3b1a9719374e9ae731ef94be2acd07c224 100644
--- a/chrome/browser/extensions/extension_file_browser_private_api.cc
+++ b/chrome/browser/extensions/extension_file_browser_private_api.cc
@@ -46,7 +46,6 @@
#include "webkit/fileapi/file_system_mount_point_provider.h"
#include "webkit/fileapi/file_system_operation.h"
#include "webkit/fileapi/file_system_operation_context.h"
-#include "webkit/fileapi/file_system_path_manager.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/file_system_util.h"
@@ -381,10 +380,8 @@ class RequestLocalFileSystemFunction::LocalFileSystemCallbackDispatcher
return false;
}
- fileapi::FileSystemPathManager* path_manager =
- profile_->GetFileSystemContext()->path_manager();
fileapi::ExternalFileSystemMountPointProvider* provider =
- path_manager->external_provider();
+ profile_->GetFileSystemContext()->external_provider();
if (!provider)
return false;
@@ -463,8 +460,6 @@ void RequestLocalFileSystemFunction::RespondFailedOnUIThread(
bool FileWatchBrowserFunctionBase::GetLocalFilePath(
const GURL& file_url, FilePath* local_path, FilePath* virtual_path) {
- fileapi::FileSystemPathManager* path_manager =
- profile_->GetFileSystemContext()->path_manager();
GURL file_origin_url;
fileapi::FileSystemType type;
if (!CrackFileSystemURL(file_url, &file_origin_url, &type,
@@ -474,8 +469,8 @@ bool FileWatchBrowserFunctionBase::GetLocalFilePath(
if (type != fileapi::kFileSystemTypeExternal)
return false;
- FilePath root_path =
- path_manager->ValidateFileSystemRootAndGetPathOnFileThread(
+ FilePath root_path = profile_->GetFileSystemContext()->external_provider()->
+ ValidateFileSystemRootAndGetPathOnFileThread(
file_origin_url,
fileapi::kFileSystemTypeExternal,
*virtual_path,
@@ -743,11 +738,14 @@ class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
if (type != fileapi::kFileSystemTypeExternal)
return false;
- fileapi::FileSystemPathManager* path_manager =
- profile_->GetFileSystemContext()->path_manager();
- if (!path_manager->IsAccessAllowed(file_origin_url,
- type,
- virtual_path)) {
+ fileapi::ExternalFileSystemMountPointProvider* external_provider =
+ profile_->GetFileSystemContext()->external_provider();
+ if (!external_provider)
+ return false;
+
+ if (!external_provider->IsAccessAllowed(file_origin_url,
+ type,
+ virtual_path)) {
return false;
}
@@ -758,18 +756,13 @@ class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
}
FilePath root_path =
- path_manager->ValidateFileSystemRootAndGetPathOnFileThread(
+ external_provider->ValidateFileSystemRootAndGetPathOnFileThread(
file_origin_url,
fileapi::kFileSystemTypeExternal,
virtual_path,
false); // create
FilePath final_file_path = root_path.Append(virtual_path);
- fileapi::ExternalFileSystemMountPointProvider* external_provider =
- path_manager->external_provider();
- if (!external_provider)
- return false;
-
// Check if this file system entry exists first.
base::PlatformFileInfo file_info;
@@ -1011,9 +1004,6 @@ void FileBrowserFunction::GetLocalPathsOnFileThread(
// FilePath(virtual_path) doesn't work on win, so limit this to ChromeOS.
#if defined(OS_CHROMEOS)
GURL origin_url = source_url().GetOrigin();
- fileapi::FileSystemPathManager* path_manager =
- profile()->GetFileSystemContext()->path_manager();
-
size_t len = file_urls.size();
selected_files.reserve(len);
for (size_t i = 0; i < len; ++i) {
@@ -1029,7 +1019,13 @@ void FileBrowserFunction::GetLocalPathsOnFileThread(
NOTREACHED();
continue;
}
- FilePath root = path_manager->ValidateFileSystemRootAndGetPathOnFileThread(
+ fileapi::ExternalFileSystemMountPointProvider* provider =
+ profile_->GetFileSystemContext()->external_provider();
+ if (!provider) {
+ LOG(WARNING) << "External provider is not available";
+ continue;
+ }
+ FilePath root = provider->ValidateFileSystemRootAndGetPathOnFileThread(
origin_url,
fileapi::kFileSystemTypeExternal,
FilePath(virtual_path),

Powered by Google App Engine
This is Rietveld 408576698