summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session.cc
diff options
context:
space:
mode:
authorgavinp@google.com <gavinp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 01:30:03 +0000
committergavinp@google.com <gavinp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 01:30:03 +0000
commitc9c6f5cbd15124457b0fe77f03fda9e4c4855f48 (patch)
treec23bd4ba9fbe29cfd872bc38f4f3b808c39fd949 /net/spdy/spdy_session.cc
parent8dd21c4de17c8011703f3ac5a6e155b6325f65a2 (diff)
downloadchromium_src-c9c6f5cbd15124457b0fe77f03fda9e4c4855f48.zip
chromium_src-c9c6f5cbd15124457b0fe77f03fda9e4c4855f48.tar.gz
chromium_src-c9c6f5cbd15124457b0fe77f03fda9e4c4855f48.tar.bz2
Implement prefetching in chrome
With this CL (see also issue 2910009), chrome will support basic prefetching. You can optionally deactivate prefetching with the command line argument --disable-prefetch. A new RequestPriority was created as well, IDLE, which is lower than LOWEST. Unfortunately, SPDY has only two bits for priority, so as a temporary measure (pending SPDY v3 which will have three), we have a mapping in SPDY that folds net::LOWEST and net::IDLE together. BUG=13505 TEST=http://gemal.dk/browserspy/prefetch.php Review URL: http://codereview.chromium.org/3050016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.cc')
-rw-r--r--net/spdy/spdy_session.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 9f2b82f..7ff500a 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -226,7 +226,7 @@ net::Error SpdySession::Connect(
const std::string& group_name,
const scoped_refptr<TCPSocketParams>& destination,
RequestPriority priority) {
- DCHECK(priority >= SPDY_PRIORITY_HIGHEST && priority <= SPDY_PRIORITY_LOWEST);
+ DCHECK(priority >= net::HIGHEST && priority < net::NUM_PRIORITIES);
// If the connect process is started, let the caller continue.
if (state_ > IDLE)
@@ -385,8 +385,7 @@ int SpdySession::CreateStreamImpl(
LOG(INFO) << "SpdyStream: Creating stream " << stream_id << " for " << url;
// TODO(mbelshe): Optimize memory allocations
- DCHECK(priority >= SPDY_PRIORITY_HIGHEST &&
- priority <= SPDY_PRIORITY_LOWEST);
+ DCHECK(priority >= net::HIGHEST && priority < net::NUM_PRIORITIES);
DCHECK_EQ(active_streams_[stream_id].get(), stream.get());
return OK;
@@ -404,8 +403,10 @@ int SpdySession::WriteSynStream(
CHECK_EQ(stream->stream_id(), stream_id);
scoped_ptr<spdy::SpdySynStreamControlFrame> syn_frame(
- spdy_framer_.CreateSynStream(stream_id, 0, priority, flags, false,
- headers.get()));
+ spdy_framer_.CreateSynStream(
+ stream_id, 0,
+ ConvertRequestPriorityToSpdyPriority(priority),
+ flags, false, headers.get()));
QueueFrame(syn_frame.get(), priority, stream);
static StatsCounter spdy_requests("spdy.requests");