| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 SPDY_ERROR_INVALID_PADDING = 39, | 110 SPDY_ERROR_INVALID_PADDING = 39, |
| 111 SPDY_ERROR_INVALID_DATA_FRAME_FLAGS = 8, | 111 SPDY_ERROR_INVALID_DATA_FRAME_FLAGS = 8, |
| 112 SPDY_ERROR_INVALID_CONTROL_FRAME_FLAGS = 9, | 112 SPDY_ERROR_INVALID_CONTROL_FRAME_FLAGS = 9, |
| 113 SPDY_ERROR_UNEXPECTED_FRAME = 31, | 113 SPDY_ERROR_UNEXPECTED_FRAME = 31, |
| 114 SPDY_ERROR_INTERNAL_FRAMER_ERROR = 41, | 114 SPDY_ERROR_INTERNAL_FRAMER_ERROR = 41, |
| 115 SPDY_ERROR_INVALID_CONTROL_FRAME_SIZE = 37, | 115 SPDY_ERROR_INVALID_CONTROL_FRAME_SIZE = 37, |
| 116 SPDY_ERROR_OVERSIZED_PAYLOAD = 40, | 116 SPDY_ERROR_OVERSIZED_PAYLOAD = 40, |
| 117 // SpdyRstStreamStatus mappings. | 117 // SpdyRstStreamStatus mappings. |
| 118 STATUS_CODE_NO_ERROR = 41, | 118 STATUS_CODE_NO_ERROR = 41, |
| 119 STATUS_CODE_PROTOCOL_ERROR = 11, | 119 STATUS_CODE_PROTOCOL_ERROR = 11, |
| 120 STATUS_CODE_INVALID_STREAM = 12, | |
| 121 STATUS_CODE_REFUSED_STREAM = 13, | |
| 122 STATUS_CODE_UNSUPPORTED_VERSION = 14, | |
| 123 STATUS_CODE_CANCEL = 15, | |
| 124 STATUS_CODE_INTERNAL_ERROR = 16, | 120 STATUS_CODE_INTERNAL_ERROR = 16, |
| 125 STATUS_CODE_FLOW_CONTROL_ERROR = 17, | 121 STATUS_CODE_FLOW_CONTROL_ERROR = 17, |
| 126 STATUS_CODE_STREAM_IN_USE = 18, | 122 STATUS_CODE_SETTINGS_TIMEOUT = 32, |
| 127 STATUS_CODE_STREAM_ALREADY_CLOSED = 19, | 123 STATUS_CODE_STREAM_CLOSED = 12, |
| 128 STATUS_CODE_FRAME_SIZE_ERROR = 21, | 124 STATUS_CODE_FRAME_SIZE_ERROR = 21, |
| 129 STATUS_CODE_SETTINGS_TIMEOUT = 32, | 125 STATUS_CODE_REFUSED_STREAM = 13, |
| 126 STATUS_CODE_CANCEL = 15, |
| 127 STATUS_CODE_COMPRESSION_ERROR = 42, |
| 130 STATUS_CODE_CONNECT_ERROR = 33, | 128 STATUS_CODE_CONNECT_ERROR = 33, |
| 131 STATUS_CODE_ENHANCE_YOUR_CALM = 34, | 129 STATUS_CODE_ENHANCE_YOUR_CALM = 34, |
| 132 STATUS_CODE_INADEQUATE_SECURITY = 35, | 130 STATUS_CODE_INADEQUATE_SECURITY = 35, |
| 133 STATUS_CODE_HTTP_1_1_REQUIRED = 36, | 131 STATUS_CODE_HTTP_1_1_REQUIRED = 36, |
| 132 // Deprecated SpdyRstStrreamStatus mappings. |
| 133 STATUS_CODE_UNSUPPORTED_VERSION = 14, |
| 134 STATUS_CODE_STREAM_IN_USE = 18, |
| 135 STATUS_CODE_STREAM_ALREADY_CLOSED = 19, |
| 134 | 136 |
| 135 // SpdySession errors | 137 // SpdySession errors |
| 136 PROTOCOL_ERROR_UNEXPECTED_PING = 22, | 138 PROTOCOL_ERROR_UNEXPECTED_PING = 22, |
| 137 PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM = 23, | 139 PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM = 23, |
| 138 PROTOCOL_ERROR_SPDY_COMPRESSION_FAILURE = 24, | 140 PROTOCOL_ERROR_SPDY_COMPRESSION_FAILURE = 24, |
| 139 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION = 25, | 141 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION = 25, |
| 140 PROTOCOL_ERROR_SYN_REPLY_NOT_RECEIVED = 26, | 142 PROTOCOL_ERROR_SYN_REPLY_NOT_RECEIVED = 26, |
| 141 PROTOCOL_ERROR_INVALID_WINDOW_UPDATE_SIZE = 27, | 143 PROTOCOL_ERROR_INVALID_WINDOW_UPDATE_SIZE = 27, |
| 142 PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, | 144 PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, |
| 143 | 145 |
| 144 // Next free value. | 146 // Next free value. |
| 145 NUM_SPDY_PROTOCOL_ERROR_DETAILS = 42, | 147 NUM_SPDY_PROTOCOL_ERROR_DETAILS = 43, |
| 146 }; | 148 }; |
| 147 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE | 149 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE |
| 148 MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); | 150 MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); |
| 149 Error NET_EXPORT_PRIVATE MapFramerErrorToNetError(SpdyFramer::SpdyError error); | 151 Error NET_EXPORT_PRIVATE MapFramerErrorToNetError(SpdyFramer::SpdyError error); |
| 150 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE | 152 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE |
| 151 MapRstStreamStatusToProtocolError(SpdyRstStreamStatus status); | 153 MapRstStreamStatusToProtocolError(SpdyRstStreamStatus status); |
| 152 SpdyGoAwayStatus NET_EXPORT_PRIVATE MapNetErrorToGoAwayStatus(Error err); | 154 SpdyGoAwayStatus NET_EXPORT_PRIVATE MapNetErrorToGoAwayStatus(Error err); |
| 153 | 155 |
| 154 // If these compile asserts fail then SpdyProtocolErrorDetails needs | 156 // If these compile asserts fail then SpdyProtocolErrorDetails needs |
| 155 // to be updated with new values, as do the mapping functions above. | 157 // to be updated with new values, as do the mapping functions above. |
| 156 static_assert(17 == SpdyFramer::LAST_ERROR, | 158 static_assert(17 == SpdyFramer::LAST_ERROR, |
| 157 "SpdyProtocolErrorDetails / Spdy Errors mismatch"); | 159 "SpdyProtocolErrorDetails / Spdy Errors mismatch"); |
| 158 static_assert(17 == RST_STREAM_NUM_STATUS_CODES, | 160 static_assert(14 == RST_STREAM_NUM_STATUS_CODES, |
| 159 "SpdyProtocolErrorDetails / RstStreamStatus mismatch"); | 161 "SpdyProtocolErrorDetails / RstStreamStatus mismatch"); |
| 160 | 162 |
| 161 // A helper class used to manage a request to create a stream. | 163 // A helper class used to manage a request to create a stream. |
| 162 class NET_EXPORT_PRIVATE SpdyStreamRequest { | 164 class NET_EXPORT_PRIVATE SpdyStreamRequest { |
| 163 public: | 165 public: |
| 164 SpdyStreamRequest(); | 166 SpdyStreamRequest(); |
| 165 // Calls CancelRequest(). | 167 // Calls CancelRequest(). |
| 166 ~SpdyStreamRequest(); | 168 ~SpdyStreamRequest(); |
| 167 | 169 |
| 168 // Starts the request to create a stream. If OK is returned, then | 170 // Starts the request to create a stream. If OK is returned, then |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 // Used for posting asynchronous IO tasks. We use this even though | 1214 // Used for posting asynchronous IO tasks. We use this even though |
| 1213 // SpdySession is refcounted because we don't need to keep the SpdySession | 1215 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1214 // alive if the last reference is within a RunnableMethod. Just revoke the | 1216 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1215 // method. | 1217 // method. |
| 1216 base::WeakPtrFactory<SpdySession> weak_factory_; | 1218 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1217 }; | 1219 }; |
| 1218 | 1220 |
| 1219 } // namespace net | 1221 } // namespace net |
| 1220 | 1222 |
| 1221 #endif // NET_SPDY_SPDY_SESSION_H_ | 1223 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |