Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ | |
| 6 #define NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "net/base/net_export.h" | |
| 10 #include "net/base/net_log.h" | |
| 11 | |
| 12 namespace net { | |
| 13 | |
| 14 class BoundNetLog; | |
| 15 class ClientSocketHandle; | |
| 16 class HttpPipelinedStream; | |
| 17 class ProxyInfo; | |
| 18 struct SSLConfig; | |
| 19 | |
| 20 class NET_EXPORT_PRIVATE HttpPipelinedConnection { | |
| 21 public: | |
| 22 class Delegate { | |
| 23 public: | |
| 24 // Called when a pipeline has newly available capacity. This may be because | |
| 25 // the first request has been sent and the pipeline is now active. Or, it | |
| 26 // may be because a request successfully completed. | |
| 27 virtual void OnPipelineHasCapacity(HttpPipelinedConnection* pipeline) = 0; | |
| 28 }; | |
| 29 | |
| 30 class Factory { | |
| 31 public: | |
| 32 virtual ~Factory() {} | |
| 33 | |
| 34 virtual HttpPipelinedConnection* CreateNewPipeline( | |
| 35 ClientSocketHandle* connection, | |
| 36 Delegate* delegate, | |
| 37 const SSLConfig& used_ssl_config, | |
| 38 const ProxyInfo& used_proxy_info, | |
| 39 const BoundNetLog& net_log, | |
| 40 bool was_npn_negotiated) = 0; | |
| 41 }; | |
| 42 | |
| 43 virtual ~HttpPipelinedConnection() {} | |
| 44 | |
| 45 // Returns a new stream that uses this pipeline. | |
| 46 virtual HttpPipelinedStream* CreateNewStream() = 0; | |
| 47 | |
| 48 // Notifies this pipeline that a stream is no longer using it. | |
| 49 virtual void OnStreamDeleted(int pipeline_id) = 0; | |
|
mmenke
2011/10/12 19:41:35
Don't think this belongs here. Like all functions
James Simonsen
2011/10/12 21:55:51
Done.
| |
| 50 | |
| 51 // The number of streams currently associated with this pipeline. | |
| 52 virtual int depth() const = 0; | |
| 53 | |
| 54 // True if this pipeline can accept new HTTP requests. False if a fatal error | |
| 55 // has occurred. | |
| 56 virtual bool usable() const = 0; | |
| 57 | |
| 58 // True if this pipeline has bound one request and is ready for additional | |
| 59 // requests. | |
| 60 virtual bool active() const = 0; | |
| 61 | |
| 62 // The SSLConfig used to establish this connection. | |
| 63 virtual const SSLConfig& used_ssl_config() const = 0; | |
| 64 | |
| 65 // The ProxyInfo used to establish this connection. | |
| 66 virtual const ProxyInfo& used_proxy_info() const = 0; | |
| 67 | |
| 68 // The source of this piplened connection. | |
|
mmenke
2011/10/12 19:41:35
nit: pipelined.
James Simonsen
2011/10/12 21:55:51
Done.
| |
| 69 virtual const NetLog::Source& source() const = 0; | |
| 70 | |
| 71 // True if this connection was NPN negotiated. | |
| 72 virtual bool was_npn_negotiated() const = 0; | |
| 73 }; | |
| 74 | |
| 75 } // namespace net | |
| 76 | |
| 77 #endif // NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ | |
| OLD | NEW |