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 #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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <memory> | 12 #include <memory> |
13 #include <string> | |
14 #include <vector> | 13 #include <vector> |
15 | 14 |
16 #include "base/macros.h" | 15 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
19 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
20 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
21 #include "net/base/request_priority.h" | 20 #include "net/base/request_priority.h" |
22 #include "net/log/net_log_source.h" | 21 #include "net/log/net_log_source.h" |
23 #include "net/log/net_log_with_source.h" | 22 #include "net/log/net_log_with_source.h" |
24 #include "net/socket/next_proto.h" | 23 #include "net/socket/next_proto.h" |
25 #include "net/socket/ssl_client_socket.h" | 24 #include "net/socket/ssl_client_socket.h" |
| 25 #include "net/spdy/platform/api/spdy_string.h" |
26 #include "net/spdy/spdy_buffer.h" | 26 #include "net/spdy/spdy_buffer.h" |
27 #include "net/spdy/spdy_framer.h" | 27 #include "net/spdy/spdy_framer.h" |
28 #include "net/spdy/spdy_header_block.h" | 28 #include "net/spdy/spdy_header_block.h" |
29 #include "net/spdy/spdy_protocol.h" | 29 #include "net/spdy/spdy_protocol.h" |
30 #include "net/ssl/ssl_client_cert_type.h" | 30 #include "net/ssl/ssl_client_cert_type.h" |
31 #include "url/gurl.h" | 31 #include "url/gurl.h" |
32 | 32 |
33 namespace net { | 33 namespace net { |
34 | 34 |
35 class IPEndPoint; | 35 class IPEndPoint; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 // Called by the SpdySession when the request is finished. This callback | 283 // Called by the SpdySession when the request is finished. This callback |
284 // will always be called at the end of the request and signals to the | 284 // will always be called at the end of the request and signals to the |
285 // stream that the stream has no more network events. No further callbacks | 285 // stream that the stream has no more network events. No further callbacks |
286 // to the stream will be made after this call. Must be called before | 286 // to the stream will be made after this call. Must be called before |
287 // SpdyStream is destroyed. | 287 // SpdyStream is destroyed. |
288 // |status| is an error code or OK. | 288 // |status| is an error code or OK. |
289 void OnClose(int status); | 289 void OnClose(int status); |
290 | 290 |
291 // Called by the SpdySession to log stream related errors. | 291 // Called by the SpdySession to log stream related errors. |
292 void LogStreamError(int status, const std::string& description); | 292 void LogStreamError(int status, const SpdyString& description); |
293 | 293 |
294 // If this stream is active, reset it, and close it otherwise. In | 294 // If this stream is active, reset it, and close it otherwise. In |
295 // either case the stream is deleted. | 295 // either case the stream is deleted. |
296 void Cancel(); | 296 void Cancel(); |
297 | 297 |
298 // Close this stream without sending a RST_STREAM and delete | 298 // Close this stream without sending a RST_STREAM and delete |
299 // it. | 299 // it. |
300 void Close(); | 300 void Close(); |
301 | 301 |
302 // Must be used only by |session_|. | 302 // Must be used only by |session_|. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 // Queues the send for next frame of the remaining data in | 429 // Queues the send for next frame of the remaining data in |
430 // |pending_send_data_|. Must be called only when | 430 // |pending_send_data_|. Must be called only when |
431 // |pending_send_data_| is set. | 431 // |pending_send_data_| is set. |
432 void QueueNextDataFrame(); | 432 void QueueNextDataFrame(); |
433 | 433 |
434 // Saves the given headers into |response_headers_| and calls | 434 // Saves the given headers into |response_headers_| and calls |
435 // OnHeadersReceived() on the delegate if attached. | 435 // OnHeadersReceived() on the delegate if attached. |
436 void SaveResponseHeaders(const SpdyHeaderBlock& response_headers); | 436 void SaveResponseHeaders(const SpdyHeaderBlock& response_headers); |
437 | 437 |
438 static std::string DescribeState(State state); | 438 static SpdyString DescribeState(State state); |
439 | 439 |
440 const SpdyStreamType type_; | 440 const SpdyStreamType type_; |
441 | 441 |
442 SpdyStreamId stream_id_; | 442 SpdyStreamId stream_id_; |
443 const GURL url_; | 443 const GURL url_; |
444 RequestPriority priority_; | 444 RequestPriority priority_; |
445 | 445 |
446 bool send_stalled_by_flow_control_; | 446 bool send_stalled_by_flow_control_; |
447 | 447 |
448 // Current send window size. | 448 // Current send window size. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 bool write_handler_guard_; | 524 bool write_handler_guard_; |
525 | 525 |
526 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; | 526 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; |
527 | 527 |
528 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 528 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
529 }; | 529 }; |
530 | 530 |
531 } // namespace net | 531 } // namespace net |
532 | 532 |
533 #endif // NET_SPDY_SPDY_STREAM_H_ | 533 #endif // NET_SPDY_SPDY_STREAM_H_ |
OLD | NEW |