OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/common/data_pipe_drainer.h" | 5 #include "mojo/common/data_pipe_drainer.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <utility> | 9 #include <utility> |
8 | 10 |
9 #include "base/bind.h" | 11 #include "base/bind.h" |
10 | 12 |
11 namespace mojo { | 13 namespace mojo { |
12 namespace common { | 14 namespace common { |
13 | 15 |
14 DataPipeDrainer::DataPipeDrainer(Client* client, | 16 DataPipeDrainer::DataPipeDrainer(Client* client, |
15 mojo::ScopedDataPipeConsumerHandle source) | 17 mojo::ScopedDataPipeConsumerHandle source) |
16 : client_(client), source_(std::move(source)), weak_factory_(this) { | 18 : client_(client), source_(std::move(source)), weak_factory_(this) { |
(...skipping 26 matching lines...) Expand all Loading... |
43 source_.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE, | 45 source_.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE, |
44 base::Bind(&DataPipeDrainer::WaitComplete, weak_factory_.GetWeakPtr())); | 46 base::Bind(&DataPipeDrainer::WaitComplete, weak_factory_.GetWeakPtr())); |
45 } | 47 } |
46 | 48 |
47 void DataPipeDrainer::WaitComplete(MojoResult result) { | 49 void DataPipeDrainer::WaitComplete(MojoResult result) { |
48 ReadData(); | 50 ReadData(); |
49 } | 51 } |
50 | 52 |
51 } // namespace common | 53 } // namespace common |
52 } // namespace mojo | 54 } // namespace mojo |
OLD | NEW |