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

Unified Diff: mojo/services/files/cpp/lib/input_stream_file.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
Index: mojo/services/files/cpp/lib/input_stream_file.cc
diff --git a/mojo/services/files/cpp/lib/input_stream_file.cc b/mojo/services/files/cpp/lib/input_stream_file.cc
index f67293823b38e727ce057eb05af7f24df28c8ed5..597810750631db4130b6b32373c0e688d4fab020 100644
--- a/mojo/services/files/cpp/lib/input_stream_file.cc
+++ b/mojo/services/files/cpp/lib/input_stream_file.cc
@@ -63,13 +63,13 @@ void InputStreamFile::Read(uint32_t num_bytes_to_read,
mojo::files::Whence whence,
const ReadCallback& callback) {
if (is_closed_) {
- callback.Run(mojo::files::Error::CLOSED, mojo::Array<uint8_t>());
+ callback.Run(mojo::files::Error::CLOSED, nullptr);
return;
}
if (offset != 0 || whence != mojo::files::Whence::FROM_CURRENT) {
// TODO(vtl): Is this the "right" behavior?
- callback.Run(mojo::files::Error::INVALID_ARGUMENT, mojo::Array<uint8_t>());
+ callback.Run(mojo::files::Error::INVALID_ARGUMENT, nullptr);
return;
}
@@ -224,11 +224,11 @@ void InputStreamFile::Ioctl(uint32_t request,
mojo::Array<uint32_t> in_values,
const IoctlCallback& callback) {
if (is_closed_) {
- callback.Run(mojo::files::Error::CLOSED, mojo::Array<uint32_t>());
+ callback.Run(mojo::files::Error::CLOSED, nullptr);
return;
}
- callback.Run(mojo::files::Error::UNIMPLEMENTED, mojo::Array<uint32_t>());
+ callback.Run(mojo::files::Error::UNIMPLEMENTED, nullptr);
}
void InputStreamFile::StartRead() {
@@ -239,7 +239,7 @@ void InputStreamFile::StartRead() {
while (!pending_read_queue_.empty()) {
// TODO(vtl): Is this what we want?
pending_read_queue_.front().callback.Run(mojo::files::Error::UNAVAILABLE,
- mojo::Array<uint8_t>());
+ nullptr);
pending_read_queue_.pop_front();
}
return;
@@ -250,8 +250,7 @@ void InputStreamFile::StartRead() {
// the queue. Note that we do this in FIFO order (thus couldn't have
// completed them earlier).
while (!pending_read_queue_.front().num_bytes) {
- pending_read_queue_.front().callback.Run(mojo::files::Error::OK,
- mojo::Array<uint8_t>());
+ pending_read_queue_.front().callback.Run(mojo::files::Error::OK, nullptr);
pending_read_queue_.pop_front();
if (pending_read_queue_.empty())
@@ -288,7 +287,7 @@ void InputStreamFile::CompleteRead(mojo::files::Error error,
MOJO_CHECK(!pending_read_queue_.empty());
if (error != mojo::files::Error::OK) {
- pending_read_queue_.front().callback.Run(error, mojo::Array<uint8_t>());
+ pending_read_queue_.front().callback.Run(error, nullptr);
pending_read_queue_.pop_front();
return;
}
« no previous file with comments | « mojo/public/cpp/bindings/tests/versioning_test_service.cc ('k') | mojo/services/files/cpp/lib/output_stream_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698