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

Unified Diff: net/quic/quic_session.h

Issue 2132623002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing comment about RPCs Created 4 years, 5 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_server_session_base_test.cc ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session.h
diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h
index 46c22d3c3438b9003a2f5ea5ef2c5530351e3a14..16f96c77ae81f5fc59ad393e9c94f0b020925893 100644
--- a/net/quic/quic_session.h
+++ b/net/quic/quic_session.h
@@ -17,6 +17,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/containers/small_map.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_endpoint.h"
@@ -227,7 +228,11 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
bool ShouldYield(QuicStreamId stream_id);
protected:
- typedef std::unordered_map<QuicStreamId, ReliableQuicStream*> StreamMap;
+ using StaticStreamMap =
+ base::SmallMap<std::unordered_map<QuicStreamId, ReliableQuicStream*>, 2>;
+
+ using DynamicStreamMap =
+ base::SmallMap<std::unordered_map<QuicStreamId, ReliableQuicStream*>, 10>;
// Creates a new stream to handle a peer-initiated stream.
// Caller does not own the returned stream.
@@ -273,11 +278,13 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
// Return true if given stream is peer initiated.
bool IsIncomingStream(QuicStreamId id) const;
- StreamMap& static_streams() { return static_stream_map_; }
- const StreamMap& static_streams() const { return static_stream_map_; }
+ StaticStreamMap& static_streams() { return static_stream_map_; }
+ const StaticStreamMap& static_streams() const { return static_stream_map_; }
- StreamMap& dynamic_streams() { return dynamic_stream_map_; }
- const StreamMap& dynamic_streams() const { return dynamic_stream_map_; }
+ DynamicStreamMap& dynamic_streams() { return dynamic_stream_map_; }
+ const DynamicStreamMap& dynamic_streams() const {
+ return dynamic_stream_map_;
+ }
std::vector<ReliableQuicStream*>* closed_streams() {
return &closed_streams_;
@@ -367,10 +374,10 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
// Static streams, such as crypto and header streams. Owned by child classes
// that create these streams.
- StreamMap static_stream_map_;
+ StaticStreamMap static_stream_map_;
// Map from StreamId to pointers to streams. Owns the streams.
- StreamMap dynamic_stream_map_;
+ DynamicStreamMap dynamic_stream_map_;
// The ID to use for the next outgoing stream.
QuicStreamId next_outgoing_stream_id_;
« no previous file with comments | « net/quic/quic_server_session_base_test.cc ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698