X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fnet%2Fquic%2Fquic_session.h;h=6ca9ce0377e43ded35156b22850c163f8527e907;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=df5c0ebc43822f0a07072c59e316bf54417b1a3f;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/net/quic/quic_session.h b/src/net/quic/quic_session.h index df5c0eb..6ca9ce0 100644 --- a/src/net/quic/quic_session.h +++ b/src/net/quic/quic_session.h @@ -52,29 +52,28 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface { HANDSHAKE_CONFIRMED, }; - QuicSession(QuicConnection* connection, const QuicConfig& config); + QuicSession(QuicConnection* connection, + const QuicConfig& config, + bool is_secure); void InitializeSession(); - virtual ~QuicSession(); + ~QuicSession() override; // QuicConnectionVisitorInterface methods: - virtual void OnStreamFrames( - const std::vector& frames) OVERRIDE; - virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE; - virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE; - virtual void OnWindowUpdateFrames( - const std::vector& frames) OVERRIDE; - virtual void OnBlockedFrames( - const std::vector& frames) OVERRIDE; - virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; - virtual void OnWriteBlocked() OVERRIDE {} - virtual void OnSuccessfulVersionNegotiation( - const QuicVersion& version) OVERRIDE; - virtual void OnCanWrite() OVERRIDE; - virtual void OnCongestionWindowChange(QuicTime now) OVERRIDE {} - virtual bool WillingAndAbleToWrite() const OVERRIDE; - virtual bool HasPendingHandshake() const OVERRIDE; - virtual bool HasOpenDataStreams() const OVERRIDE; + void OnStreamFrames(const std::vector& frames) override; + void OnRstStream(const QuicRstStreamFrame& frame) override; + void OnGoAway(const QuicGoAwayFrame& frame) override; + void OnWindowUpdateFrames( + const std::vector& frames) override; + void OnBlockedFrames(const std::vector& frames) override; + void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; + void OnWriteBlocked() override {} + void OnSuccessfulVersionNegotiation(const QuicVersion& version) override; + void OnCanWrite() override; + void OnCongestionWindowChange(QuicTime now) override {} + bool WillingAndAbleToWrite() const override; + bool HasPendingHandshake() const override; + bool HasOpenDataStreams() const override; // Called by the headers stream when headers have been received for a stream. virtual void OnStreamHeaders(QuicStreamId stream_id, @@ -206,18 +205,29 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface { QuicFlowController* flow_controller() { return flow_controller_.get(); } + // Returns true if connection is flow controller blocked. + bool IsConnectionFlowControlBlocked() const; + + // Returns true if any stream is flow controller blocked. + bool IsStreamFlowControlBlocked(); + + // Returns true if this is a secure QUIC session. + bool is_secure() const { + return is_secure_; + } + size_t get_max_open_streams() const { return max_open_streams_; } protected: typedef base::hash_map DataStreamMap; // Creates a new stream, owned by the caller, to handle a peer-initiated - // stream. Returns NULL and does error handling if the stream can not be + // stream. Returns nullptr and does error handling if the stream can not be // created. virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) = 0; // Create a new stream, owned by the caller, to handle a locally-initiated - // stream. Returns NULL if max streams have already been opened. + // stream. Returns nullptr if max streams have already been opened. virtual QuicDataStream* CreateOutgoingDataStream() = 0; // Return the reserved crypto stream. @@ -323,6 +333,9 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface { // Used for session level flow control. scoped_ptr flow_controller_; + // True if this is a secure (HTTPS) QUIC session. + bool is_secure_; + DISALLOW_COPY_AND_ASSIGN(QuicSession); };