summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 03:02:23 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 03:02:23 +0000
commit971746ec2d3bc209d68c3d46d1eadc68afb827af (patch)
treeb4022bc3868b5e1932b282dc61c8ee19be7aa34e /net
parentf27bb9a6ab467be9588a382643d730c86732a1d1 (diff)
downloadchromium_src-971746ec2d3bc209d68c3d46d1eadc68afb827af.zip
chromium_src-971746ec2d3bc209d68c3d46d1eadc68afb827af.tar.gz
chromium_src-971746ec2d3bc209d68c3d46d1eadc68afb827af.tar.bz2
Remove SpdyHttpStream dependency in SpdySession
BUG=none TEST=none Review URL: http://codereview.chromium.org/3035010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/spdy/spdy_http_stream.cc4
-rw-r--r--net/spdy/spdy_session.cc9
-rw-r--r--net/spdy/spdy_session.h14
-rw-r--r--net/spdy/spdy_stream_unittest.cc2
4 files changed, 11 insertions, 18 deletions
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index ffc8330..581cb27 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -163,7 +163,7 @@ int SpdyHttpStream::InitializeStream(
else
return spdy_session_->CreateStream(request_info_.url,
request_info_.priority, &stream_,
- stream_net_log, callback, this);
+ stream_net_log, callback);
}
void SpdyHttpStream::InitializeRequest(
@@ -302,7 +302,7 @@ int SpdyHttpStream::SendRequest(HttpResponseInfo* response,
void SpdyHttpStream::Cancel() {
if (spdy_session_)
- spdy_session_->CancelPendingCreateStreams(this);
+ spdy_session_->CancelPendingCreateStreams(&stream_);
user_callback_ = NULL;
if (stream_)
stream_->Cancel();
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index a45289f..06ba7d5 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -295,8 +295,7 @@ int SpdySession::CreateStream(
RequestPriority priority,
scoped_refptr<SpdyStream>* spdy_stream,
const BoundNetLog& stream_net_log,
- CompletionCallback* callback,
- const SpdyHttpStream* spdy_http_stream) {
+ CompletionCallback* callback) {
if (!max_concurrent_streams_ ||
active_streams_.size() < max_concurrent_streams_) {
return CreateStreamImpl(url, priority, spdy_stream, stream_net_log);
@@ -304,7 +303,7 @@ int SpdySession::CreateStream(
create_stream_queues_[priority].push(
PendingCreateStream(url, priority, spdy_stream,
- stream_net_log, callback, spdy_http_stream));
+ stream_net_log, callback));
return ERR_IO_PENDING;
}
@@ -331,13 +330,13 @@ void SpdySession::ProcessPendingCreateStreams() {
}
void SpdySession::CancelPendingCreateStreams(
- const SpdyHttpStream *const spdy_http_stream) {
+ const scoped_refptr<SpdyStream>* spdy_stream) {
for (int i = 0;i < NUM_PRIORITIES;++i) {
PendingCreateStreamQueue tmp;
// Make a copy removing this trans
while (!create_stream_queues_[i].empty()) {
PendingCreateStream& pending_create = create_stream_queues_[i].front();
- if (pending_create.spdy_http_stream != spdy_http_stream)
+ if (pending_create.spdy_stream != spdy_stream)
tmp.push(pending_create);
create_stream_queues_[i].pop();
}
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index ec938c6..3add9b0 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -31,7 +31,6 @@
namespace net {
-class SpdyHttpStream;
class SpdyStream;
class HttpNetworkSession;
class BoundNetLog;
@@ -74,11 +73,10 @@ class SpdySession : public base::RefCounted<SpdySession>,
RequestPriority priority,
scoped_refptr<SpdyStream>* spdy_stream,
const BoundNetLog& stream_net_log,
- CompletionCallback* callback,
- const SpdyHttpStream* spdy_http_stream);
+ CompletionCallback* callback);
// Remove PendingCreateStream objects on transaction deletion
- void CancelPendingCreateStreams(const SpdyHttpStream* trans);
+ void CancelPendingCreateStreams(const scoped_refptr<SpdyStream>* spdy_stream);
// Used by SpdySessionPool to initialize with a pre-existing SSL socket.
// Returns OK on success, or an error on failure.
@@ -149,16 +147,12 @@ class SpdySession : public base::RefCounted<SpdySession>,
const BoundNetLog* stream_net_log;
CompletionCallback* callback;
- const SpdyHttpStream* spdy_http_stream;
-
PendingCreateStream(const GURL& url, RequestPriority priority,
scoped_refptr<SpdyStream>* spdy_stream,
const BoundNetLog& stream_net_log,
- CompletionCallback* callback,
- const SpdyHttpStream* spdy_http_stream)
+ CompletionCallback* callback)
: url(&url), priority(priority), spdy_stream(spdy_stream),
- stream_net_log(&stream_net_log), callback(callback),
- spdy_http_stream(spdy_http_stream) { }
+ stream_net_log(&stream_net_log), callback(callback) { }
};
typedef std::queue<PendingCreateStream, std::list< PendingCreateStream> >
PendingCreateStreamQueue;
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc
index 34ae922..e668789 100644
--- a/net/spdy/spdy_stream_unittest.cc
+++ b/net/spdy/spdy_stream_unittest.cc
@@ -256,7 +256,7 @@ TEST_F(SpdyStreamTest, SendDataAfterOpen) {
scoped_refptr<SpdyStream> stream;
ASSERT_EQ(
OK,
- session->CreateStream(url, LOWEST, &stream, BoundNetLog(), NULL, NULL));
+ session->CreateStream(url, LOWEST, &stream, BoundNetLog(), NULL));
scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(8));
memcpy(buf->data(), "\0hello!\xff", 8);
TestCompletionCallback callback;