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

Unified Diff: chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc

Issue 306073004: Rename "CheckWritable" to "PrepareForWritableApp" to reflect the actual behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments. Created 6 years, 7 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/extensions/api/file_handlers/app_file_handler_util.cc
diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
index 9c921175175a5d209178f6d98e4e01d28382b7da..5a972af76eefc95af211ec97e92f4919f21ffdf2 100644
--- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
+++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
@@ -77,12 +77,9 @@ bool DoCheckWritableFile(const base::FilePath& path, bool is_directory) {
return base::DirectoryExists(path);
// Create the file if it doesn't already exist.
- int creation_flags = base::File::FLAG_CREATE | base::File::FLAG_READ |
- base::File::FLAG_WRITE;
+ int creation_flags = base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ;
base::File file(path, creation_flags);
- if (file.IsValid())
- return true;
- return file.error_details() == base::File::FILE_ERROR_EXISTS;
+ return file.IsValid();
}
// Checks whether a list of paths are all OK for writing and calls a provided
@@ -155,7 +152,7 @@ void WritableFileChecker::Check() {
base::Bind(&WritableFileChecker::NonNativeLocalPathCheckDone,
this, *it));
} else {
- file_manager::util::PrepareNonNativeLocalPathWritableFile(
+ file_manager::util::PrepareNonNativeLocalFileForWritableApp(
profile_,
*it,
base::Bind(&WritableFileChecker::NonNativeLocalPathCheckDone,
@@ -320,7 +317,7 @@ GrantedFileEntry CreateFileEntry(
return result;
}
-void CheckWritableFiles(
+void PrepareFilesForWritableApp(
const std::vector<base::FilePath>& paths,
Profile* profile,
bool is_directory,

Powered by Google App Engine
This is Rietveld 408576698