| 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_SESSION_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_H_ |
| 6 #define NET_SPDY_SPDY_SESSION_H_ | 6 #define NET_SPDY_SPDY_SESSION_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 STATUS_CODE_CANCEL = 15, | 98 STATUS_CODE_CANCEL = 15, |
| 99 STATUS_CODE_INTERNAL_ERROR = 16, | 99 STATUS_CODE_INTERNAL_ERROR = 16, |
| 100 STATUS_CODE_FLOW_CONTROL_ERROR = 17, | 100 STATUS_CODE_FLOW_CONTROL_ERROR = 17, |
| 101 STATUS_CODE_STREAM_IN_USE = 18, | 101 STATUS_CODE_STREAM_IN_USE = 18, |
| 102 STATUS_CODE_STREAM_ALREADY_CLOSED = 19, | 102 STATUS_CODE_STREAM_ALREADY_CLOSED = 19, |
| 103 STATUS_CODE_INVALID_CREDENTIALS = 20, | 103 STATUS_CODE_INVALID_CREDENTIALS = 20, |
| 104 STATUS_CODE_FRAME_SIZE_ERROR = 21, | 104 STATUS_CODE_FRAME_SIZE_ERROR = 21, |
| 105 STATUS_CODE_SETTINGS_TIMEOUT = 32, | 105 STATUS_CODE_SETTINGS_TIMEOUT = 32, |
| 106 STATUS_CODE_CONNECT_ERROR = 33, | 106 STATUS_CODE_CONNECT_ERROR = 33, |
| 107 STATUS_CODE_ENHANCE_YOUR_CALM = 34, | 107 STATUS_CODE_ENHANCE_YOUR_CALM = 34, |
| 108 STATUS_CODE_INADEQUATE_SECURITY = 35, |
| 109 STATUS_CODE_HTTP_1_1_REQUIRED = 36, |
| 108 | 110 |
| 109 // SpdySession errors | 111 // SpdySession errors |
| 110 PROTOCOL_ERROR_UNEXPECTED_PING = 22, | 112 PROTOCOL_ERROR_UNEXPECTED_PING = 22, |
| 111 PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM = 23, | 113 PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM = 23, |
| 112 PROTOCOL_ERROR_SPDY_COMPRESSION_FAILURE = 24, | 114 PROTOCOL_ERROR_SPDY_COMPRESSION_FAILURE = 24, |
| 113 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION = 25, | 115 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION = 25, |
| 114 PROTOCOL_ERROR_SYN_REPLY_NOT_RECEIVED = 26, | 116 PROTOCOL_ERROR_SYN_REPLY_NOT_RECEIVED = 26, |
| 115 PROTOCOL_ERROR_INVALID_WINDOW_UPDATE_SIZE = 27, | 117 PROTOCOL_ERROR_INVALID_WINDOW_UPDATE_SIZE = 27, |
| 116 PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, | 118 PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, |
| 117 | 119 |
| 118 // Next free value. | 120 // Next free value. |
| 119 NUM_SPDY_PROTOCOL_ERROR_DETAILS = 35, | 121 NUM_SPDY_PROTOCOL_ERROR_DETAILS = 37, |
| 120 }; | 122 }; |
| 121 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE | 123 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE |
| 122 MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); | 124 MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); |
| 123 Error NET_EXPORT_PRIVATE MapFramerErrorToNetError(SpdyFramer::SpdyError error); | 125 Error NET_EXPORT_PRIVATE MapFramerErrorToNetError(SpdyFramer::SpdyError error); |
| 124 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE | 126 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE |
| 125 MapRstStreamStatusToProtocolError(SpdyRstStreamStatus status); | 127 MapRstStreamStatusToProtocolError(SpdyRstStreamStatus status); |
| 126 SpdyGoAwayStatus NET_EXPORT_PRIVATE MapNetErrorToGoAwayStatus(Error err); | 128 SpdyGoAwayStatus NET_EXPORT_PRIVATE MapNetErrorToGoAwayStatus(Error err); |
| 127 | 129 |
| 128 // If these compile asserts fail then SpdyProtocolErrorDetails needs | 130 // If these compile asserts fail then SpdyProtocolErrorDetails needs |
| 129 // to be updated with new values, as do the mapping functions above. | 131 // to be updated with new values, as do the mapping functions above. |
| 130 COMPILE_ASSERT(12 == SpdyFramer::LAST_ERROR, | 132 COMPILE_ASSERT(12 == SpdyFramer::LAST_ERROR, |
| 131 SpdyProtocolErrorDetails_SpdyErrors_mismatch); | 133 SpdyProtocolErrorDetails_SpdyErrors_mismatch); |
| 132 COMPILE_ASSERT(15 == RST_STREAM_NUM_STATUS_CODES, | 134 COMPILE_ASSERT(17 == RST_STREAM_NUM_STATUS_CODES, |
| 133 SpdyProtocolErrorDetails_RstStreamStatus_mismatch); | 135 SpdyProtocolErrorDetails_RstStreamStatus_mismatch); |
| 134 | 136 |
| 135 // Splits pushed |headers| into request and response parts. Request headers are | 137 // Splits pushed |headers| into request and response parts. Request headers are |
| 136 // the headers specifying resource URL. | 138 // the headers specifying resource URL. |
| 137 void NET_EXPORT_PRIVATE | 139 void NET_EXPORT_PRIVATE |
| 138 SplitPushedHeadersToRequestAndResponse(const SpdyHeaderBlock& headers, | 140 SplitPushedHeadersToRequestAndResponse(const SpdyHeaderBlock& headers, |
| 139 SpdyMajorVersion protocol_version, | 141 SpdyMajorVersion protocol_version, |
| 140 SpdyHeaderBlock* request_headers, | 142 SpdyHeaderBlock* request_headers, |
| 141 SpdyHeaderBlock* response_headers); | 143 SpdyHeaderBlock* response_headers); |
| 142 | 144 |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 void OnSynStream(SpdyStreamId stream_id, | 839 void OnSynStream(SpdyStreamId stream_id, |
| 838 SpdyStreamId associated_stream_id, | 840 SpdyStreamId associated_stream_id, |
| 839 SpdyPriority priority, | 841 SpdyPriority priority, |
| 840 bool fin, | 842 bool fin, |
| 841 bool unidirectional, | 843 bool unidirectional, |
| 842 const SpdyHeaderBlock& headers) override; | 844 const SpdyHeaderBlock& headers) override; |
| 843 void OnSynReply(SpdyStreamId stream_id, | 845 void OnSynReply(SpdyStreamId stream_id, |
| 844 bool fin, | 846 bool fin, |
| 845 const SpdyHeaderBlock& headers) override; | 847 const SpdyHeaderBlock& headers) override; |
| 846 void OnHeaders(SpdyStreamId stream_id, | 848 void OnHeaders(SpdyStreamId stream_id, |
| 849 bool has_priority, |
| 850 SpdyPriority priority, |
| 847 bool fin, | 851 bool fin, |
| 848 const SpdyHeaderBlock& headers) override; | 852 const SpdyHeaderBlock& headers) override; |
| 849 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override; | 853 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override; |
| 850 | 854 |
| 851 // SpdyFramerDebugVisitorInterface | 855 // SpdyFramerDebugVisitorInterface |
| 852 void OnSendCompressedFrame(SpdyStreamId stream_id, | 856 void OnSendCompressedFrame(SpdyStreamId stream_id, |
| 853 SpdyFrameType type, | 857 SpdyFrameType type, |
| 854 size_t payload_len, | 858 size_t payload_len, |
| 855 size_t frame_len) override; | 859 size_t frame_len) override; |
| 856 void OnReceiveCompressedFrame(SpdyStreamId stream_id, | 860 void OnReceiveCompressedFrame(SpdyStreamId stream_id, |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 // Used for posting asynchronous IO tasks. We use this even though | 1171 // Used for posting asynchronous IO tasks. We use this even though |
| 1168 // SpdySession is refcounted because we don't need to keep the SpdySession | 1172 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1169 // alive if the last reference is within a RunnableMethod. Just revoke the | 1173 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1170 // method. | 1174 // method. |
| 1171 base::WeakPtrFactory<SpdySession> weak_factory_; | 1175 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1172 }; | 1176 }; |
| 1173 | 1177 |
| 1174 } // namespace net | 1178 } // namespace net |
| 1175 | 1179 |
| 1176 #endif // NET_SPDY_SPDY_SESSION_H_ | 1180 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |