| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 STATUS_CODE_INTERNAL_ERROR = 16, | 122 STATUS_CODE_INTERNAL_ERROR = 16, |
| 123 STATUS_CODE_FLOW_CONTROL_ERROR = 17, | 123 STATUS_CODE_FLOW_CONTROL_ERROR = 17, |
| 124 STATUS_CODE_STREAM_IN_USE = 18, | 124 STATUS_CODE_STREAM_IN_USE = 18, |
| 125 STATUS_CODE_STREAM_ALREADY_CLOSED = 19, | 125 STATUS_CODE_STREAM_ALREADY_CLOSED = 19, |
| 126 STATUS_CODE_FRAME_SIZE_ERROR = 21, | 126 STATUS_CODE_FRAME_SIZE_ERROR = 21, |
| 127 STATUS_CODE_SETTINGS_TIMEOUT = 32, | 127 STATUS_CODE_SETTINGS_TIMEOUT = 32, |
| 128 STATUS_CODE_CONNECT_ERROR = 33, | 128 STATUS_CODE_CONNECT_ERROR = 33, |
| 129 STATUS_CODE_ENHANCE_YOUR_CALM = 34, | 129 STATUS_CODE_ENHANCE_YOUR_CALM = 34, |
| 130 STATUS_CODE_INADEQUATE_SECURITY = 35, | 130 STATUS_CODE_INADEQUATE_SECURITY = 35, |
| 131 STATUS_CODE_HTTP_1_1_REQUIRED = 36, | 131 STATUS_CODE_HTTP_1_1_REQUIRED = 36, |
| 132 STATUS_CODE_NO_ERROR = 41, |
| 132 | 133 |
| 133 // SpdySession errors | 134 // SpdySession errors |
| 134 PROTOCOL_ERROR_UNEXPECTED_PING = 22, | 135 PROTOCOL_ERROR_UNEXPECTED_PING = 22, |
| 135 PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM = 23, | 136 PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM = 23, |
| 136 PROTOCOL_ERROR_SPDY_COMPRESSION_FAILURE = 24, | 137 PROTOCOL_ERROR_SPDY_COMPRESSION_FAILURE = 24, |
| 137 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION = 25, | 138 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION = 25, |
| 138 PROTOCOL_ERROR_SYN_REPLY_NOT_RECEIVED = 26, | 139 PROTOCOL_ERROR_SYN_REPLY_NOT_RECEIVED = 26, |
| 139 PROTOCOL_ERROR_INVALID_WINDOW_UPDATE_SIZE = 27, | 140 PROTOCOL_ERROR_INVALID_WINDOW_UPDATE_SIZE = 27, |
| 140 PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, | 141 PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, |
| 141 | 142 |
| 142 // Next free value. | 143 // Next free value. |
| 143 NUM_SPDY_PROTOCOL_ERROR_DETAILS = 41, | 144 NUM_SPDY_PROTOCOL_ERROR_DETAILS = 42, |
| 144 }; | 145 }; |
| 145 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE | 146 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE |
| 146 MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); | 147 MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); |
| 147 Error NET_EXPORT_PRIVATE MapFramerErrorToNetError(SpdyFramer::SpdyError error); | 148 Error NET_EXPORT_PRIVATE MapFramerErrorToNetError(SpdyFramer::SpdyError error); |
| 148 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE | 149 SpdyProtocolErrorDetails NET_EXPORT_PRIVATE |
| 149 MapRstStreamStatusToProtocolError(SpdyRstStreamStatus status); | 150 MapRstStreamStatusToProtocolError(SpdyRstStreamStatus status); |
| 150 SpdyGoAwayStatus NET_EXPORT_PRIVATE MapNetErrorToGoAwayStatus(Error err); | 151 SpdyGoAwayStatus NET_EXPORT_PRIVATE MapNetErrorToGoAwayStatus(Error err); |
| 151 | 152 |
| 152 // If these compile asserts fail then SpdyProtocolErrorDetails needs | 153 // If these compile asserts fail then SpdyProtocolErrorDetails needs |
| 153 // to be updated with new values, as do the mapping functions above. | 154 // to be updated with new values, as do the mapping functions above. |
| 154 static_assert(17 == SpdyFramer::LAST_ERROR, | 155 static_assert(17 == SpdyFramer::LAST_ERROR, |
| 155 "SpdyProtocolErrorDetails / Spdy Errors mismatch"); | 156 "SpdyProtocolErrorDetails / Spdy Errors mismatch"); |
| 156 static_assert(17 == RST_STREAM_NUM_STATUS_CODES, | 157 static_assert(18 == RST_STREAM_NUM_STATUS_CODES, |
| 157 "SpdyProtocolErrorDetails / RstStreamStatus mismatch"); | 158 "SpdyProtocolErrorDetails / RstStreamStatus mismatch"); |
| 158 | 159 |
| 159 // A helper class used to manage a request to create a stream. | 160 // A helper class used to manage a request to create a stream. |
| 160 class NET_EXPORT_PRIVATE SpdyStreamRequest { | 161 class NET_EXPORT_PRIVATE SpdyStreamRequest { |
| 161 public: | 162 public: |
| 162 SpdyStreamRequest(); | 163 SpdyStreamRequest(); |
| 163 // Calls CancelRequest(). | 164 // Calls CancelRequest(). |
| 164 ~SpdyStreamRequest(); | 165 ~SpdyStreamRequest(); |
| 165 | 166 |
| 166 // Starts the request to create a stream. If OK is returned, then | 167 // Starts the request to create a stream. If OK is returned, then |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 // Used for posting asynchronous IO tasks. We use this even though | 1208 // Used for posting asynchronous IO tasks. We use this even though |
| 1208 // SpdySession is refcounted because we don't need to keep the SpdySession | 1209 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1209 // alive if the last reference is within a RunnableMethod. Just revoke the | 1210 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1210 // method. | 1211 // method. |
| 1211 base::WeakPtrFactory<SpdySession> weak_factory_; | 1212 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1212 }; | 1213 }; |
| 1213 | 1214 |
| 1214 } // namespace net | 1215 } // namespace net |
| 1215 | 1216 |
| 1216 #endif // NET_SPDY_SPDY_SESSION_H_ | 1217 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |