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

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

Issue 13009012: [SPDY] Refactor SpdySession's write queue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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 7
8 #include <list> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
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/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
17 #include "net/base/bandwidth_metrics.h" 17 #include "net/base/bandwidth_metrics.h"
18 #include "net/base/io_buffer.h" 18 #include "net/base/io_buffer.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // Returns true if the URL for this stream is known. 292 // Returns true if the URL for this stream is known.
293 bool HasUrl() const; 293 bool HasUrl() const;
294 294
295 // Get the URL associated with this stream. Only valid when has_url() is 295 // Get the URL associated with this stream. Only valid when has_url() is
296 // true. 296 // true.
297 GURL GetUrl() const; 297 GURL GetUrl() const;
298 298
299 int GetProtocolVersion() const; 299 int GetProtocolVersion() const;
300 300
301 private: 301 private:
302 class SpdyStreamIOBufferProducer; 302 class SpdyStreamFrameProducer;
303 303
304 enum State { 304 enum State {
305 STATE_NONE, 305 STATE_NONE,
306 STATE_GET_DOMAIN_BOUND_CERT, 306 STATE_GET_DOMAIN_BOUND_CERT,
307 STATE_GET_DOMAIN_BOUND_CERT_COMPLETE, 307 STATE_GET_DOMAIN_BOUND_CERT_COMPLETE,
308 STATE_SEND_DOMAIN_BOUND_CERT, 308 STATE_SEND_DOMAIN_BOUND_CERT,
309 STATE_SEND_DOMAIN_BOUND_CERT_COMPLETE, 309 STATE_SEND_DOMAIN_BOUND_CERT_COMPLETE,
310 STATE_SEND_HEADERS, 310 STATE_SEND_HEADERS,
311 STATE_SEND_HEADERS_COMPLETE, 311 STATE_SEND_HEADERS_COMPLETE,
312 STATE_SEND_BODY, 312 STATE_SEND_BODY,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // The time at which the request was made that resulted in this response. 394 // The time at which the request was made that resulted in this response.
395 // For cached responses, this time could be "far" in the past. 395 // For cached responses, this time could be "far" in the past.
396 base::Time request_time_; 396 base::Time request_time_;
397 397
398 scoped_ptr<SpdyHeaderBlock> response_; 398 scoped_ptr<SpdyHeaderBlock> response_;
399 base::Time response_time_; 399 base::Time response_time_;
400 400
401 // An in order list of pending frame data that are going to be sent. HEADERS 401 // An in order list of pending frame data that are going to be sent. HEADERS
402 // frames are queued as SpdyHeaderBlock structures because these must be 402 // frames are queued as SpdyHeaderBlock structures because these must be
403 // compressed just before sending. Data frames are queued as SpdyDataFrame. 403 // compressed just before sending. Data frames are queued as SpdyDataFrame.
404 std::list<PendingFrame> pending_frames_; 404 std::deque<PendingFrame> pending_frames_;
405 405
406 // An in order list of sending frame types. It will be used to know which type 406 // An in order list of sending frame types. It will be used to know which type
407 // of frame is sent and which callback should be invoked in OnOpen(). 407 // of frame is sent and which callback should be invoked in OnOpen().
408 std::list<FrameType> waiting_completions_; 408 std::deque<FrameType> waiting_completions_;
409 409
410 State io_state_; 410 State io_state_;
411 411
412 // Since we buffer the response, we also buffer the response status. 412 // Since we buffer the response, we also buffer the response status.
413 // Not valid until the stream is closed. 413 // Not valid until the stream is closed.
414 int response_status_; 414 int response_status_;
415 415
416 bool cancelled_; 416 bool cancelled_;
417 bool has_upload_data_; 417 bool has_upload_data_;
418 418
(...skipping 11 matching lines...) Expand all
430 std::string domain_bound_private_key_; 430 std::string domain_bound_private_key_;
431 std::string domain_bound_cert_; 431 std::string domain_bound_cert_;
432 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_; 432 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_;
433 433
434 DISALLOW_COPY_AND_ASSIGN(SpdyStream); 434 DISALLOW_COPY_AND_ASSIGN(SpdyStream);
435 }; 435 };
436 436
437 } // namespace net 437 } // namespace net
438 438
439 #endif // NET_SPDY_SPDY_STREAM_H_ 439 #endif // NET_SPDY_SPDY_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698