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 "network/public/cpp/web_socket_read_queue.h" | 5 #include "network/public/cpp/web_socket_read_queue.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
10 | 12 |
11 namespace mojo { | 13 namespace mojo { |
12 | 14 |
13 struct WebSocketReadQueue::Operation { | 15 struct WebSocketReadQueue::Operation { |
14 Operation(uint32_t num_bytes, | 16 Operation(uint32_t num_bytes, |
15 const base::Callback<void(const char*)>& callback) | 17 const base::Callback<void(const char*)>& callback) |
16 : num_bytes_(num_bytes), callback_(callback), current_num_bytes_(0) {} | 18 : num_bytes_(num_bytes), callback_(callback), current_num_bytes_(0) {} |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 MOJO_DEADLINE_INDEFINITE, | 118 MOJO_DEADLINE_INDEFINITE, |
117 base::Bind(&WebSocketReadQueue::OnHandleReady, base::Unretained(this))); | 119 base::Bind(&WebSocketReadQueue::OnHandleReady, base::Unretained(this))); |
118 } | 120 } |
119 | 121 |
120 void WebSocketReadQueue::OnHandleReady(MojoResult result) { | 122 void WebSocketReadQueue::OnHandleReady(MojoResult result) { |
121 DCHECK(is_busy_); | 123 DCHECK(is_busy_); |
122 TryToRead(); | 124 TryToRead(); |
123 } | 125 } |
124 | 126 |
125 } // namespace mojo | 127 } // namespace mojo |
OLD | NEW |