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

Unified Diff: net/spdy/spdy_io_buffer.cc

Issue 13009012: [SPDY] Refactor SpdySession's write queue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gyp error Created 7 years, 9 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_io_buffer.cc
diff --git a/net/spdy/spdy_io_buffer.cc b/net/spdy/spdy_io_buffer.cc
index f0c14b12f6aad8852d194cf8dec673937e60eb3b..441b033a57ada88001541bfc22da0af9fac1cd36 100644
--- a/net/spdy/spdy_io_buffer.cc
+++ b/net/spdy/spdy_io_buffer.cc
@@ -7,23 +7,13 @@
namespace net {
-// static
-uint64 SpdyIOBuffer::order_ = 0;
+SpdyIOBuffer::SpdyIOBuffer() {}
-SpdyIOBuffer::SpdyIOBuffer(
- IOBuffer* buffer, int size, RequestPriority priority, SpdyStream* stream)
- : buffer_(new DrainableIOBuffer(buffer, size)),
- priority_(priority),
- position_(++order_),
- stream_(stream) {}
-
-SpdyIOBuffer::SpdyIOBuffer() : priority_(HIGHEST), position_(0), stream_(NULL) {
-}
+SpdyIOBuffer::SpdyIOBuffer(IOBuffer* buffer, int size, SpdyStream* stream)
+ : buffer_(new DrainableIOBuffer(buffer, size)), stream_(stream) {}
SpdyIOBuffer::SpdyIOBuffer(const SpdyIOBuffer& rhs) {
buffer_ = rhs.buffer_;
- priority_ = rhs.priority_;
- position_ = rhs.position_;
stream_ = rhs.stream_;
}
@@ -31,13 +21,16 @@ SpdyIOBuffer::~SpdyIOBuffer() {}
SpdyIOBuffer& SpdyIOBuffer::operator=(const SpdyIOBuffer& rhs) {
buffer_ = rhs.buffer_;
- priority_ = rhs.priority_;
- position_ = rhs.position_;
stream_ = rhs.stream_;
return *this;
}
-void SpdyIOBuffer::release() {
+void SpdyIOBuffer::Swap(SpdyIOBuffer* other) {
+ buffer_.swap(other->buffer_);
+ stream_.swap(other->stream_);
+}
+
+void SpdyIOBuffer::Release() {
buffer_ = NULL;
stream_ = NULL;
}
« no previous file with comments | « net/spdy/spdy_io_buffer.h ('k') | net/spdy/spdy_session.h » ('j') | net/spdy/spdy_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698