Index: content/renderer/presentation/presentation_connection_proxy.cc |
diff --git a/content/renderer/presentation/presentation_connection_proxy.cc b/content/renderer/presentation/presentation_connection_proxy.cc |
index d1488ed3896a925ecdd754244331dcde43058c04..55d49515744ff97c081f89911a29383bb043e166 100644 |
--- a/content/renderer/presentation/presentation_connection_proxy.cc |
+++ b/content/renderer/presentation/presentation_connection_proxy.cc |
@@ -63,7 +63,7 @@ void PresentationConnectionProxy::DidChangeState( |
void PresentationConnectionProxy::OnClose() { |
DCHECK(target_connection_ptr_); |
- source_connection_->DidClose(); |
+ DidChangeState(content::PRESENTATION_CONNECTION_STATE_CLOSED); |
target_connection_ptr_->DidChangeState( |
content::PRESENTATION_CONNECTION_STATE_CLOSED); |
} |
@@ -91,8 +91,12 @@ ControllerConnectionProxy::MakeRemoteRequest() { |
} |
ReceiverConnectionProxy::ReceiverConnectionProxy( |
- blink::WebPresentationConnection* receiver_connection) |
- : PresentationConnectionProxy(receiver_connection) {} |
+ blink::WebPresentationConnection* receiver_connection, |
+ const OnConnectionClosedCallback& connection_closed_callback) |
+ : PresentationConnectionProxy(receiver_connection), |
+ connection_closed_callback_(connection_closed_callback) { |
+ DCHECK(connection_closed_callback_); |
+} |
ReceiverConnectionProxy::~ReceiverConnectionProxy() = default; |
@@ -111,4 +115,11 @@ void ReceiverConnectionProxy::BindControllerConnection( |
DidChangeState(content::PRESENTATION_CONNECTION_STATE_CONNECTED); |
} |
+void ReceiverConnectionProxy::DidChangeState( |
+ content::PresentationConnectionState state) { |
+ PresentationConnectionProxy::DidChangeState(state); |
+ if (state == content::PRESENTATION_CONNECTION_STATE_CLOSED) |
+ connection_closed_callback_.Run(); |
+} |
+ |
} // namespace content |