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

Unified Diff: net/spdy/spdy_io_buffer.h

Issue 13009012: [SPDY] Refactor SpdySession's write queue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | net/spdy/spdy_io_buffer.cc » ('j') | net/spdy/spdy_session.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_io_buffer.h
diff --git a/net/spdy/spdy_io_buffer.h b/net/spdy/spdy_io_buffer.h
index 9bbee1612a6a9bb95e053ad4f4f4d8ac68fb0aff..ed95e70a524dcc6d79197aa61a5676d36791f1aa 100644
--- a/net/spdy/spdy_io_buffer.h
+++ b/net/spdy/spdy_io_buffer.h
@@ -8,54 +8,47 @@
#include "base/memory/ref_counted.h"
#include "net/base/io_buffer.h"
#include "net/base/net_export.h"
-#include "net/base/request_priority.h"
namespace net {
class SpdyStream;
-// A class for managing SPDY IO buffers. These buffers need to be prioritized
-// so that the SpdySession sends them in the right order. Further, they need
-// to track the SpdyStream which they are associated with so that incremental
-// completion of the IO can notify the appropriate stream of completion.
+// A class for managing SPDY write buffers. These write buffers need
+// to track the SpdyStream which they are associated with so that the
+// session can activate the stream lazily and also notify the stream
+// on completion of the write.
class NET_EXPORT_PRIVATE SpdyIOBuffer {
public:
+ SpdyIOBuffer();
+
// Constructor
// |buffer| is the actual data buffer.
// |size| is the size of the data buffer.
- // |priority| is the priority of this buffer.
- // |stream| is a pointer to the stream which is managing this buffer.
- SpdyIOBuffer(IOBuffer* buffer, int size, RequestPriority priority,
- SpdyStream* stream);
+ // |stream| is a pointer to the stream which is managing this buffer
+ // (can be NULL if the write is for the session itself).
+ SpdyIOBuffer(IOBuffer* buffer, int size, SpdyStream* stream);
+
// Declare this instead of using the default so that we avoid needing to
// include spdy_stream.h.
SpdyIOBuffer(const SpdyIOBuffer& rhs);
- SpdyIOBuffer();
+
~SpdyIOBuffer();
+
// Declare this instead of using the default so that we avoid needing to
// include spdy_stream.h.
SpdyIOBuffer& operator=(const SpdyIOBuffer& rhs);
+ void Swap(SpdyIOBuffer* other);
+
+ void Release();
+
// Accessors.
DrainableIOBuffer* buffer() const { return buffer_; }
- size_t size() const { return buffer_->size(); }
- void release();
- RequestPriority priority() const { return priority_; }
const scoped_refptr<SpdyStream>& stream() const { return stream_; }
- // Comparison operator to support sorting.
- bool operator<(const SpdyIOBuffer& other) const {
- if (priority_ != other.priority_)
- return priority_ < other.priority_;
- return position_ > other.position_;
- }
-
private:
scoped_refptr<DrainableIOBuffer> buffer_;
- RequestPriority priority_;
- uint64 position_;
scoped_refptr<SpdyStream> stream_;
- static uint64 order_; // Maintains a FIFO order for equal priorities.
};
} // namespace net
« no previous file with comments | « no previous file | net/spdy/spdy_io_buffer.cc » ('j') | net/spdy/spdy_session.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698