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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc

Issue 242443004: Remove thread restriction of fileapi::FileSystemContext::ResolveURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment for failure case. Created 6 years, 8 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: chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc
index b36285e4bea8b15c5249b889bc9f9e63f2b5b8f6..f80e275abb03b6277cd9e539189597c1cd4f2801 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc
@@ -326,26 +326,6 @@ void FileBrowserHandlerInternalSelectFileFunction::OnFilePathSelected(
external_backend->GetVirtualPath(full_path, &file_definition.virtual_path);
DCHECK(!file_definition.virtual_path.empty());
- file_manager::util::ConvertFileDefinitionToEntryDefinition(
- GetProfile(),
- extension_id(),
- file_definition,
- base::Bind(
- &FileBrowserHandlerInternalSelectFileFunction::GrantPermissions,
- this,
- full_path,
- file_definition));
-}
-
-void FileBrowserHandlerInternalSelectFileFunction::GrantPermissions(
- const base::FilePath& full_path,
- const FileDefinition& file_definition,
- const EntryDefinition& entry_definition) {
- fileapi::ExternalFileSystemBackend* external_backend =
- file_manager::util::GetFileSystemContextForRenderViewHost(
- GetProfile(), render_view_host())->external_backend();
- DCHECK(external_backend);
-
// Grant access to this particular file to target extension. This will
// ensure that the target extension can access only this FS entry and
// prevent from traversing FS hierarchy upward.
@@ -356,6 +336,17 @@ void FileBrowserHandlerInternalSelectFileFunction::GrantPermissions(
content::ChildProcessSecurityPolicy::GetInstance()->GrantCreateReadWriteFile(
render_view_host()->GetProcess()->GetID(), full_path);
+ file_manager::util::ConvertFileDefinitionToEntryDefinition(
+ GetProfile(),
+ extension_id(),
+ file_definition,
+ base::Bind(
+ &FileBrowserHandlerInternalSelectFileFunction::RespondEntryDefinition,
+ this));
+}
+
+void FileBrowserHandlerInternalSelectFileFunction::RespondEntryDefinition(
+ const EntryDefinition& entry_definition) {
Respond(entry_definition, true);
}

Powered by Google App Engine
This is Rietveld 408576698