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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 1023793002: Move absolute path conversion back to the FILE thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make check_path const. Created 5 years, 9 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 | « chrome/browser/extensions/api/file_system/file_system_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/file_system/file_system_api.cc
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index dbe8bfdc83aa506e9c2dc6cabb020662319e8094..6c3dc8754c28ee81fed5cd59c482851889152dd6 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -639,13 +639,10 @@ void FileSystemChooseEntryFunction::FilesSelected(
content::WebContents* web_contents = app_window->web_contents();
DCHECK_EQ(paths.size(), 1u);
+ bool non_native_path = false;
#if defined(OS_CHROMEOS)
- base::FilePath check_path =
- file_manager::util::IsUnderNonNativeLocalPath(GetProfile(), paths[0])
- ? paths[0]
- : base::MakeAbsoluteFilePath(paths[0]);
-#else
- base::FilePath check_path = base::MakeAbsoluteFilePath(paths[0]);
+ non_native_path =
+ file_manager::util::IsUnderNonNativeLocalPath(GetProfile(), paths[0]);
#endif
content::BrowserThread::PostTask(
@@ -654,7 +651,7 @@ void FileSystemChooseEntryFunction::FilesSelected(
base::Bind(
&FileSystemChooseEntryFunction::ConfirmDirectoryAccessOnFileThread,
this,
- check_path,
+ non_native_path,
paths,
web_contents));
return;
@@ -669,9 +666,11 @@ void FileSystemChooseEntryFunction::FileSelectionCanceled() {
}
void FileSystemChooseEntryFunction::ConfirmDirectoryAccessOnFileThread(
- const base::FilePath& check_path,
+ bool non_native_path,
const std::vector<base::FilePath>& paths,
content::WebContents* web_contents) {
+ const base::FilePath check_path =
+ non_native_path ? paths[0] : base::MakeAbsoluteFilePath(paths[0]);
if (check_path.empty()) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,
« no previous file with comments | « chrome/browser/extensions/api/file_system/file_system_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698