Index: services/files/directory_impl.cc |
diff --git a/services/files/directory_impl.cc b/services/files/directory_impl.cc |
index 279c3bd3558714efb9d6dad408cf91a66eb92204..40aa33c7e967655388d0abec2a2a7e810e2ddf97 100644 |
--- a/services/files/directory_impl.cc |
+++ b/services/files/directory_impl.cc |
@@ -190,14 +190,16 @@ void DirectoryImpl::OpenFile(const String& path, |
DCHECK(!path.is_null()); |
DCHECK(dir_fd_.is_valid()); |
- if (Error error = IsPathValid(path)) { |
+ Error error = IsPathValid(path); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
// TODO(vtl): Make sure the path doesn't exit this directory (if appropriate). |
// TODO(vtl): Maybe allow absolute paths? |
- if (Error error = ValidateOpenFlags(open_flags, false)) { |
+ error = ValidateOpenFlags(open_flags, false); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
@@ -235,14 +237,16 @@ void DirectoryImpl::OpenDirectory(const String& path, |
DCHECK(!path.is_null()); |
DCHECK(dir_fd_.is_valid()); |
- if (Error error = IsPathValid(path)) { |
+ Error error = IsPathValid(path); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
// TODO(vtl): Make sure the path doesn't exit this directory (if appropriate). |
// TODO(vtl): Maybe allow absolute paths? |
- if (Error error = ValidateOpenFlags(open_flags, false)) { |
+ error = ValidateOpenFlags(open_flags, false); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
@@ -284,11 +288,14 @@ void DirectoryImpl::Rename(const String& path, |
DCHECK(!new_path.is_null()); |
DCHECK(dir_fd_.is_valid()); |
- if (Error error = IsPathValid(path)) { |
+ Error error = IsPathValid(path); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
- if (Error error = IsPathValid(new_path)) { |
+ |
+ error = IsPathValid(new_path); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
@@ -309,13 +316,15 @@ void DirectoryImpl::Delete(const String& path, |
DCHECK(!path.is_null()); |
DCHECK(dir_fd_.is_valid()); |
- if (Error error = IsPathValid(path)) { |
+ Error error = IsPathValid(path); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |
// TODO(vtl): See TODOs about |path| in OpenFile(). |
- if (Error error = ValidateDeleteFlags(delete_flags)) { |
+ error = ValidateDeleteFlags(delete_flags); |
+ if (error != ERROR_OK) { |
callback.Run(error); |
return; |
} |