| Index: components/filesystem/directory_impl.cc
|
| diff --git a/components/filesystem/directory_impl.cc b/components/filesystem/directory_impl.cc
|
| index fca0a212afba2ae9ec9ea4ed669dada3e611642e..3d2a758e518f7bd7e8547ca0b8348fc6bfa97db4 100644
|
| --- a/components/filesystem/directory_impl.cc
|
| +++ b/components/filesystem/directory_impl.cc
|
| @@ -165,4 +165,27 @@ void DirectoryImpl::Delete(const mojo::String& raw_path,
|
| callback.Run(FILE_ERROR_OK);
|
| }
|
|
|
| +void DirectoryImpl::Exists(const mojo::String& raw_path,
|
| + const ExistsCallback& callback) {
|
| + base::FilePath path;
|
| + if (FileError error = ValidatePath(raw_path, directory_path_, &path)) {
|
| + callback.Run(error, false);
|
| + return;
|
| + }
|
| +
|
| + bool exists = base::PathExists(path);
|
| + callback.Run(FILE_ERROR_OK, exists);
|
| +}
|
| +
|
| +void DirectoryImpl::IsWritable(const mojo::String& raw_path,
|
| + const IsWritableCallback& callback) {
|
| + base::FilePath path;
|
| + if (FileError error = ValidatePath(raw_path, directory_path_, &path)) {
|
| + callback.Run(error, false);
|
| + return;
|
| + }
|
| +
|
| + callback.Run(FILE_ERROR_OK, base::PathIsWritable(path));
|
| +}
|
| +
|
| } // namespace filesystem
|
|
|