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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. Tracks the |
59 // original url so we can mark the Alternate-Protocol as broken if | 59 // original url so we can mark the Alternate-Protocol as broken if |
60 // we fail to connect. |alternate| specifies the alternate protocol to use | 60 // we fail to connect. |alternate| specifies the alternate protocol to use |
61 // and alternate port to connect to. | 61 // and alternate port to connect to. |
62 void MarkAsAlternate(const GURL& original_url, | 62 void MarkAsAlternate(const GURL& original_url, |
63 AlternateProtocolInfo alternate); | 63 AlternativeService alternative_service); |
64 | 64 |
65 // Tells |this| to wait for |job| to resume it. | 65 // Tells |this| to wait for |job| to resume it. |
66 void WaitFor(Job* job); | 66 void WaitFor(Job* job); |
67 | 67 |
68 // Tells |this| that |job| has determined it still needs to continue | 68 // Tells |this| that |job| has determined it still needs to continue |
69 // connecting, so allow |this| to continue. If this is not called, then | 69 // connecting, so allow |this| to continue. If this is not called, then |
70 // |request_| is expected to cancel |this| by deleting it. | 70 // |request_| is expected to cancel |this| by deleting it. |
71 void Resume(Job* job); | 71 void Resume(Job* job); |
72 | 72 |
73 // Used to detach the Job from |request|. | 73 // Used to detach the Job from |request|. |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 269 |
270 // The origin url we're trying to reach. This url may be different from the | 270 // The origin url we're trying to reach. This url may be different from the |
271 // original request when host mapping rules are set-up. | 271 // original request when host mapping rules are set-up. |
272 GURL origin_url_; | 272 GURL origin_url_; |
273 | 273 |
274 // If this is a Job for an "Alternate-Protocol", then this will be non-NULL | 274 // If this is a Job for an "Alternate-Protocol", then this will be non-NULL |
275 // and will specify the original URL. | 275 // and will specify the original URL. |
276 scoped_ptr<GURL> original_url_; | 276 scoped_ptr<GURL> original_url_; |
277 | 277 |
278 // AlternateProtocol for this job if this is an alternate job. | 278 // AlternateProtocol for this job if this is an alternate job. |
279 AlternateProtocolInfo alternate_protocol_; | 279 AlternativeService alternative_service_; |
280 | 280 |
281 // AlternateProtocol for the other job if this is not an alternate job. | 281 // AlternateProtocol for the other job if this is not an alternate job. |
282 AlternateProtocolInfo other_job_alternate_protocol_; | 282 AlternativeService other_job_alternative_service_; |
283 | 283 |
284 // This is the Job we're dependent on. It will notify us if/when it's OK to | 284 // This is the Job we're dependent on. It will notify us if/when it's OK to |
285 // proceed. | 285 // proceed. |
286 Job* blocking_job_; | 286 Job* blocking_job_; |
287 | 287 |
288 // |waiting_job_| is a Job waiting to see if |this| can reuse a connection. | 288 // |waiting_job_| is a Job waiting to see if |this| can reuse a connection. |
289 // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to | 289 // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to |
290 // proceed and then race the two Jobs. | 290 // proceed and then race the two Jobs. |
291 Job* waiting_job_; | 291 Job* waiting_job_; |
292 | 292 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 JobStatus other_job_status_; | 342 JobStatus other_job_status_; |
343 | 343 |
344 base::WeakPtrFactory<Job> ptr_factory_; | 344 base::WeakPtrFactory<Job> ptr_factory_; |
345 | 345 |
346 DISALLOW_COPY_AND_ASSIGN(Job); | 346 DISALLOW_COPY_AND_ASSIGN(Job); |
347 }; | 347 }; |
348 | 348 |
349 } // namespace net | 349 } // namespace net |
350 | 350 |
351 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 351 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
OLD | NEW |