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 #ifndef MOJO_SERVICES_PUBLIC_CPP_NETWORK_WEB_SOCKET_READ_QUEUE_H_ | 5 #ifndef MOJO_SERVICES_NETWORK_PUBLIC_CPP_WEB_SOCKET_READ_QUEUE_H_ |
6 #define MOJO_SERVICES_PUBLIC_CPP_NETWORK_WEB_SOCKET_READ_QUEUE_H_ | 6 #define MOJO_SERVICES_NETWORK_PUBLIC_CPP_WEB_SOCKET_READ_QUEUE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "mojo/common/handle_watcher.h" | 10 #include "mojo/common/handle_watcher.h" |
11 #include "mojo/public/cpp/system/data_pipe.h" | 11 #include "mojo/public/cpp/system/data_pipe.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 | 14 |
15 // This class simplifies the handling of multiple Reads on a DataPipe. It reads | 15 // This class simplifies the handling of multiple Reads on a DataPipe. It reads |
16 // the data in the expected chunk size, calling the callback once a full chunk | 16 // the data in the expected chunk size, calling the callback once a full chunk |
(...skipping 15 matching lines...) Expand all Loading... |
32 void OnHandleReady(MojoResult result); | 32 void OnHandleReady(MojoResult result); |
33 | 33 |
34 DataPipeConsumerHandle handle_; | 34 DataPipeConsumerHandle handle_; |
35 common::HandleWatcher handle_watcher_; | 35 common::HandleWatcher handle_watcher_; |
36 ScopedVector<Operation> queue_; | 36 ScopedVector<Operation> queue_; |
37 bool is_waiting_; | 37 bool is_waiting_; |
38 }; | 38 }; |
39 | 39 |
40 } // namespace mojo | 40 } // namespace mojo |
41 | 41 |
42 #endif // MOJO_SERVICES_PUBLIC_CPP_NETWORK_WEB_SOCKET_READ_QUEUE_H_ | 42 #endif // MOJO_SERVICES_NETWORK_PUBLIC_CPP_WEB_SOCKET_READ_QUEUE_H_ |
OLD | NEW |