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

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
Index: services/files/directory_impl.cc
diff --git a/services/files/directory_impl.cc b/services/files/directory_impl.cc
index 279c3bd3558714efb9d6dad408cf91a66eb92204..b049de6493cae66e5918b0c0784b8fc9c75bdddc 100644
--- a/services/files/directory_impl.cc
+++ b/services/files/directory_impl.cc
@@ -187,17 +187,18 @@ void DirectoryImpl::OpenFile(const String& path,
InterfaceRequest<File> file,
uint32_t open_flags,
const OpenFileCallback& callback) {
+ Error error;
DCHECK(!path.is_null());
DCHECK(dir_fd_.is_valid());
- if (Error error = IsPathValid(path)) {
+ if ((error = IsPathValid(path)) != ERROR_OK) {
viettrungluu 2015/09/22 22:04:58 I think I'd prefer if you just did: Error error =
johngro 2015/09/22 22:24:12 Done.
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)) {
+ if ((error = ValidateOpenFlags(open_flags, false)) != ERROR_OK) {
callback.Run(error);
return;
}
@@ -232,17 +233,18 @@ void DirectoryImpl::OpenDirectory(const String& path,
InterfaceRequest<Directory> directory,
uint32_t open_flags,
const OpenDirectoryCallback& callback) {
+ Error error;
DCHECK(!path.is_null());
DCHECK(dir_fd_.is_valid());
- if (Error error = IsPathValid(path)) {
+ if ((error = IsPathValid(path)) != 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)) {
+ if ((error = ValidateOpenFlags(open_flags, false)) != ERROR_OK) {
callback.Run(error);
return;
}
@@ -280,15 +282,16 @@ void DirectoryImpl::OpenDirectory(const String& path,
void DirectoryImpl::Rename(const String& path,
const String& new_path,
const RenameCallback& callback) {
+ Error error;
DCHECK(!path.is_null());
DCHECK(!new_path.is_null());
DCHECK(dir_fd_.is_valid());
- if (Error error = IsPathValid(path)) {
+ if ((error = IsPathValid(path)) != ERROR_OK) {
callback.Run(error);
return;
}
- if (Error error = IsPathValid(new_path)) {
+ if ((error = IsPathValid(new_path)) != ERROR_OK) {
callback.Run(error);
return;
}
@@ -306,16 +309,17 @@ void DirectoryImpl::Rename(const String& path,
void DirectoryImpl::Delete(const String& path,
uint32_t delete_flags,
const DeleteCallback& callback) {
+ Error error;
DCHECK(!path.is_null());
DCHECK(dir_fd_.is_valid());
- if (Error error = IsPathValid(path)) {
+ if ((error = IsPathValid(path)) != ERROR_OK) {
callback.Run(error);
return;
}
// TODO(vtl): See TODOs about |path| in OpenFile().
- if (Error error = ValidateDeleteFlags(delete_flags)) {
+ if ((error = ValidateDeleteFlags(delete_flags)) != ERROR_OK) {
callback.Run(error);
return;
}

Powered by Google App Engine
This is Rietveld 408576698