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

Unified Diff: content/renderer/presentation/presentation_connection_proxy.cc

Issue 2863903002: [Presentation API] Change controller connection to 'terminated' when receiver connection terminates (Closed)
Patch Set: fix layout test failures Created 3 years, 7 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: 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..dd911aae55f4da549cd36c3f4c84ecb466e113a7 100644
--- a/content/renderer/presentation/presentation_connection_proxy.cc
+++ b/content/renderer/presentation/presentation_connection_proxy.cc
@@ -56,6 +56,9 @@ void PresentationConnectionProxy::DidChangeState(
blink::WebPresentationConnectionState::kConnected);
} else if (state == content::PRESENTATION_CONNECTION_STATE_CLOSED) {
source_connection_->DidClose();
+ } else if (state == content::PRESENTATION_CONNECTION_STATE_TERMINATED) {
+ source_connection_->DidChangeState(
+ blink::WebPresentationConnectionState::kTerminated);
} else {
NOTREACHED();
}
@@ -73,6 +76,17 @@ void PresentationConnectionProxy::Close() const {
target_connection_ptr_->OnClose();
}
+void PresentationConnectionProxy::NotifyTargetConnection(
+ blink::WebPresentationConnectionState state) {
+ if (!target_connection_ptr_)
+ return;
+
+ if (state == blink::WebPresentationConnectionState::kTerminated) {
+ target_connection_ptr_->DidChangeState(
+ content::PRESENTATION_CONNECTION_STATE_TERMINATED);
+ }
+}
+
ControllerConnectionProxy::ControllerConnectionProxy(
blink::WebPresentationConnection* controller_connection)
: PresentationConnectionProxy(controller_connection) {}

Powered by Google App Engine
This is Rietveld 408576698