Commit 90f64ebe authored by rch's avatar rch Committed by Commit bot

Inline two methods of QuicChromiumClientSession

which are only called from one place:

  RecordAndCloseSessionOnError
  CloseSessionOnErrorInner

Review-Url: https://codereview.chromium.org/2849823005
Cr-Commit-Position: refs/heads/master@{#468272}
parent 09d695d1
......@@ -1216,22 +1216,11 @@ void QuicChromiumClientSession::StartReading() {
}
}
void QuicChromiumClientSession::CloseSessionOnError(int error,
void QuicChromiumClientSession::CloseSessionOnError(int net_error,
QuicErrorCode quic_error) {
RecordAndCloseSessionOnError(error, quic_error);
NotifyFactoryOfSessionClosed();
}
void QuicChromiumClientSession::RecordAndCloseSessionOnError(
int error,
QuicErrorCode quic_error) {
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.CloseSessionOnError", -error);
CloseSessionOnErrorInner(error, quic_error);
}
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.CloseSessionOnError",
-net_error);
void QuicChromiumClientSession::CloseSessionOnErrorInner(
int net_error,
QuicErrorCode quic_error) {
if (!callback_.is_null()) {
base::ResetAndReturn(&callback_).Run(net_error);
}
......@@ -1244,6 +1233,8 @@ void QuicChromiumClientSession::CloseSessionOnErrorInner(
connection()->CloseConnection(quic_error, "net error",
ConnectionCloseBehavior::SILENT_CLOSE);
DCHECK(!connection()->connected());
NotifyFactoryOfSessionClosed();
}
void QuicChromiumClientSession::CloseAllStreams(int net_error) {
......
......@@ -222,9 +222,9 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
// and passing the data along to the QuicConnection.
void StartReading();
// Close the session because of |error| and notifies the factory
// Close the session because of |net_error| and notifies the factory
// that this session has been closed, which will delete the session.
void CloseSessionOnError(int error, QuicErrorCode quic_error);
void CloseSessionOnError(int net_error, QuicErrorCode quic_error);
std::unique_ptr<base::Value> GetInfoAsValue(
const std::set<HostPortPair>& aliases);
......@@ -337,18 +337,6 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
void OnClosedStream();
// Close the session because of |error| and records it in UMA histogram.
void RecordAndCloseSessionOnError(int error, QuicErrorCode quic_error);
// A Session may be closed via any of three methods:
// OnConnectionClosed - called by the connection when the connection has been
// closed, perhaps due to a timeout or a protocol error.
// CloseSessionOnError - called from the owner of the session,
// the QuicStreamFactory, when there is an error.
// OnReadComplete - when there is a read error.
// This method closes all stream and performs any necessary cleanup.
void CloseSessionOnErrorInner(int net_error, QuicErrorCode quic_error);
void CloseAllStreams(int net_error);
void CloseAllObservers(int net_error);
void CancelAllRequests(int net_error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment