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

Unified Diff: services/files/directory_impl.cc

Issue 1355403002: enum class fixups - testing non-zero (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 | « examples/echo_terminal/main.cc ('k') | services/files/file_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « examples/echo_terminal/main.cc ('k') | services/files/file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698