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

Unified Diff: mojo/services/network/public/cpp/web_socket_write_queue.h

Issue 1148913002: Fix WebSocket{Read,Write}Queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: mojo/services/network/public/cpp/web_socket_write_queue.h
diff --git a/mojo/services/network/public/cpp/web_socket_write_queue.h b/mojo/services/network/public/cpp/web_socket_write_queue.h
index b2c48fc9076d8fd8b7390aa77271a7df0dab5a60..ddfcadad624b2e04e9b6768eae8f82564e5e9736 100644
--- a/mojo/services/network/public/cpp/web_socket_write_queue.h
+++ b/mojo/services/network/public/cpp/web_socket_write_queue.h
@@ -19,7 +19,7 @@ namespace mojo {
// See also: WebSocketReadQueue
class WebSocketWriteQueue {
public:
- WebSocketWriteQueue(DataPipeProducerHandle handle);
+ explicit WebSocketWriteQueue(DataPipeProducerHandle handle);
~WebSocketWriteQueue();
void Write(const char* data,
@@ -29,14 +29,17 @@ class WebSocketWriteQueue {
private:
struct Operation;
- MojoResult TryToWrite();
+ void TryToWrite();
void Wait();
void OnHandleReady(MojoResult result);
DataPipeProducerHandle handle_;
common::HandleWatcher handle_watcher_;
ScopedVector<Operation> queue_;
- bool is_waiting_;
+ bool is_busy_;
+ // If non-null, the boolean it points to (allocated on the stack) will be set
+ // to true when this object is destructed.
+ bool* destructed_;
};
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698