| Index: mojo/services/network/http_connection_impl.h
|
| diff --git a/mojo/services/network/http_connection_impl.h b/mojo/services/network/http_connection_impl.h
|
| index 7f952310493fdadcc8e91bcb96d26cf100558333..79fc72dbf46c011051d2f3684d366548817eb3ec 100644
|
| --- a/mojo/services/network/http_connection_impl.h
|
| +++ b/mojo/services/network/http_connection_impl.h
|
| @@ -26,9 +26,9 @@ class HttpServerImpl;
|
| class HttpConnectionImpl : public HttpConnection,
|
| public ErrorHandler {
|
| public:
|
| - // |owner| must outlive this object.
|
| + // |server| must outlive this object.
|
| HttpConnectionImpl(int connection_id,
|
| - HttpServerImpl* owner,
|
| + HttpServerImpl* server,
|
| HttpConnectionDelegatePtr delegate,
|
| HttpConnectionPtr* connection);
|
|
|
| @@ -40,6 +40,7 @@ class HttpConnectionImpl : public HttpConnection,
|
|
|
| private:
|
| class SimpleDataPipeReader;
|
| + class WebSocketImpl;
|
|
|
| // HttpConnection implementation.
|
| void SetSendBufferSize(uint32_t size,
|
| @@ -55,17 +56,27 @@ class HttpConnectionImpl : public HttpConnection,
|
| SimpleDataPipeReader* reader,
|
| scoped_ptr<std::string> body);
|
|
|
| - bool EncounteredConnectionError() const {
|
| - return !binding_.is_bound() || !delegate_;
|
| - }
|
| + void Close();
|
| +
|
| + // Checks whether Close() has been called.
|
| + bool IsClosing() const { return !binding_.is_bound(); }
|
| +
|
| + // Checks whether all wrap-up work has been done during the closing process.
|
| + // If yes, notifies the owner, which may result in the destruction of this
|
| + // object.
|
| + void NotifyOwnerCloseIfAllDone();
|
| +
|
| + void OnWebSocketClosed();
|
|
|
| const int connection_id_;
|
| - HttpServerImpl* const owner_;
|
| + HttpServerImpl* const server_;
|
| HttpConnectionDelegatePtr delegate_;
|
| Binding<HttpConnection> binding_;
|
| // Owns its elements.
|
| std::set<SimpleDataPipeReader*> response_body_readers_;
|
|
|
| + scoped_ptr<WebSocketImpl> web_socket_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(HttpConnectionImpl);
|
| };
|
|
|
|
|