| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_SPDY_SPDY_SESSION_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_H_ |
| 6 #define NET_SPDY_SPDY_SESSION_H_ | 6 #define NET_SPDY_SPDY_SESSION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // specific SETTINGS value. | 225 // specific SETTINGS value. |
| 226 static void set_max_concurrent_streams(size_t value); | 226 static void set_max_concurrent_streams(size_t value); |
| 227 | 227 |
| 228 // Enable sending of PING frame with each request. | 228 // Enable sending of PING frame with each request. |
| 229 static void set_enable_ping_based_connection_checking(bool enable); | 229 static void set_enable_ping_based_connection_checking(bool enable); |
| 230 | 230 |
| 231 // The initial max concurrent streams per session, can be overridden by the | 231 // The initial max concurrent streams per session, can be overridden by the |
| 232 // server via SETTINGS. | 232 // server via SETTINGS. |
| 233 static void set_init_max_concurrent_streams(size_t value); | 233 static void set_init_max_concurrent_streams(size_t value); |
| 234 | 234 |
| 235 // Sets the initial receive window size for newly created sessions. |
| 236 static void set_default_initial_recv_window_size(size_t value); |
| 237 |
| 235 // Send WINDOW_UPDATE frame, called by a stream whenever receive window | 238 // Send WINDOW_UPDATE frame, called by a stream whenever receive window |
| 236 // size is increased. | 239 // size is increased. |
| 237 void SendWindowUpdate(SpdyStreamId stream_id, int32 delta_window_size); | 240 void SendWindowUpdate(SpdyStreamId stream_id, int32 delta_window_size); |
| 238 | 241 |
| 239 // If session is closed, no new streams/transactions should be created. | 242 // If session is closed, no new streams/transactions should be created. |
| 240 bool IsClosed() const { return state_ == CLOSED; } | 243 bool IsClosed() const { return state_ == CLOSED; } |
| 241 | 244 |
| 242 // Closes this session. This will close all active streams and mark | 245 // Closes this session. This will close all active streams and mark |
| 243 // the session as permanently closed. | 246 // the session as permanently closed. |
| 244 // |err| should not be OK; this function is intended to be called on | 247 // |err| should not be OK; this function is intended to be called on |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 const GURL& url, | 385 const GURL& url, |
| 383 RequestPriority priority, | 386 RequestPriority priority, |
| 384 scoped_refptr<SpdyStream>* spdy_stream, | 387 scoped_refptr<SpdyStream>* spdy_stream, |
| 385 const BoundNetLog& stream_net_log); | 388 const BoundNetLog& stream_net_log); |
| 386 | 389 |
| 387 // IO Callbacks | 390 // IO Callbacks |
| 388 void OnReadComplete(int result); | 391 void OnReadComplete(int result); |
| 389 void OnWriteComplete(int result); | 392 void OnWriteComplete(int result); |
| 390 | 393 |
| 391 // Send relevant SETTINGS. This is generally called on connection setup. | 394 // Send relevant SETTINGS. This is generally called on connection setup. |
| 392 void SendSettings(); | 395 void SendInitialSettings(); |
| 396 |
| 397 // Helper method to send SETTINGS a frame. |
| 398 void SendSettings(const SettingsMap& settings); |
| 393 | 399 |
| 394 // Handle SETTING. Either when we send settings, or when we receive a | 400 // Handle SETTING. Either when we send settings, or when we receive a |
| 395 // SETTINGS control frame, update our SpdySession accordingly. | 401 // SETTINGS control frame, update our SpdySession accordingly. |
| 396 void HandleSetting(uint32 id, uint32 value); | 402 void HandleSetting(uint32 id, uint32 value); |
| 397 | 403 |
| 398 // Adjust the send window size of all ActiveStreams and PendingCreateStreams. | 404 // Adjust the send window size of all ActiveStreams and PendingCreateStreams. |
| 399 void UpdateStreamsSendWindowSize(int32 delta_window_size); | 405 void UpdateStreamsSendWindowSize(int32 delta_window_size); |
| 400 | 406 |
| 401 // Send the PING (preface-PING) frame. | 407 // Send the PING (preface-PING) frame. |
| 402 void SendPrefacePingIfNoneInFlight(); | 408 void SendPrefacePingIfNoneInFlight(); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 private: | 722 private: |
| 717 const int status_; | 723 const int status_; |
| 718 const std::string description_; | 724 const std::string description_; |
| 719 | 725 |
| 720 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySessionCloseParameter); | 726 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySessionCloseParameter); |
| 721 }; | 727 }; |
| 722 | 728 |
| 723 } // namespace net | 729 } // namespace net |
| 724 | 730 |
| 725 #endif // NET_SPDY_SPDY_SESSION_H_ | 731 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |