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

Side by Side Diff: net/spdy/spdy_http_stream.h

Issue 10689034: SPDY - chunked upload - speech recognition doesn't work with SPDY/3 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/base/upload_data_stream.cc ('k') | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_ 5 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_
6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "net/base/completion_callback.h" 15 #include "net/base/completion_callback.h"
16 #include "net/base/net_log.h" 16 #include "net/base/net_log.h"
17 #include "net/base/upload_data.h"
17 #include "net/http/http_request_info.h" 18 #include "net/http/http_request_info.h"
18 #include "net/http/http_stream.h" 19 #include "net/http/http_stream.h"
19 #include "net/spdy/spdy_protocol.h" 20 #include "net/spdy/spdy_protocol.h"
20 #include "net/spdy/spdy_session.h" 21 #include "net/spdy/spdy_session.h"
21 #include "net/spdy/spdy_stream.h" 22 #include "net/spdy/spdy_stream.h"
22 23
23 namespace net { 24 namespace net {
24 25
25 class DrainableIOBuffer; 26 class DrainableIOBuffer;
26 class HttpResponseInfo; 27 class HttpResponseInfo;
27 class IOBuffer; 28 class IOBuffer;
28 class SpdySession; 29 class SpdySession;
29 class UploadData; 30 class UploadData;
30 class UploadDataStream; 31 class UploadDataStream;
31 32
32 // The SpdyHttpStream is a HTTP-specific type of stream known to a SpdySession. 33 // The SpdyHttpStream is a HTTP-specific type of stream known to a SpdySession.
33 class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate, 34 class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate,
34 public HttpStream { 35 public HttpStream,
36 public ChunkCallback {
35 public: 37 public:
36 SpdyHttpStream(SpdySession* spdy_session, bool direct); 38 SpdyHttpStream(SpdySession* spdy_session, bool direct);
37 virtual ~SpdyHttpStream(); 39 virtual ~SpdyHttpStream();
38 40
39 // Initializes this SpdyHttpStream by wrapping an existing SpdyStream. 41 // Initializes this SpdyHttpStream by wrapping an existing SpdyStream.
40 void InitializeWithExistingStream(SpdyStream* spdy_stream); 42 void InitializeWithExistingStream(SpdyStream* spdy_stream);
41 43
42 SpdyStream* stream() { return stream_.get(); } 44 SpdyStream* stream() { return stream_.get(); }
43 45
44 // Cancels any callbacks from being invoked and deletes the stream. 46 // Cancels any callbacks from being invoked and deletes the stream.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // SpdyStream::Delegate implementation. 78 // SpdyStream::Delegate implementation.
77 virtual bool OnSendHeadersComplete(int status) OVERRIDE; 79 virtual bool OnSendHeadersComplete(int status) OVERRIDE;
78 virtual int OnSendBody() OVERRIDE; 80 virtual int OnSendBody() OVERRIDE;
79 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; 81 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE;
80 virtual int OnResponseReceived(const SpdyHeaderBlock& response, 82 virtual int OnResponseReceived(const SpdyHeaderBlock& response,
81 base::Time response_time, 83 base::Time response_time,
82 int status) OVERRIDE; 84 int status) OVERRIDE;
83 virtual void OnDataReceived(const char* buffer, int bytes) OVERRIDE; 85 virtual void OnDataReceived(const char* buffer, int bytes) OVERRIDE;
84 virtual void OnDataSent(int length) OVERRIDE; 86 virtual void OnDataSent(int length) OVERRIDE;
85 virtual void OnClose(int status) OVERRIDE; 87 virtual void OnClose(int status) OVERRIDE;
86 virtual void set_chunk_callback(ChunkCallback* callback) OVERRIDE; 88
89 // ChunkCallback implementation.
90 virtual void OnChunkAvailable() OVERRIDE;
87 91
88 private: 92 private:
89 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy2Test, 93 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy2Test,
90 FlowControlStallResume); 94 FlowControlStallResume);
91 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, 95 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test,
92 FlowControlStallResume); 96 FlowControlStallResume);
93 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, 97 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test,
94 FlowControlStallResumeAfterSettings); 98 FlowControlStallResumeAfterSettings);
95 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, 99 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test,
96 FlowControlNegativeSendWindowSize); 100 FlowControlNegativeSendWindowSize);
97 101
102 // Reads the data (whether chunked or not) from the request body stream and
103 // sends the data by calling WriteStreamData on the underlying SpdyStream.
104 // This method always returns ERR_IO_PENDING.
Ryan Hamilton 2012/07/11 22:51:15 nit: please remove this final sentence
ramant (doing other things) 2012/07/11 23:00:21 Done.
105 int SendData();
106
98 // Call the user callback. 107 // Call the user callback.
99 void DoCallback(int rv); 108 void DoCallback(int rv);
100 109
101 void ScheduleBufferedReadCallback(); 110 void ScheduleBufferedReadCallback();
102 111
103 // Returns true if the callback is invoked. 112 // Returns true if the callback is invoked.
104 bool DoBufferedReadCallback(); 113 bool DoBufferedReadCallback();
105 bool ShouldWaitForMoreBufferedData() const; 114 bool ShouldWaitForMoreBufferedData() const;
106 115
107 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; 116 base::WeakPtrFactory<SpdyHttpStream> weak_factory_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 149
141 // Is there a scheduled read callback pending. 150 // Is there a scheduled read callback pending.
142 bool buffered_read_callback_pending_; 151 bool buffered_read_callback_pending_;
143 // Has more data been received from the network during the wait for the 152 // Has more data been received from the network during the wait for the
144 // scheduled read callback. 153 // scheduled read callback.
145 bool more_read_data_pending_; 154 bool more_read_data_pending_;
146 155
147 // Is this spdy stream direct to the origin server (or to a proxy). 156 // Is this spdy stream direct to the origin server (or to a proxy).
148 bool direct_; 157 bool direct_;
149 158
159 // Is the connection stalled waiting for an upload data chunk.
160 bool waiting_for_chunk_;
161
150 bool send_last_chunk_; 162 bool send_last_chunk_;
151 163
152 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); 164 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream);
153 }; 165 };
154 166
155 } // namespace net 167 } // namespace net
156 168
157 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ 169 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_
OLDNEW
« no previous file with comments | « net/base/upload_data_stream.cc ('k') | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698