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

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

Issue 2621983004: Improve HttpStreamFactory NetLog events (Closed)
Patch Set: Get rid of long-running Source Created 3 years, 11 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 #include "net/http/http_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 CHECK_EQ(STATE_NONE, next_state_); 679 CHECK_EQ(STATE_NONE, next_state_);
680 next_state_ = STATE_START; 680 next_state_ = STATE_START;
681 int rv = RunLoop(OK); 681 int rv = RunLoop(OK);
682 DCHECK_EQ(ERR_IO_PENDING, rv); 682 DCHECK_EQ(ERR_IO_PENDING, rv);
683 return rv; 683 return rv;
684 } 684 }
685 685
686 int HttpStreamFactoryImpl::Job::DoStart() { 686 int HttpStreamFactoryImpl::Job::DoStart() {
687 const NetLogWithSource* net_log = delegate_->GetNetLog(this); 687 const NetLogWithSource* net_log = delegate_->GetNetLog(this);
688 688
689 if (net_log) { 689 net_log_.BeginEvent(
eroman 2017/01/25 19:55:26 It isn't clear why this removal is safe when readi
xunjieli 2017/01/25 21:41:48 Done.
690 net_log_.BeginEvent( 690 NetLogEventType::HTTP_STREAM_JOB,
691 NetLogEventType::HTTP_STREAM_JOB, 691 base::Bind(&NetLogHttpStreamJobCallback, net_log->source(),
692 base::Bind(&NetLogHttpStreamJobCallback, net_log->source(), 692 &request_info_.url, &origin_url_, &alternative_service_,
693 &request_info_.url, &origin_url_, &alternative_service_, 693 priority_));
694 priority_)); 694 net_log->AddEvent(NetLogEventType::HTTP_STREAM_REQUEST_STARTED_JOB,
695 net_log->AddEvent(NetLogEventType::HTTP_STREAM_REQUEST_STARTED_JOB, 695 net_log_.source().ToEventParametersCallback());
696 net_log_.source().ToEventParametersCallback());
697 }
698 696
699 // Don't connect to restricted ports. 697 // Don't connect to restricted ports.
700 if (!IsPortAllowedForScheme(destination_.port(), 698 if (!IsPortAllowedForScheme(destination_.port(),
701 request_info_.url.scheme())) { 699 request_info_.url.scheme())) {
702 return ERR_UNSAFE_PORT; 700 return ERR_UNSAFE_PORT;
703 } 701 }
704 702
705 next_state_ = STATE_RESOLVE_PROXY; 703 next_state_ = STATE_RESOLVE_PROXY;
706 return OK; 704 return OK;
707 } 705 }
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 1504
1507 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1505 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1508 if (connection_->socket()) { 1506 if (connection_->socket()) {
1509 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1507 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1510 } 1508 }
1511 1509
1512 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1510 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1513 } 1511 }
1514 1512
1515 } // namespace net 1513 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698