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_JOB_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // notified upon completion if the Job has not been Orphan()'d. | 48 // notified upon completion if the Job has not been Orphan()'d. |
49 void Start(Request* request); | 49 void Start(Request* request); |
50 | 50 |
51 // Preconnect will attempt to request |num_streams| sockets from the | 51 // Preconnect will attempt to request |num_streams| sockets from the |
52 // appropriate ClientSocketPool. | 52 // appropriate ClientSocketPool. |
53 int Preconnect(int num_streams); | 53 int Preconnect(int num_streams); |
54 | 54 |
55 int RestartTunnelWithProxyAuth(const AuthCredentials& credentials); | 55 int RestartTunnelWithProxyAuth(const AuthCredentials& credentials); |
56 LoadState GetLoadState() const; | 56 LoadState GetLoadState() const; |
57 | 57 |
58 // Marks this Job as the "alternate" job, from Alternate-Protocol. Tracks the | 58 // Marks this Job as the "alternate" job, from Alternate-Protocol or Alt-Svc |
59 // original url so we can mark the Alternate-Protocol as broken if | 59 // using the specified alternate service. |
60 // we fail to connect. |alternate| specifies the alternate protocol to use | 60 void MarkAsAlternate(AlternativeService alternative_service); |
61 // and alternate port to connect to. | |
62 void MarkAsAlternate(const GURL& original_url, | |
63 AlternativeService alternative_service); | |
64 | 61 |
65 // Tells |this| to wait for |job| to resume it. | 62 // Tells |this| to wait for |job| to resume it. |
66 void WaitFor(Job* job); | 63 void WaitFor(Job* job); |
67 | 64 |
68 // Tells |this| that |job| has determined it still needs to continue | 65 // Tells |this| that |job| has determined it still needs to continue |
69 // connecting, so allow |this| to continue. If this is not called, then | 66 // connecting, so allow |this| to continue. If this is not called, then |
70 // |request_| is expected to cancel |this| by deleting it. | 67 // |request_| is expected to cancel |this| by deleting it. |
71 void Resume(Job* job); | 68 void Resume(Job* job); |
72 | 69 |
73 // Used to detach the Job from |request|. | 70 // Used to detach the Job from |request|. |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 SSLInfo ssl_info_; | 265 SSLInfo ssl_info_; |
269 | 266 |
270 // The server we are trying to reach, could be that of the origin or of the | 267 // The server we are trying to reach, could be that of the origin or of the |
271 // alternative service. | 268 // alternative service. |
272 HostPortPair server_; | 269 HostPortPair server_; |
273 | 270 |
274 // The origin url we're trying to reach. This url may be different from the | 271 // The origin url we're trying to reach. This url may be different from the |
275 // original request when host mapping rules are set-up. | 272 // original request when host mapping rules are set-up. |
276 GURL origin_url_; | 273 GURL origin_url_; |
277 | 274 |
278 // The original URL if the Job is for an alternative service. | |
279 GURL original_url_; | |
280 | |
281 // AlternateProtocol for this job if this is an alternate job. | 275 // AlternateProtocol for this job if this is an alternate job. |
282 AlternativeService alternative_service_; | 276 AlternativeService alternative_service_; |
283 | 277 |
| 278 // The URL to be used for proxy resolution and socket pools. If the alternate |
| 279 // service is SPDY, the URL will containg the host:port from |
| 280 // |alternate_service_| and "https://" scheme. Otherwise, this will be the |
| 281 // same as |origin_url_|. |
| 282 GURL alternative_service_url_; |
| 283 |
284 // AlternateProtocol for the other job if this is not an alternate job. | 284 // AlternateProtocol for the other job if this is not an alternate job. |
285 AlternativeService other_job_alternative_service_; | 285 AlternativeService other_job_alternative_service_; |
286 | 286 |
287 // This is the Job we're dependent on. It will notify us if/when it's OK to | 287 // This is the Job we're dependent on. It will notify us if/when it's OK to |
288 // proceed. | 288 // proceed. |
289 Job* blocking_job_; | 289 Job* blocking_job_; |
290 | 290 |
291 // |waiting_job_| is a Job waiting to see if |this| can reuse a connection. | 291 // |waiting_job_| is a Job waiting to see if |this| can reuse a connection. |
292 // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to | 292 // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to |
293 // proceed and then race the two Jobs. | 293 // proceed and then race the two Jobs. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 JobStatus other_job_status_; | 345 JobStatus other_job_status_; |
346 | 346 |
347 base::WeakPtrFactory<Job> ptr_factory_; | 347 base::WeakPtrFactory<Job> ptr_factory_; |
348 | 348 |
349 DISALLOW_COPY_AND_ASSIGN(Job); | 349 DISALLOW_COPY_AND_ASSIGN(Job); |
350 }; | 350 }; |
351 | 351 |
352 } // namespace net | 352 } // namespace net |
353 | 353 |
354 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 354 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
OLD | NEW |