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

Unified Diff: net/tools/quic/quic_dispatcher.h

Issue 123303003: Move all the packet parsing logic into QuicDispatcher from the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher.h
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index 58a4c0c14232c4aa894d39428e5dcb38dff6bb5d..0cc978be240be0a82b7fe923040be400a7f695ff 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -76,8 +76,6 @@ class QuicDispatcher : public QuicPacketWriter, public QuicSessionOwner {
// an existing session, or passing it to the TimeWaitListManager.
virtual void ProcessPacket(const IPEndPoint& server_address,
const IPEndPoint& client_address,
- QuicGuid guid,
- bool has_version_flag,
const QuicEncryptedPacket& packet);
// Called when the underyling connection becomes writable to allow
@@ -128,13 +126,36 @@ class QuicDispatcher : public QuicPacketWriter, public QuicSessionOwner {
return supported_versions_;
}
+ protected:
+ // Called by |framer_visitor_| when the public header has been parsed.
+ virtual bool OnUnauthenticatedPublicHeader(
+ const QuicPacketPublicHeader& header);
+
+ // Information about the packet currently being dispatched.
+ const IPEndPoint& current_client_address() {
+ return current_client_address_;
+ }
+ const IPEndPoint& current_server_address() {
+ return current_server_address_;
+ }
+ const QuicEncryptedPacket& current_packet() {
+ return *current_packet_;
+ }
+
private:
+ class QuicFramerVisitor;
friend class net::tools::test::QuicDispatcherPeer;
+ // Called by |framer_visitor_| when the private header has been parsed
+ // of a data packet that is destined for the time wait manager.
+ void OnUnauthenticatedHeader(const QuicPacketHeader& header);
+
// Removes the session from the session map and write blocked list, and
// adds the GUID to the time-wait list.
void CleanUpSession(SessionMap::iterator it);
+ bool HandlePacketForTimeWait(const QuicPacketPublicHeader& header);
+
// The list of connections waiting to write.
WriteBlockedList write_blocked_list_;
@@ -170,6 +191,14 @@ class QuicDispatcher : public QuicPacketWriter, public QuicSessionOwner {
// skipped as necessary).
const QuicVersionVector supported_versions_;
+ // Information about the packet currently being handled.
+ IPEndPoint current_client_address_;
+ IPEndPoint current_server_address_;
+ const QuicEncryptedPacket* current_packet_;
+
+ QuicFramer framer_;
+ scoped_ptr<QuicFramerVisitor> framer_visitor_;
+
DISALLOW_COPY_AND_ASSIGN(QuicDispatcher);
};
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698