1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * Interface abstracting the protocol extension functionality.
8 * Instances of this class can be registered with the SessionConnector
9 * to enhance the communication protocol between the host and client.
10 * Note that corresponding support on the host side is required.
15 /** @suppress {duplicate} */
16 var remoting = remoting || {};
21 remoting.ProtocolExtension = function() {};
24 * Return a list of the extension message types that this class can handle.
25 * All extension messages that match these types will be sent to the extension.
27 * @return {Array<string>}
29 remoting.ProtocolExtension.prototype.getExtensionTypes = function() {};
32 * Called when the connection has been established to start the extension.
34 * @param {function(string,string)} sendMessageToHost Callback to send a message
37 remoting.ProtocolExtension.prototype.startExtension =
38 function(sendMessageToHost) {};
41 * Called when an extension message of a matching type is received.
43 * @param {string} type The message type.
44 * @param {Object} message The parsed extension message data.
45 * @return {boolean} True if the extension message was handled.
47 remoting.ProtocolExtension.prototype.onExtensionMessage =
48 function(type, message) {};