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

Side by Side Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2351513002: net: rename BoundNetLog to NetLogWithSource (Closed)
Patch Set: one more fix, content bound_net_log_ Created 4 years, 3 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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 #include "net/http/http_stream_factory_impl_job_controller.h" 5 #include "net/http/http_stream_factory_impl_job_controller.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 bool HttpStreamFactoryImpl::JobController::for_websockets() { 56 bool HttpStreamFactoryImpl::JobController::for_websockets() {
57 return factory_->for_websockets_; 57 return factory_->for_websockets_;
58 } 58 }
59 59
60 HttpStreamFactoryImpl::Request* HttpStreamFactoryImpl::JobController::Start( 60 HttpStreamFactoryImpl::Request* HttpStreamFactoryImpl::JobController::Start(
61 const HttpRequestInfo& request_info, 61 const HttpRequestInfo& request_info,
62 HttpStreamRequest::Delegate* delegate, 62 HttpStreamRequest::Delegate* delegate,
63 WebSocketHandshakeStreamBase::CreateHelper* 63 WebSocketHandshakeStreamBase::CreateHelper*
64 websocket_handshake_stream_create_helper, 64 websocket_handshake_stream_create_helper,
65 const BoundNetLog& net_log, 65 const NetLogWithSource& net_log,
66 HttpStreamRequest::StreamType stream_type, 66 HttpStreamRequest::StreamType stream_type,
67 RequestPriority priority, 67 RequestPriority priority,
68 const SSLConfig& server_ssl_config, 68 const SSLConfig& server_ssl_config,
69 const SSLConfig& proxy_ssl_config) { 69 const SSLConfig& proxy_ssl_config) {
70 DCHECK(factory_); 70 DCHECK(factory_);
71 DCHECK(!request_); 71 DCHECK(!request_);
72 72
73 request_ = new Request(request_info.url, this, delegate, 73 request_ = new Request(request_info.url, this, delegate,
74 websocket_handshake_stream_create_helper, net_log, 74 websocket_handshake_stream_create_helper, net_log,
75 stream_type); 75 stream_type);
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 DCHECK(job->using_spdy()); 407 DCHECK(job->using_spdy());
408 408
409 bool is_job_orphaned = job_bound_ && bound_job_ != job; 409 bool is_job_orphaned = job_bound_ && bound_job_ != job;
410 410
411 // Cache these values in case the job gets deleted. 411 // Cache these values in case the job gets deleted.
412 const SSLConfig used_ssl_config = job->server_ssl_config(); 412 const SSLConfig used_ssl_config = job->server_ssl_config();
413 const ProxyInfo used_proxy_info = job->proxy_info(); 413 const ProxyInfo used_proxy_info = job->proxy_info();
414 const bool was_alpn_negotiated = job->was_alpn_negotiated(); 414 const bool was_alpn_negotiated = job->was_alpn_negotiated();
415 const NextProto negotiated_protocol = job->negotiated_protocol(); 415 const NextProto negotiated_protocol = job->negotiated_protocol();
416 const bool using_spdy = job->using_spdy(); 416 const bool using_spdy = job->using_spdy();
417 const BoundNetLog net_log = job->net_log(); 417 const NetLogWithSource net_log = job->net_log();
418 418
419 // Cache this so we can still use it if the JobController is deleted. 419 // Cache this so we can still use it if the JobController is deleted.
420 HttpStreamFactoryImpl* factory = factory_; 420 HttpStreamFactoryImpl* factory = factory_;
421 421
422 // Notify |request_|. 422 // Notify |request_|.
423 if (!is_preconnect_ && !is_job_orphaned) { 423 if (!is_preconnect_ && !is_job_orphaned) {
424 if (job->job_type() == MAIN && alternative_job_failed_) 424 if (job->job_type() == MAIN && alternative_job_failed_)
425 ReportBrokenAlternativeService(); 425 ReportBrokenAlternativeService();
426 426
427 DCHECK(request_); 427 DCHECK(request_);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 DCHECK(base::ContainsKey(spdy_session_request_map, *spdy_session_key)); 587 DCHECK(base::ContainsKey(spdy_session_request_map, *spdy_session_key));
588 RequestSet& request_set = spdy_session_request_map[*spdy_session_key]; 588 RequestSet& request_set = spdy_session_request_map[*spdy_session_key];
589 DCHECK(base::ContainsKey(request_set, request_)); 589 DCHECK(base::ContainsKey(request_set, request_));
590 request_set.erase(request_); 590 request_set.erase(request_);
591 if (request_set.empty()) 591 if (request_set.empty())
592 spdy_session_request_map.erase(*spdy_session_key); 592 spdy_session_request_map.erase(*spdy_session_key);
593 request_->ResetSpdySessionKey(); 593 request_->ResetSpdySessionKey();
594 } 594 }
595 } 595 }
596 596
597 const BoundNetLog* HttpStreamFactoryImpl::JobController::GetNetLog( 597 const NetLogWithSource* HttpStreamFactoryImpl::JobController::GetNetLog(
598 Job* job) const { 598 Job* job) const {
599 if (is_preconnect_ || (job_bound_ && bound_job_ != job)) 599 if (is_preconnect_ || (job_bound_ && bound_job_ != job))
600 return nullptr; 600 return nullptr;
601 DCHECK(request_); 601 DCHECK(request_);
602 return &request_->net_log(); 602 return &request_->net_log();
603 } 603 }
604 604
605 void HttpStreamFactoryImpl::JobController::MaybeSetWaitTimeForMainJob( 605 void HttpStreamFactoryImpl::JobController::MaybeSetWaitTimeForMainJob(
606 const base::TimeDelta& delay) { 606 const base::TimeDelta& delay) {
607 if (main_job_is_blocked_) 607 if (main_job_is_blocked_)
608 main_job_wait_time_ = delay; 608 main_job_wait_time_ = delay;
609 } 609 }
610 610
611 WebSocketHandshakeStreamBase::CreateHelper* HttpStreamFactoryImpl:: 611 WebSocketHandshakeStreamBase::CreateHelper* HttpStreamFactoryImpl::
612 JobController::websocket_handshake_stream_create_helper() { 612 JobController::websocket_handshake_stream_create_helper() {
613 DCHECK(request_); 613 DCHECK(request_);
614 return request_->websocket_handshake_stream_create_helper(); 614 return request_->websocket_handshake_stream_create_helper();
615 } 615 }
616 616
617 void HttpStreamFactoryImpl::JobController::CreateJobs( 617 void HttpStreamFactoryImpl::JobController::CreateJobs(
618 const HttpRequestInfo& request_info, 618 const HttpRequestInfo& request_info,
619 RequestPriority priority, 619 RequestPriority priority,
620 const SSLConfig& server_ssl_config, 620 const SSLConfig& server_ssl_config,
621 const SSLConfig& proxy_ssl_config, 621 const SSLConfig& proxy_ssl_config,
622 HttpStreamRequest::Delegate* delegate, 622 HttpStreamRequest::Delegate* delegate,
623 HttpStreamRequest::StreamType stream_type, 623 HttpStreamRequest::StreamType stream_type,
624 const BoundNetLog& net_log) { 624 const NetLogWithSource& net_log) {
625 DCHECK(!main_job_); 625 DCHECK(!main_job_);
626 DCHECK(!alternative_job_); 626 DCHECK(!alternative_job_);
627 HostPortPair destination(HostPortPair::FromURL(request_info.url)); 627 HostPortPair destination(HostPortPair::FromURL(request_info.url));
628 GURL origin_url = ApplyHostMappingRules(request_info.url, &destination); 628 GURL origin_url = ApplyHostMappingRules(request_info.url, &destination);
629 629
630 main_job_.reset(job_factory_->CreateJob( 630 main_job_.reset(job_factory_->CreateJob(
631 this, MAIN, session_, request_info, priority, server_ssl_config, 631 this, MAIN, session_, request_info, priority, server_ssl_config,
632 proxy_ssl_config, destination, origin_url, net_log.net_log())); 632 proxy_ssl_config, destination, origin_url, net_log.net_log()));
633 AttachJob(main_job_.get()); 633 AttachJob(main_job_.get());
634 634
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 } 1084 }
1085 1085
1086 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() { 1086 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() {
1087 if (!alternative_job_ || !request_) 1087 if (!alternative_job_ || !request_)
1088 return; 1088 return;
1089 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); 1089 DCHECK(alternative_job_->alternative_proxy_server().is_valid());
1090 alternative_job_->Start(request_->stream_type()); 1090 alternative_job_->Start(request_->stream_type());
1091 } 1091 }
1092 1092
1093 } // namespace net 1093 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698