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

Unified Diff: net/flip/flip_session.h

Issue 342088: Update the FLIP session to use the FlipIOBuffer.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/flip/flip_session.h
===================================================================
--- net/flip/flip_session.h (revision 30808)
+++ net/flip/flip_session.h (working copy)
@@ -18,6 +18,7 @@
#include "net/base/ssl_config_service.h"
#include "net/base/upload_data_stream.h"
#include "net/flip/flip_framer.h"
+#include "net/flip/flip_io_buffer.h"
#include "net/flip/flip_protocol.h"
#include "net/flip/flip_session_pool.h"
#include "net/socket/client_socket.h"
@@ -86,37 +87,6 @@
virtual void OnClose(int status) = 0;
};
-class PrioritizedIOBuffer {
- public:
- PrioritizedIOBuffer() : buffer_(0), priority_(0) {}
- PrioritizedIOBuffer(IOBufferWithSize* buffer, int priority)
- : buffer_(buffer),
- priority_(priority),
- position_(++order_) {
- }
-
- IOBuffer* buffer() const { return buffer_; }
-
- size_t size() const { return buffer_->size(); }
-
- void release() { buffer_ = NULL; }
-
- int priority() { return priority_; }
-
- // Supports sorting.
- bool operator<(const PrioritizedIOBuffer& other) const {
- if (priority_ != other.priority_)
- return priority_ > other.priority_;
- return position_ >= other.position_;
- }
-
- private:
- scoped_refptr<IOBufferWithSize> buffer_;
- int priority_;
- int position_;
- static int order_; // Maintains a FIFO order for equal priorities.
-};
-
class FlipSession : public base::RefCounted<FlipSession>,
public flip::FlipFramerVisitorInterface {
public:
@@ -249,12 +219,12 @@
std::map<std::string, FlipDelegate*> pending_streams_;
// As we gather data to be sent, we put it into the output queue.
- typedef std::priority_queue<PrioritizedIOBuffer> OutputQueue;
+ typedef std::priority_queue<FlipIOBuffer> OutputQueue;
OutputQueue queue_;
// TODO(mbelshe): this is ugly!!
// The packet we are currently sending.
- PrioritizedIOBuffer in_flight_write_;
+ FlipIOBuffer in_flight_write_;
bool delayed_write_pending_;
bool write_pending_;

Powered by Google App Engine
This is Rietveld 408576698