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

Unified Diff: services/files/file_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 | « services/files/directory_impl.cc ('k') | services/files/shared_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/files/file_impl.cc
diff --git a/services/files/file_impl.cc b/services/files/file_impl.cc
index 4c1ca4a91b983ce6612a99c34c924aa2595cd2b8..ba0e058272dab52c60419a827b8fff5ad32889bd 100644
--- a/services/files/file_impl.cc
+++ b/services/files/file_impl.cc
@@ -71,11 +71,15 @@ void FileImpl::Read(uint32_t num_bytes_to_read,
callback.Run(ERROR_OUT_OF_RANGE, Array<uint8_t>());
return;
}
- if (Error error = IsOffsetValid(offset)) {
+
+ Error error = IsOffsetValid(offset);
+ if (error != ERROR_OK) {
callback.Run(error, Array<uint8_t>());
return;
}
- if (Error error = IsWhenceValid(whence)) {
+
+ error = IsWhenceValid(whence);
+ if (error != ERROR_OK) {
callback.Run(error, Array<uint8_t>());
return;
}
@@ -125,11 +129,15 @@ void FileImpl::Write(Array<uint8_t> bytes_to_write,
callback.Run(ERROR_OUT_OF_RANGE, 0);
return;
}
- if (Error error = IsOffsetValid(offset)) {
+
+ Error error = IsOffsetValid(offset);
+ if (error != ERROR_OK) {
callback.Run(error, 0);
return;
}
- if (Error error = IsWhenceValid(whence)) {
+
+ error = IsWhenceValid(whence);
+ if (error != ERROR_OK) {
callback.Run(error, 0);
return;
}
@@ -172,11 +180,15 @@ void FileImpl::ReadToStream(ScopedDataPipeProducerHandle source,
callback.Run(ERROR_CLOSED);
return;
}
- if (Error error = IsOffsetValid(offset)) {
+
+ Error error = IsOffsetValid(offset);
+ if (error != ERROR_OK) {
callback.Run(error);
return;
}
- if (Error error = IsWhenceValid(whence)) {
+
+ error = IsWhenceValid(whence);
+ if (error != ERROR_OK) {
callback.Run(error);
return;
}
@@ -194,11 +206,15 @@ void FileImpl::WriteFromStream(ScopedDataPipeConsumerHandle sink,
callback.Run(ERROR_CLOSED);
return;
}
- if (Error error = IsOffsetValid(offset)) {
+
+ Error error = IsOffsetValid(offset);
+ if (error != ERROR_OK) {
callback.Run(error);
return;
}
- if (Error error = IsWhenceValid(whence)) {
+
+ error = IsWhenceValid(whence);
+ if (error != ERROR_OK) {
callback.Run(error);
return;
}
@@ -219,11 +235,15 @@ void FileImpl::Seek(int64_t offset,
callback.Run(ERROR_CLOSED, 0);
return;
}
- if (Error error = IsOffsetValid(offset)) {
+
+ Error error = IsOffsetValid(offset);
+ if (error != ERROR_OK) {
callback.Run(error, 0);
return;
}
- if (Error error = IsWhenceValid(whence)) {
+
+ error = IsWhenceValid(whence);
+ if (error != ERROR_OK) {
callback.Run(error, 0);
return;
}
@@ -255,7 +275,9 @@ void FileImpl::Truncate(int64_t size, const TruncateCallback& callback) {
callback.Run(ERROR_INVALID_ARGUMENT);
return;
}
- if (Error error = IsOffsetValid(size)) {
+
+ Error error = IsOffsetValid(size);
+ if (error != ERROR_OK) {
callback.Run(error);
return;
}
« no previous file with comments | « services/files/directory_impl.cc ('k') | services/files/shared_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698