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

Unified Diff: net/quic/quic_session.cc

Issue 1659733003: Remove VisitorShim and move shim behavior into QuicConnection. No (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@112975672
Patch Set: Created 4 years, 11 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
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session.cc
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index c57dc1ed35f047153eb6880726c21ae2d8dea703..6d5496eeafd66803e7c60dcf090ccc20555a6d15 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -30,82 +30,8 @@ namespace net {
#define ENDPOINT \
(perspective() == Perspective::IS_SERVER ? "Server: " : " Client: ")
-// We want to make sure we delete any closed streams in a safe manner.
-// To avoid deleting a stream in mid-operation, we have a simple shim between
-// us and the stream, so we can delete any streams when we return from
-// processing.
-//
-// We could just override the base methods, but this makes it easier to make
-// sure we don't miss any.
-class VisitorShim : public QuicConnectionVisitorInterface {
- public:
- explicit VisitorShim(QuicSession* session) : session_(session) {}
-
- void OnStreamFrame(const QuicStreamFrame& frame) override {
- session_->OnStreamFrame(frame);
- session_->PostProcessAfterData();
- }
- void OnRstStream(const QuicRstStreamFrame& frame) override {
- session_->OnRstStream(frame);
- session_->PostProcessAfterData();
- }
-
- void OnGoAway(const QuicGoAwayFrame& frame) override {
- session_->OnGoAway(frame);
- session_->PostProcessAfterData();
- }
-
- void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override {
- session_->OnWindowUpdateFrame(frame);
- session_->PostProcessAfterData();
- }
-
- void OnBlockedFrame(const QuicBlockedFrame& frame) override {
- session_->OnBlockedFrame(frame);
- session_->PostProcessAfterData();
- }
-
- void OnCanWrite() override {
- session_->OnCanWrite();
- session_->PostProcessAfterData();
- }
-
- void OnCongestionWindowChange(QuicTime now) override {
- session_->OnCongestionWindowChange(now);
- }
-
- void OnSuccessfulVersionNegotiation(const QuicVersion& version) override {
- session_->OnSuccessfulVersionNegotiation(version);
- }
-
- void OnConnectionClosed(QuicErrorCode error, bool from_peer) override {
- session_->OnConnectionClosed(error, from_peer);
- // The session will go away, so don't bother with cleanup.
- }
-
- void OnWriteBlocked() override { session_->OnWriteBlocked(); }
-
- void OnConnectionMigration() override { session_->OnConnectionMigration(); }
-
- bool WillingAndAbleToWrite() const override {
- return session_->WillingAndAbleToWrite();
- }
-
- bool HasPendingHandshake() const override {
- return session_->HasPendingHandshake();
- }
-
- bool HasOpenDynamicStreams() const override {
- return session_->HasOpenDynamicStreams();
- }
-
- private:
- QuicSession* session_;
-};
-
QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
: connection_(connection),
- visitor_shim_(new VisitorShim(this)),
config_(config),
max_open_streams_(config_.MaxStreamsPerConnection()),
next_outgoing_stream_id_(perspective() == Perspective::IS_SERVER ? 2 : 3),
@@ -124,7 +50,7 @@ QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
currently_writing_stream_id_(0) {}
void QuicSession::Initialize() {
- connection_->set_visitor(visitor_shim_.get());
+ connection_->set_visitor(this);
connection_->SetFromConfig(config_);
DCHECK_EQ(kCryptoStreamId, GetCryptoStream()->id());
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698