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

Unified Diff: net/websockets/websocket_stream.h

Issue 26544003: Make net::WebSocketChannel deletion safe and enable new IPCs (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor comment fix. Created 7 years, 2 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/websockets/websocket_stream.h
diff --git a/net/websockets/websocket_stream.h b/net/websockets/websocket_stream.h
index ca29f57482cf6dec5027b43b56707be8cc8e3b19..779ea38b7264eb161099066b220ebab57d7167f5 100644
--- a/net/websockets/websocket_stream.h
+++ b/net/websockets/websocket_stream.h
@@ -122,6 +122,12 @@ class NET_EXPORT_PRIVATE WebSocketStream : public WebSocketStreamBase {
// ReadFrames may discard the incomplete frame. Since the renderer will
// discard any incomplete messages when the connection is closed, this makes
// no difference to the overall semantics.
+ //
+ // Implementations of ReadFrames() must be able to handle being deleted during
+ // the execution of callback.Run(). In practice this means that the method
+ // calling callback.Run() (and any calling methods in the same object) must
+ // return immediately without any further method calls or access to member
+ // variables. Implementors should write test(s) for this case.
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
const CompletionCallback& callback) = 0;
@@ -134,6 +140,11 @@ class NET_EXPORT_PRIVATE WebSocketStream : public WebSocketStreamBase {
//
// This method will only return OK if all frames were written completely.
// Otherwise it will return an appropriate net error code.
+ //
+ // The callback implementation is permitted to delete this
+ // object. Implementations of WriteFrames() should be robust against
+ // this. This generally means returning to the event loop immediately after
+ // calling the callback.
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
const CompletionCallback& callback) = 0;
« net/websockets/websocket_event_interface.h ('K') | « net/websockets/websocket_event_interface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698