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

Side by Side Diff: net/quic/quic_stream_factory.cc

Issue 183853028: Add a histogram to track the number of QUIC packets received by a QUIC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('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/quic/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 QuicClientSession* session = active_sessions_[host_port_proxy_pair]; 418 QuicClientSession* session = active_sessions_[host_port_proxy_pair];
419 DCHECK(session); 419 DCHECK(session);
420 return scoped_ptr<QuicHttpStream>( 420 return scoped_ptr<QuicHttpStream>(
421 new QuicHttpStream(session->GetWeakPtr())); 421 new QuicHttpStream(session->GetWeakPtr()));
422 } 422 }
423 423
424 void QuicStreamFactory::OnIdleSession(QuicClientSession* session) { 424 void QuicStreamFactory::OnIdleSession(QuicClientSession* session) {
425 } 425 }
426 426
427 void QuicStreamFactory::OnSessionGoingAway(QuicClientSession* session) { 427 void QuicStreamFactory::OnSessionGoingAway(QuicClientSession* session) {
428 const QuicConnectionStats& stats = session->connection()->GetStats();
428 const AliasSet& aliases = session_aliases_[session]; 429 const AliasSet& aliases = session_aliases_[session];
429 for (AliasSet::const_iterator it = aliases.begin(); it != aliases.end(); 430 for (AliasSet::const_iterator it = aliases.begin(); it != aliases.end();
430 ++it) { 431 ++it) {
431 DCHECK(active_sessions_.count(*it)); 432 DCHECK(active_sessions_.count(*it));
432 DCHECK_EQ(session, active_sessions_[*it]); 433 DCHECK_EQ(session, active_sessions_[*it]);
433 active_sessions_.erase(*it); 434 active_sessions_.erase(*it);
434 if (!http_server_properties_) 435 if (!http_server_properties_)
435 continue; 436 continue;
436 437
437 if (!session->IsCryptoHandshakeConfirmed()) { 438 if (!session->IsCryptoHandshakeConfirmed()) {
438 // TODO(rch): In the special case where the session has received no 439 // TODO(rch): In the special case where the session has received no
439 // packets from the peer, we should consider blacklisting this 440 // packets from the peer, we should consider blacklisting this
440 // differently so that we still race TCP but we don't consider the 441 // differently so that we still race TCP but we don't consider the
441 // session connected until the handshake has been confirmed. 442 // session connected until the handshake has been confirmed.
442 http_server_properties_->SetBrokenAlternateProtocol(it->first); 443 http_server_properties_->SetBrokenAlternateProtocol(it->first);
444 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived",
445 stats.packets_received);
443 } else { 446 } else {
444 QuicConnectionStats stats = session->connection()->GetStats(); 447 QuicConnectionStats stats = session->connection()->GetStats();
jar (doing other things) 2014/03/06 22:28:25 nit: Can we delete this since you pulled it out of
Ryan Hamilton 2014/03/06 22:42:58 Done. Also added a continue to the previous block
445 HttpServerProperties::NetworkStats network_stats; 448 HttpServerProperties::NetworkStats network_stats;
446 network_stats.rtt = base::TimeDelta::FromMicroseconds(stats.rtt); 449 network_stats.rtt = base::TimeDelta::FromMicroseconds(stats.rtt);
447 network_stats.bandwidth_estimate = stats.estimated_bandwidth; 450 network_stats.bandwidth_estimate = stats.estimated_bandwidth;
448 http_server_properties_->SetServerNetworkStats( 451 http_server_properties_->SetServerNetworkStats(
449 it->first, network_stats); 452 it->first, network_stats);
450 } 453 }
451 } 454 }
452 IPEndPoint peer_address = session->connection()->peer_address(); 455 IPEndPoint peer_address = session->connection()->peer_address();
453 ip_aliases_[peer_address].erase(session); 456 ip_aliases_[peer_address].erase(session);
454 if (ip_aliases_[peer_address].empty()) { 457 if (ip_aliases_[peer_address].empty()) {
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 // Copy the CachedState for the canonical server from canonical_crypto_config 688 // Copy the CachedState for the canonical server from canonical_crypto_config
686 // as the initial CachedState for the server_hostname in crypto_config. 689 // as the initial CachedState for the server_hostname in crypto_config.
687 crypto_config->InitializeFrom(server_hostname, 690 crypto_config->InitializeFrom(server_hostname,
688 canonical_host_port_proxy_pair.first.host(), 691 canonical_host_port_proxy_pair.first.host(),
689 canonical_crypto_config); 692 canonical_crypto_config);
690 // Update canonical version to point at the "most recent" crypto_config. 693 // Update canonical version to point at the "most recent" crypto_config.
691 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair; 694 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair;
692 } 695 }
693 696
694 } // namespace net 697 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698