| 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_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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // Returns true if this is this key was new to the factory. | 37 // Returns true if this is this key was new to the factory. |
| 38 bool SetHttpPipeliningKey(const HttpPipelinedHost::Key& http_pipelining_key); | 38 bool SetHttpPipeliningKey(const HttpPipelinedHost::Key& http_pipelining_key); |
| 39 | 39 |
| 40 // 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|, |
| 41 // but Request will own |job|. | 41 // but Request will own |job|. |
| 42 void AttachJob(HttpStreamFactoryImpl::Job* job); | 42 void AttachJob(HttpStreamFactoryImpl::Job* job); |
| 43 | 43 |
| 44 // Marks completion of the request. Must be called before OnStreamReady(). | 44 // Marks completion of the request. Must be called before OnStreamReady(). |
| 45 // |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. |
| 46 void Complete(bool was_npn_negotiated, | 46 void Complete(bool was_npn_negotiated, |
| 47 SSLClientSocket::NextProto protocol_negotiated, | 47 NextProto protocol_negotiated, |
| 48 bool using_spdy, | 48 bool using_spdy, |
| 49 const BoundNetLog& job_net_log); | 49 const BoundNetLog& job_net_log); |
| 50 | 50 |
| 51 // If this Request has a |spdy_session_key_|, remove this session from the | 51 // If this Request has a |spdy_session_key_|, remove this session from the |
| 52 // SpdySessionRequestMap. | 52 // SpdySessionRequestMap. |
| 53 void RemoveRequestFromSpdySessionRequestMap(); | 53 void RemoveRequestFromSpdySessionRequestMap(); |
| 54 | 54 |
| 55 // If this Request has a |http_pipelining_key_|, remove this session from the | 55 // If this Request has a |http_pipelining_key_|, remove this session from the |
| 56 // HttpPipeliningRequestMap. | 56 // HttpPipeliningRequestMap. |
| 57 void RemoveRequestFromHttpPipeliningRequestMap(); | 57 void RemoveRequestFromHttpPipeliningRequestMap(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 87 const SSLConfig& used_ssl_config, | 87 const SSLConfig& used_ssl_config, |
| 88 const ProxyInfo& used_proxy_info, | 88 const ProxyInfo& used_proxy_info, |
| 89 HttpStream* stream); | 89 HttpStream* stream); |
| 90 | 90 |
| 91 // HttpStreamRequest methods. | 91 // HttpStreamRequest methods. |
| 92 | 92 |
| 93 virtual int RestartTunnelWithProxyAuth( | 93 virtual int RestartTunnelWithProxyAuth( |
| 94 const AuthCredentials& credentials) OVERRIDE; | 94 const AuthCredentials& credentials) OVERRIDE; |
| 95 virtual LoadState GetLoadState() const OVERRIDE; | 95 virtual LoadState GetLoadState() const OVERRIDE; |
| 96 virtual bool was_npn_negotiated() const OVERRIDE; | 96 virtual bool was_npn_negotiated() const OVERRIDE; |
| 97 virtual SSLClientSocket::NextProto protocol_negotiated() const OVERRIDE; | 97 virtual NextProto protocol_negotiated() const OVERRIDE; |
| 98 virtual bool using_spdy() const OVERRIDE; | 98 virtual bool using_spdy() const OVERRIDE; |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 // Used to orphan all jobs in |jobs_| other than |job| which becomes "bound" | 101 // Used to orphan all jobs in |jobs_| other than |job| which becomes "bound" |
| 102 // to the request. | 102 // to the request. |
| 103 void OrphanJobsExcept(Job* job); | 103 void OrphanJobsExcept(Job* job); |
| 104 | 104 |
| 105 // Used to orphan all jobs in |jobs_|. | 105 // Used to orphan all jobs in |jobs_|. |
| 106 void OrphanJobs(); | 106 void OrphanJobs(); |
| 107 | 107 |
| 108 const GURL url_; | 108 const GURL url_; |
| 109 HttpStreamFactoryImpl* const factory_; | 109 HttpStreamFactoryImpl* const factory_; |
| 110 HttpStreamRequest::Delegate* const delegate_; | 110 HttpStreamRequest::Delegate* const delegate_; |
| 111 const BoundNetLog net_log_; | 111 const BoundNetLog net_log_; |
| 112 | 112 |
| 113 // 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. |
| 114 scoped_ptr<Job> bound_job_; | 114 scoped_ptr<Job> bound_job_; |
| 115 std::set<HttpStreamFactoryImpl::Job*> jobs_; | 115 std::set<HttpStreamFactoryImpl::Job*> jobs_; |
| 116 scoped_ptr<const HostPortProxyPair> spdy_session_key_; | 116 scoped_ptr<const HostPortProxyPair> spdy_session_key_; |
| 117 scoped_ptr<const HttpPipelinedHost::Key> http_pipelining_key_; | 117 scoped_ptr<const HttpPipelinedHost::Key> http_pipelining_key_; |
| 118 | 118 |
| 119 bool completed_; | 119 bool completed_; |
| 120 bool was_npn_negotiated_; | 120 bool was_npn_negotiated_; |
| 121 // Protocol negotiated with the server. | 121 // Protocol negotiated with the server. |
| 122 SSLClientSocket::NextProto protocol_negotiated_; | 122 NextProto protocol_negotiated_; |
| 123 bool using_spdy_; | 123 bool using_spdy_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(Request); | 125 DISALLOW_COPY_AND_ASSIGN(Request); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace net | 128 } // namespace net |
| 129 | 129 |
| 130 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 130 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| OLD | NEW |