| Index: net/quic/quic_client_session.cc
|
| diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
|
| index 1e51f0daf4ab1ae9c240832056f887417ac85e88..de229502f699df4c8a7ec3d60fc6c7ea1016df68 100644
|
| --- a/net/quic/quic_client_session.cc
|
| +++ b/net/quic/quic_client_session.cc
|
| @@ -42,18 +42,18 @@ enum Location {
|
| };
|
|
|
| void RecordUnexpectedOpenStreams(Location location) {
|
| - UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.UnexpectedOpenStreams", location,
|
| - NUM_LOCATIONS);
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Net.QuicSession.UnexpectedOpenStreams", location, NUM_LOCATIONS);
|
| }
|
|
|
| void RecordUnexpectedObservers(Location location) {
|
| - UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.UnexpectedObservers", location,
|
| - NUM_LOCATIONS);
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Net.QuicSession.UnexpectedObservers", location, NUM_LOCATIONS);
|
| }
|
|
|
| void RecordUnexpectedNotGoingAway(Location location) {
|
| - UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.UnexpectedNotGoingAway", location,
|
| - NUM_LOCATIONS);
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Net.QuicSession.UnexpectedNotGoingAway", location, NUM_LOCATIONS);
|
| }
|
|
|
| // Note: these values must be kept in sync with the corresponding values in:
|
| @@ -67,13 +67,14 @@ enum HandshakeState {
|
| };
|
|
|
| void RecordHandshakeState(HandshakeState state) {
|
| - UMA_HISTOGRAM_ENUMERATION("Net.QuicHandshakeState", state,
|
| - NUM_HANDSHAKE_STATES);
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Net.QuicHandshakeState", state, NUM_HANDSHAKE_STATES);
|
| }
|
|
|
| } // namespace
|
|
|
| -QuicClientSession::StreamRequest::StreamRequest() : stream_(NULL) {}
|
| +QuicClientSession::StreamRequest::StreamRequest() : stream_(NULL) {
|
| +}
|
|
|
| QuicClientSession::StreamRequest::~StreamRequest() {
|
| CancelRequest();
|
| @@ -138,18 +139,18 @@ QuicClientSession::QuicClientSession(
|
| going_away_(false),
|
| weak_factory_(this) {
|
| crypto_stream_.reset(
|
| - crypto_client_stream_factory ?
|
| - crypto_client_stream_factory->CreateQuicCryptoClientStream(
|
| - server_id, this, crypto_config) :
|
| - new QuicCryptoClientStream(server_id, this,
|
| - new ProofVerifyContextChromium(net_log_),
|
| - crypto_config));
|
| + crypto_client_stream_factory
|
| + ? crypto_client_stream_factory->CreateQuicCryptoClientStream(
|
| + server_id, this, crypto_config)
|
| + : new QuicCryptoClientStream(server_id,
|
| + this,
|
| + new ProofVerifyContextChromium(net_log_),
|
| + crypto_config));
|
|
|
| connection->set_debug_visitor(&logger_);
|
| // TODO(rch): pass in full host port proxy pair
|
| - net_log_.BeginEvent(
|
| - NetLog::TYPE_QUIC_SESSION,
|
| - NetLog::StringCallback("host", &server_id.host()));
|
| + net_log_.BeginEvent(NetLog::TYPE_QUIC_SESSION,
|
| + NetLog::StringCallback("host", &server_id.host()));
|
| }
|
|
|
| QuicClientSession::~QuicClientSession() {
|
| @@ -160,8 +161,7 @@ QuicClientSession::~QuicClientSession() {
|
| if (!going_away_)
|
| RecordUnexpectedNotGoingAway(DESTRUCTOR);
|
|
|
| - while (!streams()->empty() ||
|
| - !observers_.empty() ||
|
| + while (!streams()->empty() || !observers_.empty() ||
|
| !stream_requests_.empty()) {
|
| // The session must be closed before it is destroyed.
|
| DCHECK(streams()->empty());
|
| @@ -211,18 +211,30 @@ QuicClientSession::~QuicClientSession() {
|
| if (!GetSSLInfo(&ssl_info) || !ssl_info.cert) {
|
| if (port_selected) {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectSelectPortForHTTP",
|
| - round_trip_handshakes, 0, 3, 4);
|
| + round_trip_handshakes,
|
| + 0,
|
| + 3,
|
| + 4);
|
| } else {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectRandomPortForHTTP",
|
| - round_trip_handshakes, 0, 3, 4);
|
| + round_trip_handshakes,
|
| + 0,
|
| + 3,
|
| + 4);
|
| }
|
| } else {
|
| if (port_selected) {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectSelectPortForHTTPS",
|
| - round_trip_handshakes, 0, 3, 4);
|
| + round_trip_handshakes,
|
| + 0,
|
| + 3,
|
| + 4);
|
| } else {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectRandomPortForHTTPS",
|
| - round_trip_handshakes, 0, 3, 4);
|
| + round_trip_handshakes,
|
| + 0,
|
| + 3,
|
| + 4);
|
| }
|
| }
|
| }
|
| @@ -239,7 +251,8 @@ void QuicClientSession::OnStreamFrames(
|
| frames_per_stream[frames[i].stream_id]++;
|
| }
|
| for (FrameCounter::const_iterator it = frames_per_stream.begin();
|
| - it != frames_per_stream.end(); ++it) {
|
| + it != frames_per_stream.end();
|
| + ++it) {
|
| UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesPerStreamInPacket",
|
| it->second);
|
| }
|
| @@ -372,12 +385,11 @@ bool QuicClientSession::GetSSLInfo(SSLInfo* ssl_info) const {
|
| return false;
|
| }
|
| int ssl_connection_status = 0;
|
| + ssl_connection_status |= (cipher_suite & SSL_CONNECTION_CIPHERSUITE_MASK)
|
| + << SSL_CONNECTION_CIPHERSUITE_SHIFT;
|
| ssl_connection_status |=
|
| - (cipher_suite & SSL_CONNECTION_CIPHERSUITE_MASK) <<
|
| - SSL_CONNECTION_CIPHERSUITE_SHIFT;
|
| - ssl_connection_status |=
|
| - (SSL_CONNECTION_VERSION_QUIC & SSL_CONNECTION_VERSION_MASK) <<
|
| - SSL_CONNECTION_VERSION_SHIFT;
|
| + (SSL_CONNECTION_VERSION_QUIC & SSL_CONNECTION_VERSION_MASK)
|
| + << SSL_CONNECTION_VERSION_SHIFT;
|
|
|
| ssl_info->public_key_hashes = cert_verify_result_->public_key_hashes;
|
| ssl_info->is_issued_by_known_root =
|
| @@ -401,8 +413,8 @@ int QuicClientSession::CryptoConnect(bool require_confirmation,
|
| return ERR_CONNECTION_FAILED;
|
| }
|
|
|
| - bool can_notify = require_confirmation_ ?
|
| - IsCryptoHandshakeConfirmed() : IsEncryptionEstablished();
|
| + bool can_notify = require_confirmation_ ? IsCryptoHandshakeConfirmed()
|
| + : IsEncryptionEstablished();
|
| if (can_notify) {
|
| return OK;
|
| }
|
| @@ -429,8 +441,7 @@ bool QuicClientSession::CanPool(const std::string& hostname) const {
|
| return ssl_info.cert->VerifyNameMatch(hostname, &unused);
|
| }
|
|
|
| -QuicDataStream* QuicClientSession::CreateIncomingDataStream(
|
| - QuicStreamId id) {
|
| +QuicDataStream* QuicClientSession::CreateIncomingDataStream(QuicStreamId id) {
|
| DLOG(ERROR) << "Server push not supported";
|
| return NULL;
|
| }
|
| @@ -438,9 +449,9 @@ QuicDataStream* QuicClientSession::CreateIncomingDataStream(
|
| void QuicClientSession::CloseStream(QuicStreamId stream_id) {
|
| ReliableQuicStream* stream = GetStream(stream_id);
|
| if (stream) {
|
| - logger_.UpdateReceivedFrameCounts(
|
| - stream_id, stream->num_frames_received(),
|
| - stream->num_duplicate_frames_received());
|
| + logger_.UpdateReceivedFrameCounts(stream_id,
|
| + stream->num_frames_received(),
|
| + stream->num_duplicate_frames_received());
|
| }
|
| QuicSession::CloseStream(stream_id);
|
| OnClosedStream();
|
| @@ -455,11 +466,8 @@ void QuicClientSession::SendRstStream(QuicStreamId id,
|
|
|
| void QuicClientSession::OnClosedStream() {
|
| if (GetNumOpenStreams() < get_max_open_streams() &&
|
| - !stream_requests_.empty() &&
|
| - crypto_stream_->encryption_established() &&
|
| - !goaway_received() &&
|
| - !going_away_ &&
|
| - connection()->connected()) {
|
| + !stream_requests_.empty() && crypto_stream_->encryption_established() &&
|
| + !goaway_received() && !going_away_ && connection()->connected()) {
|
| StreamRequest* request = stream_requests_.front();
|
| stream_requests_.pop_front();
|
| request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl());
|
| @@ -566,8 +574,8 @@ void QuicClientSession::OnProofValid(
|
| void QuicClientSession::OnProofVerifyDetailsAvailable(
|
| const ProofVerifyDetails& verify_details) {
|
| const CertVerifyResult* cert_verify_result_other =
|
| - &(reinterpret_cast<const ProofVerifyDetailsChromium*>(
|
| - &verify_details))->cert_verify_result;
|
| + &(reinterpret_cast<const ProofVerifyDetailsChromium*>(&verify_details))
|
| + ->cert_verify_result;
|
| CertVerifyResult* result_copy = new CertVerifyResult;
|
| result_copy->CopyFrom(*cert_verify_result_other);
|
| cert_verify_result_.reset(result_copy);
|
| @@ -595,7 +603,8 @@ void QuicClientSession::StartReading() {
|
| base::MessageLoop::current()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&QuicClientSession::OnReadComplete,
|
| - weak_factory_.GetWeakPtr(), rv));
|
| + weak_factory_.GetWeakPtr(),
|
| + rv));
|
| } else {
|
| OnReadComplete(rv);
|
| }
|
| @@ -614,9 +623,8 @@ void QuicClientSession::CloseSessionOnErrorInner(int net_error,
|
| }
|
| CloseAllStreams(net_error);
|
| CloseAllObservers(net_error);
|
| - net_log_.AddEvent(
|
| - NetLog::TYPE_QUIC_SESSION_CLOSE_ON_ERROR,
|
| - NetLog::IntegerCallback("net_error", net_error));
|
| + net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_CLOSE_ON_ERROR,
|
| + NetLog::IntegerCallback("net_error", net_error));
|
|
|
| connection()->CloseConnection(quic_error, false);
|
| DCHECK(!connection()->connected());
|
| @@ -655,7 +663,8 @@ base::Value* QuicClientSession::GetInfoAsValue(
|
|
|
| base::ListValue* alias_list = new base::ListValue();
|
| for (std::set<HostPortPair>::const_iterator it = aliases.begin();
|
| - it != aliases.end(); it++) {
|
| + it != aliases.end();
|
| + it++) {
|
| alias_list->Append(new base::StringValue(it->ToString()));
|
| }
|
| dict->Set("aliases", alias_list);
|
|
|