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

Unified Diff: net/quic/quic_session.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_session.cc
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index ba20d5062291c6c5b03dd21f4ee559b411aa6bba..5b99bb90cd3f354973bc6eb47cc69d1ac831213c 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -45,14 +45,14 @@ class VisitorShim : public QuicConnectionVisitorInterface {
session_->PostProcessAfterData();
}
- virtual void OnWindowUpdateFrames(const vector<QuicWindowUpdateFrame>& frames)
- OVERRIDE {
+ virtual void OnWindowUpdateFrames(
+ const vector<QuicWindowUpdateFrame>& frames) OVERRIDE {
session_->OnWindowUpdateFrames(frames);
session_->PostProcessAfterData();
}
- virtual void OnBlockedFrames(const vector<QuicBlockedFrame>& frames)
- OVERRIDE {
+ virtual void OnBlockedFrames(
+ const vector<QuicBlockedFrame>& frames) OVERRIDE {
session_->OnBlockedFrames(frames);
session_->PostProcessAfterData();
}
@@ -67,15 +67,13 @@ class VisitorShim : public QuicConnectionVisitorInterface {
session_->OnSuccessfulVersionNegotiation(version);
}
- virtual void OnConnectionClosed(
- QuicErrorCode error, bool from_peer) OVERRIDE {
+ virtual void OnConnectionClosed(QuicErrorCode error,
+ bool from_peer) OVERRIDE {
session_->OnConnectionClosed(error, from_peer);
// The session will go away, so don't bother with cleanup.
}
- virtual void OnWriteBlocked() OVERRIDE {
- session_->OnWriteBlocked();
- }
+ virtual void OnWriteBlocked() OVERRIDE { session_->OnWriteBlocked(); }
virtual bool HasPendingWrites() const OVERRIDE {
return session_->HasPendingWrites();
@@ -93,8 +91,7 @@ class VisitorShim : public QuicConnectionVisitorInterface {
QuicSession* session_;
};
-QuicSession::QuicSession(QuicConnection* connection,
- const QuicConfig& config)
+QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
: connection_(connection),
visitor_shim_(new VisitorShim(this)),
config_(config),
@@ -105,7 +102,6 @@ QuicSession::QuicSession(QuicConnection* connection,
goaway_received_(false),
goaway_sent_(false),
has_pending_handshake_(false) {
-
connection_->set_visitor(visitor_shim_.get());
connection_->SetFromConfig(config_);
if (connection_->connected()) {
@@ -172,14 +168,12 @@ void QuicSession::OnStreamHeadersComplete(QuicStreamId stream_id,
void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) {
if (frame.stream_id == kCryptoStreamId) {
connection()->SendConnectionCloseWithDetails(
- QUIC_INVALID_STREAM_ID,
- "Attempt to reset the crypto stream");
+ QUIC_INVALID_STREAM_ID, "Attempt to reset the crypto stream");
return;
}
if (frame.stream_id == kHeadersStreamId) {
connection()->SendConnectionCloseWithDetails(
- QUIC_INVALID_STREAM_ID,
- "Attempt to reset the headers stream");
+ QUIC_INVALID_STREAM_ID, "Attempt to reset the headers stream");
return;
}
QuicDataStream* stream = GetDataStream(frame.stream_id);
@@ -256,8 +250,8 @@ void QuicSession::OnCanWrite() {
return;
}
- QuicConnection::ScopedPacketBundler ack_bundler(
- connection_.get(), QuicConnection::NO_ACK);
+ QuicConnection::ScopedPacketBundler ack_bundler(connection_.get(),
+ QuicConnection::NO_ACK);
for (size_t i = 0; i < num_writes; ++i) {
if (!write_blocked_streams_.HasWriteBlockedStreams()) {
// Writing one stream removed another?! Something's broken.
@@ -299,8 +293,8 @@ QuicConsumedData QuicSession::WritevData(
QuicStreamOffset offset,
bool fin,
QuicAckNotifier::DelegateInterface* ack_notifier_delegate) {
- return connection_->SendStreamData(id, data, offset, fin,
- ack_notifier_delegate);
+ return connection_->SendStreamData(
+ id, data, offset, fin, ack_notifier_delegate);
}
size_t QuicSession::WriteHeaders(
@@ -333,8 +327,7 @@ void QuicSession::CloseStream(QuicStreamId stream_id) {
CloseStreamInner(stream_id, false);
}
-void QuicSession::CloseStreamInner(QuicStreamId stream_id,
- bool locally_reset) {
+void QuicSession::CloseStreamInner(QuicStreamId stream_id, bool locally_reset) {
DVLOG(1) << ENDPOINT << "Closing stream " << stream_id;
DataStreamMap::iterator it = stream_map_.find(stream_id);
@@ -372,10 +365,9 @@ void QuicSession::OnConfigNegotiated() {
uint32 new_flow_control_send_window =
config_.ReceivedInitialFlowControlWindowBytes();
if (new_flow_control_send_window < kDefaultFlowControlSendWindow) {
- LOG(ERROR)
- << "Peer sent us an invalid flow control send window: "
- << new_flow_control_send_window
- << ", below default: " << kDefaultFlowControlSendWindow;
+ LOG(ERROR) << "Peer sent us an invalid flow control send window: "
+ << new_flow_control_send_window
+ << ", below default: " << kDefaultFlowControlSendWindow;
connection_->SendConnectionClose(QUIC_FLOW_CONTROL_ERROR);
return;
}
@@ -402,8 +394,8 @@ void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
break;
case HANDSHAKE_CONFIRMED:
- LOG_IF(DFATAL, !config_.negotiated()) << ENDPOINT
- << "Handshake confirmed without parameter negotiation.";
+ LOG_IF(DFATAL, !config_.negotiated())
+ << ENDPOINT << "Handshake confirmed without parameter negotiation.";
// Discard originally encrypted packets, since they can't be decrypted by
// the peer.
connection_->NeuterUnencryptedPackets();
@@ -503,13 +495,12 @@ QuicDataStream* QuicSession::GetIncomingDataStream(QuicStreamId stream_id) {
}
if (largest_peer_created_stream_id_ == 0) {
if (is_server()) {
- largest_peer_created_stream_id_= 3;
+ largest_peer_created_stream_id_ = 3;
} else {
- largest_peer_created_stream_id_= 1;
+ largest_peer_created_stream_id_ = 1;
}
}
- for (QuicStreamId id = largest_peer_created_stream_id_ + 2;
- id < stream_id;
+ for (QuicStreamId id = largest_peer_created_stream_id_ + 2; id < stream_id;
id += 2) {
implicitly_created_streams_.insert(id);
}
@@ -543,7 +534,7 @@ bool QuicSession::IsClosedStream(QuicStreamId id) {
// For peer created streams, we also need to consider implicitly created
// streams.
return id <= largest_peer_created_stream_id_ &&
- implicitly_created_streams_.count(id) == 0;
+ implicitly_created_streams_.count(id) == 0;
}
size_t QuicSession::GetNumOpenStreams() const {
@@ -580,7 +571,7 @@ void QuicSession::MarkWriteBlocked(QuicStreamId id, QuicPriority priority) {
bool QuicSession::HasDataToWrite() const {
return write_blocked_streams_.HasWriteBlockedStreams() ||
- connection_->HasQueuedData();
+ connection_->HasQueuedData();
}
bool QuicSession::GetSSLInfo(SSLInfo* ssl_info) const {

Powered by Google App Engine
This is Rietveld 408576698