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