| OLD | NEW |
| 1 // Copyright (c) 2011 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_IMPL_REQUEST_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 11 #include "net/base/net_log.h" | 11 #include "net/base/net_log.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Called when the Job determines the appropriate |spdy_session_key| for the | 28 // Called when the Job determines the appropriate |spdy_session_key| for the |
| 29 // Request. Note that this does not mean that SPDY is necessarily supported | 29 // Request. Note that this does not mean that SPDY is necessarily supported |
| 30 // for this HostPortProxyPair, since we may need to wait for NPN to complete | 30 // for this HostPortProxyPair, since we may need to wait for NPN to complete |
| 31 // before knowing if SPDY is available. | 31 // before knowing if SPDY is available. |
| 32 void SetSpdySessionKey(const HostPortProxyPair& spdy_session_key); | 32 void SetSpdySessionKey(const HostPortProxyPair& spdy_session_key); |
| 33 | 33 |
| 34 // Called when the Job determines the appropriate |http_pipelining_key| for | 34 // Called when the Job determines the appropriate |http_pipelining_key| for |
| 35 // the Request. Registers this Request with the factory, so that if an | 35 // the Request. Registers this Request with the factory, so that if an |
| 36 // existing pipeline becomes available, this Request can be late bound to it. | 36 // existing pipeline becomes available, this Request can be late bound to it. |
| 37 void SetHttpPipeliningKey(const HostPortPair& http_pipelining_key); | 37 // Returns true if this is this key was new to the factory. |
| 38 bool SetHttpPipeliningKey(const HttpPipelinedHost::Key& http_pipelining_key); |
| 38 | 39 |
| 39 // Attaches |job| to this request. Does not mean that Request will use |job|, | 40 // Attaches |job| to this request. Does not mean that Request will use |job|, |
| 40 // but Request will own |job|. | 41 // but Request will own |job|. |
| 41 void AttachJob(HttpStreamFactoryImpl::Job* job); | 42 void AttachJob(HttpStreamFactoryImpl::Job* job); |
| 42 | 43 |
| 43 // Marks completion of the request. Must be called before OnStreamReady(). | 44 // Marks completion of the request. Must be called before OnStreamReady(). |
| 44 // |job_net_log| is the BoundNetLog of the Job that fulfilled this request. | 45 // |job_net_log| is the BoundNetLog of the Job that fulfilled this request. |
| 45 void Complete(bool was_npn_negotiated, | 46 void Complete(bool was_npn_negotiated, |
| 46 SSLClientSocket::NextProto protocol_negotiated, | 47 SSLClientSocket::NextProto protocol_negotiated, |
| 47 bool using_spdy, | 48 bool using_spdy, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 107 |
| 107 const GURL url_; | 108 const GURL url_; |
| 108 HttpStreamFactoryImpl* const factory_; | 109 HttpStreamFactoryImpl* const factory_; |
| 109 HttpStreamRequest::Delegate* const delegate_; | 110 HttpStreamRequest::Delegate* const delegate_; |
| 110 const BoundNetLog net_log_; | 111 const BoundNetLog net_log_; |
| 111 | 112 |
| 112 // At the point where Job is irrevocably tied to the Request, we set this. | 113 // At the point where Job is irrevocably tied to the Request, we set this. |
| 113 scoped_ptr<Job> bound_job_; | 114 scoped_ptr<Job> bound_job_; |
| 114 std::set<HttpStreamFactoryImpl::Job*> jobs_; | 115 std::set<HttpStreamFactoryImpl::Job*> jobs_; |
| 115 scoped_ptr<const HostPortProxyPair> spdy_session_key_; | 116 scoped_ptr<const HostPortProxyPair> spdy_session_key_; |
| 116 scoped_ptr<const HostPortPair> http_pipelining_key_; | 117 scoped_ptr<const HttpPipelinedHost::Key> http_pipelining_key_; |
| 117 | 118 |
| 118 bool completed_; | 119 bool completed_; |
| 119 bool was_npn_negotiated_; | 120 bool was_npn_negotiated_; |
| 120 // Protocol negotiated with the server. | 121 // Protocol negotiated with the server. |
| 121 SSLClientSocket::NextProto protocol_negotiated_; | 122 SSLClientSocket::NextProto protocol_negotiated_; |
| 122 bool using_spdy_; | 123 bool using_spdy_; |
| 123 | 124 |
| 124 DISALLOW_COPY_AND_ASSIGN(Request); | 125 DISALLOW_COPY_AND_ASSIGN(Request); |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 } // namespace net | 128 } // namespace net |
| 128 | 129 |
| 129 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 130 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| OLD | NEW |