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

Unified Diff: net/spdy/spdy_session.h

Issue 6800009: Attn: Mike Belshe Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 8 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
Index: net/spdy/spdy_session.h
===================================================================
--- net/spdy/spdy_session.h (revision 80449)
+++ net/spdy/spdy_session.h (working copy)
@@ -25,6 +25,7 @@
#include "net/base/upload_data_stream.h"
#include "net/socket/client_socket.h"
#include "net/socket/client_socket_handle.h"
+#include "net/socket/sctp_client_socket_pool.h"
#include "net/socket/tcp_client_socket_pool.h"
#include "net/spdy/spdy_framer.h"
#include "net/spdy/spdy_io_buffer.h"
@@ -37,6 +38,9 @@
// reasonably with ethernet. Chop the world into 2-packet chunks. This is
// somewhat arbitrary, but is reasonably small and ensures that we elicit
// ACKs quickly from TCP (because TCP tries to only ACK every other packet).
+// TODO(jtl): Replace kMss with kMss_TCP = 1430 and kMss_SCTP = 1452 and set
+// MaxSpdyFrameChunkSize appropriately, based on which transport protocol we're
+// using.
const int kMss = 1430;
const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::size();
@@ -59,6 +63,12 @@
SpdySessionPool* spdy_session_pool,
SpdySettingsStorage* spdy_settings,
NetLog* net_log);
+ typedef void (SpdySession::*OnTransportConnect)(int result);
+ SpdySession(const HostPortProxyPair& host_port_proxy_pair,
+ SpdySessionPool* spdy_session_pool,
+ SpdySettingsStorage* spdy_settings,
+ OnTransportConnect on_transport_connect,
+ NetLog* net_log);
const HostPortPair& host_port_pair() const {
return host_port_proxy_pair_.first;
@@ -186,6 +196,31 @@
return connection_->socket()->WasEverUsed();
}
+ // Returns true if the underling socket's transport protocol is SCTP.
+ bool using_sctp() {
+ if (connection_.get()->is_initialized())
+ return connection_.get()->socket()->protocol() ==
+ IPPROTO_SCTP ? true : false;
+ else
+ // TODO(jtl): return sctp_enabled() here?
+ return false;
+ }
+
+ // Returns true if the underlying socket's transport protocol is SCTP and SPDY
+ // control frames are being sent on SCTP stream 0.
+ bool using_sctp_control_stream() {
+ if (connection_.get()->is_initialized())
+ return connection_.get()->socket()->using_sctp_control_stream();
+ else
+ // TODO(jtl): return sctp_enabled() here?
+ return false;
+ }
+
+ // Maps a SPDY stream number to an SCTP stream ID.
+ uint16 MapSpdyToSctp(uint32 stream_id) {
+ return connection_->socket()->MapSpdyToSctp(stream_id);
+ }
+
void set_spdy_session_pool(SpdySessionPool* pool) {
spdy_session_pool_ = NULL;
}
@@ -292,6 +327,9 @@
// Get a new stream id.
int GetNewStreamId();
+ // Get the SCTP stream ID for this SPDY frame.
+ uint16 GetSctpStreamID(const spdy::SpdyFrame& frame);
+
// Queue a frame for sending.
// |frame| is the frame to send.
// |priority| is the priority for insertion into the queue.

Powered by Google App Engine
This is Rietveld 408576698