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

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

Issue 2621983004: Improve HttpStreamFactory NetLog events (Closed)
Patch Set: 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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 CHECK_EQ(STATE_NONE, next_state_); 678 CHECK_EQ(STATE_NONE, next_state_);
679 next_state_ = STATE_START; 679 next_state_ = STATE_START;
680 int rv = RunLoop(OK); 680 int rv = RunLoop(OK);
681 DCHECK_EQ(ERR_IO_PENDING, rv); 681 DCHECK_EQ(ERR_IO_PENDING, rv);
682 return rv; 682 return rv;
683 } 683 }
684 684
685 int HttpStreamFactoryImpl::Job::DoStart() { 685 int HttpStreamFactoryImpl::Job::DoStart() {
686 const NetLogWithSource* net_log = delegate_->GetNetLog(this); 686 const NetLogWithSource* net_log = delegate_->GetNetLog(this);
687 687
688 if (net_log) { 688 net_log_.BeginEvent(
689 net_log_.BeginEvent( 689 NetLogEventType::HTTP_STREAM_JOB,
690 NetLogEventType::HTTP_STREAM_JOB, 690 base::Bind(&NetLogHttpStreamJobCallback, net_log->source(),
691 base::Bind(&NetLogHttpStreamJobCallback, net_log->source(), 691 &request_info_.url, &origin_url_, &alternative_service_,
692 &request_info_.url, &origin_url_, &alternative_service_, 692 priority_));
693 priority_)); 693 net_log->AddEvent(NetLogEventType::HTTP_STREAM_REQUEST_STARTED_JOB,
694 net_log->AddEvent(NetLogEventType::HTTP_STREAM_REQUEST_STARTED_JOB, 694 net_log_.source().ToEventParametersCallback());
695 net_log_.source().ToEventParametersCallback());
696 }
697 695
698 // Don't connect to restricted ports. 696 // Don't connect to restricted ports.
699 if (!IsPortAllowedForScheme(destination_.port(), 697 if (!IsPortAllowedForScheme(destination_.port(),
700 request_info_.url.scheme())) { 698 request_info_.url.scheme())) {
701 return ERR_UNSAFE_PORT; 699 return ERR_UNSAFE_PORT;
702 } 700 }
703 701
704 next_state_ = STATE_RESOLVE_PROXY; 702 next_state_ = STATE_RESOLVE_PROXY;
705 return OK; 703 return OK;
706 } 704 }
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1503
1506 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1504 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1507 if (connection_->socket()) { 1505 if (connection_->socket()) {
1508 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1506 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1509 } 1507 }
1510 1508
1511 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1509 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1512 } 1510 }
1513 1511
1514 } // namespace net 1512 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698