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 <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // Is this a SPDY or QUIC alternative Job? | 339 // Is this a SPDY or QUIC alternative Job? |
340 bool IsSpdyAlternative() const; | 340 bool IsSpdyAlternative() const; |
341 bool IsQuicAlternative() const; | 341 bool IsQuicAlternative() const; |
342 | 342 |
343 // Sets several fields of |ssl_config| based on the proxy info and other | 343 // Sets several fields of |ssl_config| based on the proxy info and other |
344 // factors. | 344 // factors. |
345 void InitSSLConfig(SSLConfig* ssl_config, bool is_proxy) const; | 345 void InitSSLConfig(SSLConfig* ssl_config, bool is_proxy) const; |
346 | 346 |
347 // Retrieve SSLInfo from our SSL Socket. | 347 // Retrieve SSLInfo from our SSL Socket. |
348 // This must only be called when we are using an SSLSocket. | 348 // This must only be called when we are using an SSLSocket. |
349 // After calling, the caller can use ssl_info_. | 349 void GetSSLInfo(SSLInfo* ssl_info); |
350 void GetSSLInfo(); | |
351 | 350 |
352 SpdySessionKey GetSpdySessionKey() const; | 351 SpdySessionKey GetSpdySessionKey() const; |
353 | 352 |
354 // Returns true if the current request can use an existing spdy session. | 353 // Returns true if the current request can use an existing spdy session. |
355 bool CanUseExistingSpdySession() const; | 354 bool CanUseExistingSpdySession() const; |
356 | 355 |
357 // Called when we encounter a network error that could be resolved by trying | 356 // Called when we encounter a network error that could be resolved by trying |
358 // a new proxy configuration. If there is another proxy configuration to try | 357 // a new proxy configuration. If there is another proxy configuration to try |
359 // then this method sets next_state_ appropriately and returns either OK or | 358 // then this method sets next_state_ appropriately and returns either OK or |
360 // ERR_IO_PENDING depending on whether or not the new proxy configuration is | 359 // ERR_IO_PENDING depending on whether or not the new proxy configuration is |
(...skipping 30 matching lines...) Expand all Loading... |
391 const AddressList& addresses, | 390 const AddressList& addresses, |
392 const NetLogWithSource& net_log); | 391 const NetLogWithSource& net_log); |
393 | 392 |
394 const HttpRequestInfo request_info_; | 393 const HttpRequestInfo request_info_; |
395 RequestPriority priority_; | 394 RequestPriority priority_; |
396 const ProxyInfo proxy_info_; | 395 const ProxyInfo proxy_info_; |
397 SSLConfig server_ssl_config_; | 396 SSLConfig server_ssl_config_; |
398 SSLConfig proxy_ssl_config_; | 397 SSLConfig proxy_ssl_config_; |
399 const NetLogWithSource net_log_; | 398 const NetLogWithSource net_log_; |
400 | 399 |
401 CompletionCallback io_callback_; | 400 const CompletionCallback io_callback_; |
402 std::unique_ptr<ClientSocketHandle> connection_; | 401 std::unique_ptr<ClientSocketHandle> connection_; |
403 HttpNetworkSession* const session_; | 402 HttpNetworkSession* const session_; |
404 | 403 |
405 // |state_| is only used for LogHistograms(). | 404 // |state_| is only used for LogHistograms(). |
406 State state_; | 405 State state_; |
407 | 406 |
408 State next_state_; | 407 State next_state_; |
409 SSLInfo ssl_info_; | |
410 | 408 |
411 // The server we are trying to reach, could be that of the origin or of the | 409 // The server we are trying to reach, could be that of the origin or of the |
412 // alternative service (after applying host mapping rules). | 410 // alternative service (after applying host mapping rules). |
413 const HostPortPair destination_; | 411 const HostPortPair destination_; |
414 | 412 |
415 // The origin url we're trying to reach. This url may be different from the | 413 // The origin url we're trying to reach. This url may be different from the |
416 // original request when host mapping rules are set-up. | 414 // original request when host mapping rules are set-up. |
417 const GURL origin_url_; | 415 const GURL origin_url_; |
418 | 416 |
419 // AlternativeService for this Job if this is an alternative Job. | 417 // AlternativeService for this Job if this is an alternative Job. |
420 const AlternativeService alternative_service_; | 418 const AlternativeService alternative_service_; |
421 | 419 |
422 // Alternative proxy server that should be used by |this| to fetch the | 420 // Alternative proxy server that should be used by |this| to fetch the |
423 // request. | 421 // request. |
424 const ProxyServer alternative_proxy_server_; | 422 const ProxyServer alternative_proxy_server_; |
425 | 423 |
426 // Enable pooling to a SpdySession with matching IP and certificate | 424 // Enable pooling to a SpdySession with matching IP and certificate |
427 // even if the SpdySessionKey is different. | 425 // even if the SpdySessionKey is different. |
428 const bool enable_ip_based_pooling_; | 426 const bool enable_ip_based_pooling_; |
429 | 427 |
430 // Unowned. |this| job is owned by |delegate_|. | 428 // Unowned. |this| job is owned by |delegate_|. |
431 Delegate* delegate_; | 429 Delegate* const delegate_; |
432 | 430 |
433 const JobType job_type_; | 431 const JobType job_type_; |
434 | 432 |
435 // True if handling a HTTPS request. | 433 // True if handling a HTTPS request. |
436 const bool using_ssl_; | 434 const bool using_ssl_; |
437 | 435 |
438 // True if this network transaction is using SPDY instead of HTTP. | 436 // True if this network transaction is using SPDY instead of HTTP. |
439 bool using_spdy_; | 437 bool using_spdy_; |
440 | 438 |
441 // True if this network transaction is using QUIC instead of HTTP. | 439 // True if this network transaction is using QUIC instead of HTTP. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 HostPortPair destination, | 532 HostPortPair destination, |
535 GURL origin_url, | 533 GURL origin_url, |
536 const ProxyServer& alternative_proxy_server, | 534 const ProxyServer& alternative_proxy_server, |
537 bool enable_ip_based_pooling, | 535 bool enable_ip_based_pooling, |
538 NetLog* net_log); | 536 NetLog* net_log); |
539 }; | 537 }; |
540 | 538 |
541 } // namespace net | 539 } // namespace net |
542 | 540 |
543 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 541 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
OLD | NEW |