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

Unified Diff: mojo/services/network/http_connection_impl.cc

Issue 1227373002: Roll mojo SDK to 734c6e1652ff2f3b696e441722838f453f4f9b42 (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Follow review Created 5 years, 5 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
« no previous file with comments | « mojo/services/network/http_connection_impl.h ('k') | mojo/services/network/http_server_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/http_connection_impl.cc
diff --git a/mojo/services/network/http_connection_impl.cc b/mojo/services/network/http_connection_impl.cc
index 77d7a9165c61c3cc87ed79448d75993fa157dda5..1fb8a4444860a810b9cd8d94f4073e4da8a4a86b 100644
--- a/mojo/services/network/http_connection_impl.cc
+++ b/mojo/services/network/http_connection_impl.cc
@@ -85,8 +85,7 @@ class HttpConnectionImpl::SimpleDataPipeReader {
DISALLOW_COPY_AND_ASSIGN(SimpleDataPipeReader);
};
-class HttpConnectionImpl::WebSocketImpl : public WebSocket,
- public ErrorHandler {
+class HttpConnectionImpl::WebSocketImpl : public WebSocket {
public:
// |connection| must outlive this object.
WebSocketImpl(HttpConnectionImpl* connection,
@@ -103,8 +102,8 @@ class HttpConnectionImpl::WebSocketImpl : public WebSocket,
DCHECK(client_);
DCHECK(send_stream_.is_valid());
- binding_.set_error_handler(this);
- client_.set_error_handler(this);
+ binding_.set_connection_error_handler([this]() { Close(); });
+ client_.set_connection_error_handler([this]() { Close(); });
DataPipe data_pipe;
receive_stream_ = data_pipe.producer_handle.Pass();
@@ -173,9 +172,6 @@ class HttpConnectionImpl::WebSocketImpl : public WebSocket,
Close();
}
- // ErrorHandler implementation.
- void OnConnectionError() override { Close(); }
-
void OnFinishedReadingSendStream(uint32_t num_bytes, const char* data) {
DCHECK_GT(pending_send_count_, 0u);
pending_send_count_--;
@@ -263,8 +259,8 @@ HttpConnectionImpl::HttpConnectionImpl(int connection_id,
delegate_(delegate.Pass()),
binding_(this, connection) {
DCHECK(delegate_);
- binding_.set_error_handler(this);
- delegate_.set_error_handler(this);
+ binding_.set_connection_error_handler([this]() { Close(); });
+ delegate_.set_connection_error_handler([this]() { Close(); });
}
HttpConnectionImpl::~HttpConnectionImpl() {
@@ -344,14 +340,6 @@ void HttpConnectionImpl::SetReceiveBufferSize(
callback.Run(MakeNetworkError(net::OK));
}
-void HttpConnectionImpl::OnConnectionError() {
- // This method is called when the proxy side of |binding_| or the impl side of
- // |delegate_| has closed the pipe. Although it is set as error handler for
- // both |binding_| and |delegate_|, it will only be called at most once
- // because when called it closes/resets |binding_| and |delegate_|.
- Close();
-}
-
void HttpConnectionImpl::OnFinishedReadingResponseBody(
HttpResponsePtr response,
SimpleDataPipeReader* reader,
« no previous file with comments | « mojo/services/network/http_connection_impl.h ('k') | mojo/services/network/http_server_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698