Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1065)

Side by Side Diff: net/http/http_stream_factory_impl_job.h

Issue 665083009: ABANDONED Handle multiple AlternateProtocols for each HostPortPair. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work on pref load/save and on Job. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 23 matching lines...) Expand all
34 // An HttpStreamRequestImpl exists for each stream which is in progress of being 34 // An HttpStreamRequestImpl exists for each stream which is in progress of being
35 // created for the StreamFactory. 35 // created for the StreamFactory.
36 class HttpStreamFactoryImpl::Job { 36 class HttpStreamFactoryImpl::Job {
37 public: 37 public:
38 Job(HttpStreamFactoryImpl* stream_factory, 38 Job(HttpStreamFactoryImpl* stream_factory,
39 HttpNetworkSession* session, 39 HttpNetworkSession* session,
40 const HttpRequestInfo& request_info, 40 const HttpRequestInfo& request_info,
41 RequestPriority priority, 41 RequestPriority priority,
42 const SSLConfig& server_ssl_config, 42 const SSLConfig& server_ssl_config,
43 const SSLConfig& proxy_ssl_config, 43 const SSLConfig& proxy_ssl_config,
44 NetLog* net_log); 44 NetLog* net_log,
45 AlternateProtocolInfo alternate_protocol);
45 ~Job(); 46 ~Job();
46 47
47 // Start initiates the process of creating a new HttpStream. |request| will be 48 // Start initiates the process of creating a new HttpStream. |request| will be
48 // notified upon completion if the Job has not been Orphan()'d. 49 // notified upon completion if the Job has not been Orphan()'d.
49 void Start(Request* request); 50 void Start(Request* request);
50 51
51 // Preconnect will attempt to request |num_streams| sockets from the 52 // Preconnect will attempt to request |num_streams| sockets from the
52 // appropriate ClientSocketPool. 53 // appropriate ClientSocketPool.
53 int Preconnect(int num_streams); 54 int Preconnect(int num_streams);
54 55
55 int RestartTunnelWithProxyAuth(const AuthCredentials& credentials); 56 int RestartTunnelWithProxyAuth(const AuthCredentials& credentials);
56 LoadState GetLoadState() const; 57 LoadState GetLoadState() const;
57 58
58 // Marks this Job as the "alternate" job, from Alternate-Protocol. Tracks the 59 // 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 60 // original url so we can mark the Alternate-Protocol as broken if
60 // we fail to connect. |alternate| specifies the alternate protocol to use 61 // we fail to connect.
61 // and alternate port to connect to. 62 void MarkAsAlternate(const GURL& original_url);
62 void MarkAsAlternate(const GURL& original_url,
63 AlternateProtocolInfo alternate);
64 63
65 // Tells |this| to wait for |job| to resume it. 64 // Tells |this| to wait for |job| to resume it.
66 void WaitFor(Job* job); 65 void WaitFor(Job* job);
67 66
68 // Tells |this| that |job| has determined it still needs to continue 67 // Tells |this| that |job| has determined it still needs to continue
69 // connecting, so allow |this| to continue. If this is not called, then 68 // connecting, so allow |this| to continue. If this is not called, then
70 // |request_| is expected to cancel |this| by deleting it. 69 // |request_| is expected to cancel |this| by deleting it.
71 void Resume(Job* job); 70 void Resume(Job* job);
72 71
73 // Used to detach the Job from |request|. 72 // Used to detach the Job from |request|.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 HostPortPair origin_; 267 HostPortPair origin_;
269 268
270 // The origin url we're trying to reach. This url may be different from the 269 // 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. 270 // original request when host mapping rules are set-up.
272 GURL origin_url_; 271 GURL origin_url_;
273 272
274 // If this is a Job for an "Alternate-Protocol", then this will be non-NULL 273 // If this is a Job for an "Alternate-Protocol", then this will be non-NULL
275 // and will specify the original URL. 274 // and will specify the original URL.
276 scoped_ptr<GURL> original_url_; 275 scoped_ptr<GURL> original_url_;
277 276
277 // The alternate protocol regardless of whether this job is alternate or not.
278 AlternateProtocolInfo alternate_protocol_;
279
278 // This is the Job we're dependent on. It will notify us if/when it's OK to 280 // This is the Job we're dependent on. It will notify us if/when it's OK to
279 // proceed. 281 // proceed.
280 Job* blocking_job_; 282 Job* blocking_job_;
281 283
282 // |waiting_job_| is a Job waiting to see if |this| can reuse a connection. 284 // |waiting_job_| is a Job waiting to see if |this| can reuse a connection.
283 // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to 285 // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to
284 // proceed and then race the two Jobs. 286 // proceed and then race the two Jobs.
285 Job* waiting_job_; 287 Job* waiting_job_;
286 288
287 // True if handling a HTTPS request, or using SPDY with SSL 289 // True if handling a HTTPS request, or using SPDY with SSL
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 JobStatus other_job_status_; 338 JobStatus other_job_status_;
337 339
338 base::WeakPtrFactory<Job> ptr_factory_; 340 base::WeakPtrFactory<Job> ptr_factory_;
339 341
340 DISALLOW_COPY_AND_ASSIGN(Job); 342 DISALLOW_COPY_AND_ASSIGN(Job);
341 }; 343 };
342 344
343 } // namespace net 345 } // namespace net
344 346
345 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ 347 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698