Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / net / tools / quic / quic_server_session.h
index ffd8b0a..87f82d9 100644 (file)
@@ -40,19 +40,23 @@ class QuicServerSessionVisitor {
 
   virtual void OnConnectionClosed(QuicConnectionId connection_id,
                                   QuicErrorCode error) = 0;
-  virtual void OnWriteBlocked(QuicBlockedWriterInterface* writer) = 0;
+  virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0;
 };
 
 class QuicServerSession : public QuicSession {
  public:
   QuicServerSession(const QuicConfig& config,
-                    QuicConnection *connection,
+                    QuicConnectionconnection,
                     QuicServerSessionVisitor* visitor);
 
   // Override the base class to notify the owner of the connection close.
   virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
   virtual void OnWriteBlocked() OVERRIDE;
 
+  // Sends a server config update to the client, containing new bandwidth
+  // estimate.
+  virtual void OnCongestionWindowChange(QuicTime now) OVERRIDE;
+
   virtual ~QuicServerSession();
 
   virtual void InitializeSession(const QuicCryptoServerConfig& crypto_config);
@@ -61,6 +65,13 @@ class QuicServerSession : public QuicSession {
     return crypto_stream_.get();
   }
 
+  // Override base class to process FEC config received from client.
+  virtual void OnConfigNegotiated() OVERRIDE;
+
+  void set_serving_region(string serving_region) {
+    serving_region_ = serving_region;
+  }
+
  protected:
   // QuicSession methods:
   virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE;
@@ -73,7 +84,7 @@ class QuicServerSession : public QuicSession {
   virtual bool ShouldCreateIncomingDataStream(QuicStreamId id);
 
   virtual QuicCryptoServerStream* CreateQuicCryptoServerStream(
-    const QuicCryptoServerConfig& crypto_config);
+      const QuicCryptoServerConfig& crypto_config);
 
  private:
   friend class test::QuicServerSessionPeer;
@@ -81,6 +92,16 @@ class QuicServerSession : public QuicSession {
   scoped_ptr<QuicCryptoServerStream> crypto_stream_;
   QuicServerSessionVisitor* visitor_;
 
+  // The most recent bandwidth estimate sent to the client.
+  QuicBandwidth bandwidth_estimate_sent_to_client_;
+
+  // Text describing server location. Sent to the client as part of the bandwith
+  // estimate in the source-address token. Optional, can be left empty.
+  string serving_region_;
+
+  // Time at which we send the last SCUP to the client.
+  QuicTime last_server_config_update_time_;
+
   DISALLOW_COPY_AND_ASSIGN(QuicServerSession);
 };