| 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_HTTP_HTTP_STREAM_FACTORY_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 15 #include "net/base/load_states.h" | 15 #include "net/base/load_states.h" |
| 16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
| 17 #include "net/base/request_priority.h" | 17 #include "net/base/request_priority.h" |
| 18 #include "net/http/http_server_properties.h" | 18 #include "net/http/http_server_properties.h" |
| 19 #include "net/socket/connection_attempts.h" |
| 19 // This file can be included from net/http even though | 20 // This file can be included from net/http even though |
| 20 // it is in net/websockets because it doesn't | 21 // it is in net/websockets because it doesn't |
| 21 // introduce any link dependency to net/websockets. | 22 // introduce any link dependency to net/websockets. |
| 22 #include "net/websockets/websocket_handshake_stream_base.h" | 23 #include "net/websockets/websocket_handshake_stream_base.h" |
| 23 | 24 |
| 24 class GURL; | 25 class GURL; |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class Value; | 28 class Value; |
| 28 } | 29 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 virtual LoadState GetLoadState() const = 0; | 164 virtual LoadState GetLoadState() const = 0; |
| 164 | 165 |
| 165 // Returns true if TLS/NPN was negotiated for this stream. | 166 // Returns true if TLS/NPN was negotiated for this stream. |
| 166 virtual bool was_npn_negotiated() const = 0; | 167 virtual bool was_npn_negotiated() const = 0; |
| 167 | 168 |
| 168 // Protocol negotiated with the server. | 169 // Protocol negotiated with the server. |
| 169 virtual NextProto protocol_negotiated() const = 0; | 170 virtual NextProto protocol_negotiated() const = 0; |
| 170 | 171 |
| 171 // Returns true if this stream is being fetched over SPDY. | 172 // Returns true if this stream is being fetched over SPDY. |
| 172 virtual bool using_spdy() const = 0; | 173 virtual bool using_spdy() const = 0; |
| 174 |
| 175 // Returns socket-layer connection attempts made for this stream request. |
| 176 virtual const ConnectionAttempts& connection_attempts() const = 0; |
| 173 }; | 177 }; |
| 174 | 178 |
| 175 // The HttpStreamFactory defines an interface for creating usable HttpStreams. | 179 // The HttpStreamFactory defines an interface for creating usable HttpStreams. |
| 176 class NET_EXPORT HttpStreamFactory { | 180 class NET_EXPORT HttpStreamFactory { |
| 177 public: | 181 public: |
| 178 virtual ~HttpStreamFactory(); | 182 virtual ~HttpStreamFactory(); |
| 179 | 183 |
| 180 void ProcessAlternateProtocol( | 184 void ProcessAlternateProtocol( |
| 181 const base::WeakPtr<HttpServerProperties>& http_server_properties, | 185 const base::WeakPtr<HttpServerProperties>& http_server_properties, |
| 182 const std::vector<std::string>& alternate_protocol_values, | 186 const std::vector<std::string>& alternate_protocol_values, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 240 |
| 237 private: | 241 private: |
| 238 static bool spdy_enabled_; | 242 static bool spdy_enabled_; |
| 239 | 243 |
| 240 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 244 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
| 241 }; | 245 }; |
| 242 | 246 |
| 243 } // namespace net | 247 } // namespace net |
| 244 | 248 |
| 245 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 249 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
| OLD | NEW |