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

Unified Diff: services/files/file_impl.cc

Issue 1459033002: Replace (most) occurrences of mojo::Array<T>() with nullptr. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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/file_impl_unittest.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 6281633b6e53d70c95fe4fe69fc0f76eab44666c..c958bee61d4649b746fe45122fad2322da50fb7a 100644
--- a/services/files/file_impl.cc
+++ b/services/files/file_impl.cc
@@ -64,23 +64,23 @@ void FileImpl::Read(uint32_t num_bytes_to_read,
Whence whence,
const ReadCallback& callback) {
if (!file_fd_.is_valid()) {
- callback.Run(Error::CLOSED, Array<uint8_t>());
+ callback.Run(Error::CLOSED, nullptr);
return;
}
if (num_bytes_to_read > kMaxReadSize) {
- callback.Run(Error::OUT_OF_RANGE, Array<uint8_t>());
+ callback.Run(Error::OUT_OF_RANGE, nullptr);
return;
}
Error error = IsOffsetValid(offset);
if (error != Error::OK) {
- callback.Run(error, Array<uint8_t>());
+ callback.Run(error, nullptr);
return;
}
error = IsWhenceValid(whence);
if (error != Error::OK) {
- callback.Run(error, Array<uint8_t>());
+ callback.Run(error, nullptr);
return;
}
@@ -93,7 +93,7 @@ void FileImpl::Read(uint32_t num_bytes_to_read,
// position. See TODO in file.mojom.
if (lseek(file_fd_.get(), static_cast<off_t>(offset),
WhenceToStandardWhence(whence)) < 0) {
- callback.Run(ErrnoToError(errno), Array<uint8_t>());
+ callback.Run(ErrnoToError(errno), nullptr);
return;
}
}
@@ -102,7 +102,7 @@ void FileImpl::Read(uint32_t num_bytes_to_read,
ssize_t num_bytes_read = HANDLE_EINTR(
read(file_fd_.get(), &bytes_read.front(), num_bytes_to_read));
if (num_bytes_read < 0) {
- callback.Run(ErrnoToError(errno), Array<uint8_t>());
+ callback.Run(ErrnoToError(errno), nullptr);
return;
}
@@ -344,13 +344,13 @@ void FileImpl::Ioctl(uint32_t request,
Array<uint32_t> in_values,
const IoctlCallback& callback) {
if (!file_fd_.is_valid()) {
- callback.Run(Error::CLOSED, Array<uint32_t>());
+ callback.Run(Error::CLOSED, nullptr);
return;
}
// TODO(vtl): The "correct" error code should be one that can be translated to
// ENOTTY!
- callback.Run(Error::UNAVAILABLE, Array<uint32_t>());
+ callback.Run(Error::UNAVAILABLE, nullptr);
}
} // namespace files
« no previous file with comments | « services/files/directory_impl.cc ('k') | services/files/file_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698