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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp

Issue 2484273003: [Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destr… (Closed)
Patch Set: rebase Created 3 years, 10 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: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
index 4f4bb2d51ae4fe267ca2f1ec9110299d10d62dbb..142918d8fb523498cfd22803d009d0f9d30c6d64 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
@@ -409,7 +409,7 @@ void PresentationConnection::terminate() {
return;
WebPresentationClient* client = presentationClient(getExecutionContext());
if (client)
- client->terminateSession(m_url, m_id);
+ client->terminateConnection(m_url, m_id);
tearDown();
}
@@ -425,10 +425,20 @@ bool PresentationConnection::matches(const String& id, const KURL& url) const {
void PresentationConnection::didChangeState(
WebPresentationConnectionState state) {
+ didChangeState(state, true /* shouldDispatchEvent */);
+}
+
+void PresentationConnection::didChangeState(
+ WebPresentationConnectionState state,
+ bool shouldDispatchEvent) {
if (m_state == state)
return;
m_state = state;
+
+ if (!shouldDispatchEvent)
+ return;
+
switch (m_state) {
case WebPresentationConnectionState::Connecting:
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698