| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // NOTE: This code is not shared between Google and Chrome. | 5 // NOTE: This code is not shared between Google and Chrome. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 7 #ifndef NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
| 8 #define NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 8 #define NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 15 #include "net/base/upload_data_stream.h" | 16 #include "net/base/upload_data_stream.h" |
| 16 #include "net/http/http_request_info.h" | 17 #include "net/http/http_request_info.h" |
| 17 #include "net/http/http_response_info.h" | 18 #include "net/http/http_response_info.h" |
| 18 #include "net/http/http_stream.h" | 19 #include "net/http/http_stream.h" |
| 19 #include "net/quic/quic_spdy_stream.h" | 20 #include "net/quic/quic_spdy_stream.h" |
| 20 | 21 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 QuicAckListenerInterface* ack_notifier_delegate) override; | 73 QuicAckListenerInterface* ack_notifier_delegate) override; |
| 73 SpdyPriority priority() const override; | 74 SpdyPriority priority() const override; |
| 74 | 75 |
| 75 // While the server's set_priority shouldn't be called externally, the creator | 76 // While the server's set_priority shouldn't be called externally, the creator |
| 76 // of client-side streams should be able to set the priority. | 77 // of client-side streams should be able to set the priority. |
| 77 using QuicSpdyStream::SetPriority; | 78 using QuicSpdyStream::SetPriority; |
| 78 | 79 |
| 79 int WriteStreamData(base::StringPiece data, | 80 int WriteStreamData(base::StringPiece data, |
| 80 bool fin, | 81 bool fin, |
| 81 const CompletionCallback& callback); | 82 const CompletionCallback& callback); |
| 83 // Same as WriteStreamData except it writes data from a vector of IOBuffers, |
| 84 // with the length of each buffer at the corresponding index in |lengths|. |
| 85 int WritevStreamData(const std::vector<IOBuffer*>& buffers, |
| 86 const std::vector<int>& lengths, |
| 87 bool fin, |
| 88 const CompletionCallback& callback); |
| 82 // Set new |delegate|. |delegate| must not be NULL. | 89 // Set new |delegate|. |delegate| must not be NULL. |
| 83 // If this stream has already received data, OnDataReceived() will be | 90 // If this stream has already received data, OnDataReceived() will be |
| 84 // called on the delegate. | 91 // called on the delegate. |
| 85 void SetDelegate(Delegate* delegate); | 92 void SetDelegate(Delegate* delegate); |
| 86 Delegate* GetDelegate() { return delegate_; } | 93 Delegate* GetDelegate() { return delegate_; } |
| 87 void OnError(int error); | 94 void OnError(int error); |
| 88 | 95 |
| 89 // Reads at most |buf_len| bytes into |buf|. Returns the number of bytes read. | 96 // Reads at most |buf_len| bytes into |buf|. Returns the number of bytes read. |
| 90 int Read(IOBuffer* buf, int buf_len); | 97 int Read(IOBuffer* buf, int buf_len); |
| 91 | 98 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 std::deque<base::Closure> delegate_tasks_; | 137 std::deque<base::Closure> delegate_tasks_; |
| 131 | 138 |
| 132 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; | 139 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; |
| 133 | 140 |
| 134 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); | 141 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); |
| 135 }; | 142 }; |
| 136 | 143 |
| 137 } // namespace net | 144 } // namespace net |
| 138 | 145 |
| 139 #endif // NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 146 #endif // NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
| OLD | NEW |