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

Side by Side Diff: net/spdy/spdy_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
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_STREAM_H_ 5 #ifndef NET_SPDY_SPDY_STREAM_H_
6 #define NET_SPDY_SPDY_STREAM_H_ 6 #define NET_SPDY_SPDY_STREAM_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 23 matching lines...) Expand all
34 class SSLInfo; 34 class SSLInfo;
35 35
36 // The SpdyStream is used by the SpdySession to represent each stream known 36 // The SpdyStream is used by the SpdySession to represent each stream known
37 // on the SpdySession. This class provides interfaces for SpdySession to use. 37 // on the SpdySession. This class provides interfaces for SpdySession to use.
38 // Streams can be created either by the client or by the server. When they 38 // Streams can be created either by the client or by the server. When they
39 // are initiated by the client, both the SpdySession and client object (such as 39 // are initiated by the client, both the SpdySession and client object (such as
40 // a SpdyNetworkTransaction) will maintain a reference to the stream. When 40 // a SpdyNetworkTransaction) will maintain a reference to the stream. When
41 // initiated by the server, only the SpdySession will maintain any reference, 41 // initiated by the server, only the SpdySession will maintain any reference,
42 // until such a time as a client object requests a stream for the path. 42 // until such a time as a client object requests a stream for the path.
43 class NET_EXPORT_PRIVATE SpdyStream 43 class NET_EXPORT_PRIVATE SpdyStream
44 : public base::RefCounted<SpdyStream>, 44 : public base::RefCounted<SpdyStream> {
45 public ChunkCallback {
46 public: 45 public:
47 // Delegate handles protocol specific behavior of spdy stream. 46 // Delegate handles protocol specific behavior of spdy stream.
48 class NET_EXPORT_PRIVATE Delegate { 47 class NET_EXPORT_PRIVATE Delegate {
49 public: 48 public:
50 Delegate() {} 49 Delegate() {}
51 50
52 // Called when SYN frame has been sent. 51 // Called when SYN frame has been sent.
53 // Returns true if no more data to be sent after SYN frame. 52 // Returns true if no more data to be sent after SYN frame.
54 virtual bool OnSendHeadersComplete(int status) = 0; 53 virtual bool OnSendHeadersComplete(int status) = 0;
55 54
(...skipping 19 matching lines...) Expand all
75 74
76 // Called when data is received. 75 // Called when data is received.
77 virtual void OnDataReceived(const char* data, int length) = 0; 76 virtual void OnDataReceived(const char* data, int length) = 0;
78 77
79 // Called when data is sent. 78 // Called when data is sent.
80 virtual void OnDataSent(int length) = 0; 79 virtual void OnDataSent(int length) = 0;
81 80
82 // Called when SpdyStream is closed. 81 // Called when SpdyStream is closed.
83 virtual void OnClose(int status) = 0; 82 virtual void OnClose(int status) = 0;
84 83
85 // Sets the callback to be invoked when a new chunk is available to upload.
86 virtual void set_chunk_callback(ChunkCallback* callback) = 0;
87
88 protected: 84 protected:
89 friend class base::RefCounted<Delegate>; 85 friend class base::RefCounted<Delegate>;
90 virtual ~Delegate() {} 86 virtual ~Delegate() {}
91 87
92 private: 88 private:
93 DISALLOW_COPY_AND_ASSIGN(Delegate); 89 DISALLOW_COPY_AND_ASSIGN(Delegate);
94 }; 90 };
95 91
96 // SpdyStream constructor 92 // SpdyStream constructor
97 SpdyStream(SpdySession* session, 93 SpdyStream(SpdySession* session,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 243
248 int response_status() const { return response_status_; } 244 int response_status() const { return response_status_; }
249 245
250 // Returns true if the URL for this stream is known. 246 // Returns true if the URL for this stream is known.
251 bool HasUrl() const; 247 bool HasUrl() const;
252 248
253 // Get the URL associated with this stream. Only valid when has_url() is 249 // Get the URL associated with this stream. Only valid when has_url() is
254 // true. 250 // true.
255 GURL GetUrl() const; 251 GURL GetUrl() const;
256 252
257 // ChunkCallback methods.
258 virtual void OnChunkAvailable() OVERRIDE;
259
260 int GetProtocolVersion() const; 253 int GetProtocolVersion() const;
261 254
262 private: 255 private:
263 enum State { 256 enum State {
264 STATE_NONE, 257 STATE_NONE,
265 STATE_GET_DOMAIN_BOUND_CERT, 258 STATE_GET_DOMAIN_BOUND_CERT,
266 STATE_GET_DOMAIN_BOUND_CERT_COMPLETE, 259 STATE_GET_DOMAIN_BOUND_CERT_COMPLETE,
267 STATE_SEND_DOMAIN_BOUND_CERT, 260 STATE_SEND_DOMAIN_BOUND_CERT,
268 STATE_SEND_DOMAIN_BOUND_CERT_COMPLETE, 261 STATE_SEND_DOMAIN_BOUND_CERT_COMPLETE,
269 STATE_SEND_HEADERS, 262 STATE_SEND_HEADERS,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 std::string domain_bound_private_key_; 359 std::string domain_bound_private_key_;
367 std::string domain_bound_cert_; 360 std::string domain_bound_cert_;
368 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_; 361 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_;
369 362
370 DISALLOW_COPY_AND_ASSIGN(SpdyStream); 363 DISALLOW_COPY_AND_ASSIGN(SpdyStream);
371 }; 364 };
372 365
373 } // namespace net 366 } // namespace net
374 367
375 #endif // NET_SPDY_SPDY_STREAM_H_ 368 #endif // NET_SPDY_SPDY_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698