From ef88b05837e968daf0389fce203c81dba16c17ed Mon Sep 17 00:00:00 2001 From: "mikhail.pozdnyakov" Date: Fri, 26 Feb 2016 02:48:10 -0800 Subject: [chrome.displaySource] further implementation of call completion callbacks The API implementation determines when and with which arguments the 'startSession'/'terminateSession' completion callbacks are invoked. The 'exceeded_session_limit_error' session error type is eliminated and substituted with 'startSession' completion callback call (which is more natural since this problem is detected before a new session is started). JS bindings code is simplified. BUG=242107 Review URL: https://codereview.chromium.org/1730583002 Cr-Commit-Position: refs/heads/master@{#377864} --- extensions/common/api/display_source.idl | 4 ---- extensions/common/mojo/wifi_display_session_service.mojom | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'extensions/common') diff --git a/extensions/common/api/display_source.idl b/extensions/common/api/display_source.idl index 00434a6..0659b51 100644 --- a/extensions/common/api/display_source.idl +++ b/extensions/common/api/display_source.idl @@ -6,10 +6,6 @@ // session using WebMediaStreamTrack as sources. namespace displaySource { enum ErrorType { - // A new Display session cannot be started before the existing one is - // terminated. - session_limit_error, - // The connection with sink cannot be established or has dropped // unexpectedly. connection_error, diff --git a/extensions/common/mojo/wifi_display_session_service.mojom b/extensions/common/mojo/wifi_display_session_service.mojom index 025ed7f..f664a5f 100644 --- a/extensions/common/mojo/wifi_display_session_service.mojom +++ b/extensions/common/mojo/wifi_display_session_service.mojom @@ -23,11 +23,17 @@ interface WiFiDisplaySessionService { interface WiFiDisplaySessionServiceClient { // Notification of a successfull connection to a sink. - OnEstablished(string ip_address); + OnConnected(string ip_address); + + // Notification of a handled connection request. + OnConnectRequestHandled(bool success, string error_message); // Notification of a session termination. OnTerminated(); + // Notification of a handled termination request. + OnDisconnectRequestHandled(bool success, string error_message); + // Notification of an error occurred during the session. // Note: 'type' values must correspond to 'enum ErrorType' // from display_source.idl -- cgit v1.1