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

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

Issue 2944443002: Add NetLog events for HttpStreamFactoryImpl::Job throttle logic (Closed)
Patch Set: self Created 3 years, 6 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
« no previous file with comments | « no previous file | net/log/net_log_event_type_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 return OK; 797 return OK;
798 base::Closure callback = 798 base::Closure callback =
799 base::Bind(&HttpStreamFactoryImpl::Job::ResumeInitConnection, 799 base::Bind(&HttpStreamFactoryImpl::Job::ResumeInitConnection,
800 ptr_factory_.GetWeakPtr()); 800 ptr_factory_.GetWeakPtr());
801 if (session_->spdy_session_pool()->StartRequest(spdy_session_key_, 801 if (session_->spdy_session_pool()->StartRequest(spdy_session_key_,
802 callback)) { 802 callback)) {
803 return OK; 803 return OK;
804 } 804 }
805 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 805 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
806 FROM_HERE, callback, base::TimeDelta::FromMilliseconds(kHTTP2ThrottleMs)); 806 FROM_HERE, callback, base::TimeDelta::FromMilliseconds(kHTTP2ThrottleMs));
807 net_log_.AddEvent(NetLogEventType::HTTP_STREAM_JOB_THROTTLED);
807 return ERR_IO_PENDING; 808 return ERR_IO_PENDING;
808 } 809 }
809 810
810 void HttpStreamFactoryImpl::Job::ResumeInitConnection() { 811 void HttpStreamFactoryImpl::Job::ResumeInitConnection() {
811 if (init_connection_already_resumed_) 812 if (init_connection_already_resumed_)
812 return; 813 return;
814 net_log_.AddEvent(NetLogEventType::HTTP_STREAM_JOB_RESUME_INIT_CONNECTION);
813 // TODO(xunjieli): Change this to a DCHECK once crbug.com/718576 is stable. 815 // TODO(xunjieli): Change this to a DCHECK once crbug.com/718576 is stable.
814 CHECK_EQ(next_state_, STATE_INIT_CONNECTION); 816 CHECK_EQ(next_state_, STATE_INIT_CONNECTION);
815 init_connection_already_resumed_ = true; 817 init_connection_already_resumed_ = true;
816 OnIOComplete(OK); 818 OnIOComplete(OK);
817 } 819 }
818 820
819 int HttpStreamFactoryImpl::Job::DoInitConnection() { 821 int HttpStreamFactoryImpl::Job::DoInitConnection() {
820 net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_JOB_INIT_CONNECTION); 822 net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_JOB_INIT_CONNECTION);
821 int result = DoInitConnectionImpl(); 823 int result = DoInitConnectionImpl();
822 if (result != ERR_SPDY_SESSION_ALREADY_EXISTS) 824 if (result != ERR_SPDY_SESSION_ALREADY_EXISTS)
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 bool enable_ip_based_pooling, 1498 bool enable_ip_based_pooling,
1497 NetLog* net_log) { 1499 NetLog* net_log) {
1498 return base::MakeUnique<HttpStreamFactoryImpl::Job>( 1500 return base::MakeUnique<HttpStreamFactoryImpl::Job>(
1499 delegate, job_type, session, request_info, priority, proxy_info, 1501 delegate, job_type, session, request_info, priority, proxy_info,
1500 server_ssl_config, proxy_ssl_config, destination, origin_url, 1502 server_ssl_config, proxy_ssl_config, destination, origin_url,
1501 kProtoUnknown, alternative_proxy_server, enable_ip_based_pooling, 1503 kProtoUnknown, alternative_proxy_server, enable_ip_based_pooling,
1502 net_log); 1504 net_log);
1503 } 1505 }
1504 1506
1505 } // namespace net 1507 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/log/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698