| 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;
|
|
|
|
|