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

Side by Side Diff: net/quic/chromium/quic_chromium_client_stream.h

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 years, 9 months 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 unified diff | Download patch
OLDNEW
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_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ 7 #ifndef NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_
8 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ 8 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
11 11
12 #include <deque> 12 #include <deque>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback_forward.h" 15 #include "base/callback_forward.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "net/base/ip_endpoint.h" 17 #include "net/base/ip_endpoint.h"
18 #include "net/base/net_export.h" 18 #include "net/base/net_export.h"
19 #include "net/base/upload_data_stream.h" 19 #include "net/base/upload_data_stream.h"
20 #include "net/http/http_request_info.h" 20 #include "net/http/http_request_info.h"
21 #include "net/http/http_response_info.h" 21 #include "net/http/http_response_info.h"
22 #include "net/http/http_stream.h" 22 #include "net/http/http_stream.h"
23 #include "net/log/net_log_with_source.h" 23 #include "net/log/net_log_with_source.h"
24 #include "net/quic/core/quic_spdy_stream.h" 24 #include "net/quic/core/quic_spdy_stream.h"
25 #include "net/quic/platform/api/quic_string_piece.h"
25 26
26 namespace net { 27 namespace net {
27 28
28 class QuicClientSessionBase; 29 class QuicClientSessionBase;
29 30
30 // A client-initiated ReliableQuicStream. Instances of this class 31 // A client-initiated ReliableQuicStream. Instances of this class
31 // are owned by the QuicClientSession which created them. 32 // are owned by the QuicClientSession which created them.
32 class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { 33 class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream {
33 public: 34 public:
34 // Delegate handles protocol specific behavior of a quic stream. 35 // Delegate handles protocol specific behavior of a quic stream.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 size_t WriteHeaders(SpdyHeaderBlock header_block, 82 size_t WriteHeaders(SpdyHeaderBlock header_block,
82 bool fin, 83 bool fin,
83 QuicReferenceCountedPointer<QuicAckListenerInterface> 84 QuicReferenceCountedPointer<QuicAckListenerInterface>
84 ack_listener) override; 85 ack_listener) override;
85 SpdyPriority priority() const override; 86 SpdyPriority priority() const override;
86 87
87 // While the server's set_priority shouldn't be called externally, the creator 88 // While the server's set_priority shouldn't be called externally, the creator
88 // of client-side streams should be able to set the priority. 89 // of client-side streams should be able to set the priority.
89 using QuicSpdyStream::SetPriority; 90 using QuicSpdyStream::SetPriority;
90 91
91 int WriteStreamData(base::StringPiece data, 92 int WriteStreamData(QuicStringPiece data,
92 bool fin, 93 bool fin,
93 const CompletionCallback& callback); 94 const CompletionCallback& callback);
94 // Same as WriteStreamData except it writes data from a vector of IOBuffers, 95 // Same as WriteStreamData except it writes data from a vector of IOBuffers,
95 // with the length of each buffer at the corresponding index in |lengths|. 96 // with the length of each buffer at the corresponding index in |lengths|.
96 int WritevStreamData(const std::vector<scoped_refptr<IOBuffer>>& buffers, 97 int WritevStreamData(const std::vector<scoped_refptr<IOBuffer>>& buffers,
97 const std::vector<int>& lengths, 98 const std::vector<int>& lengths,
98 bool fin, 99 bool fin,
99 const CompletionCallback& callback); 100 const CompletionCallback& callback);
100 // Set new |delegate|. |delegate| must not be NULL. 101 // Set new |delegate|. |delegate| must not be NULL.
101 // If this stream has already received data, OnDataReceived() will be 102 // If this stream has already received data, OnDataReceived() will be
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 std::deque<base::Closure> delegate_tasks_; 153 std::deque<base::Closure> delegate_tasks_;
153 154
154 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; 155 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_;
155 156
156 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); 157 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream);
157 }; 158 };
158 159
159 } // namespace net 160 } // namespace net
160 161
161 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ 162 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session_test.cc ('k') | net/quic/chromium/quic_chromium_client_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698