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

Unified Diff: remoting/webapp/signal_strategy.js

Issue 530213004: Use XMPP in V2 webapp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: remoting/webapp/signal_strategy.js
diff --git a/remoting/webapp/signal_strategy.js b/remoting/webapp/signal_strategy.js
new file mode 100644
index 0000000000000000000000000000000000000000..b94acc35e3708184abb6d46e7316512f9a4f89dc
--- /dev/null
+++ b/remoting/webapp/signal_strategy.js
@@ -0,0 +1,67 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+/** @suppress {duplicate} */
+var remoting = remoting || {};
+
+/**
+ * Abstract interface for various signaling mechanisms.
+ *
+ * @interface
+ * @extends {base.Disposable}
+ */
+remoting.SignalStrategy = function() {};
+
+/**
+ * @enum {number} SignalStrategy states. Possible state transitions:
+ * NOT_CONNECTED -> CONNECTING (connect() called).
+ * CONNECTING -> HANDSHAKE (connected successfully).
+ * HANDSHAKE -> CONNECTED (authenticated successfully).
+ * CONNECTING -> FAILED (connection failed).
+ * HANDSHAKE -> FAILED (authentication failed).
+ * * -> CLOSED (dispose() called).
+ */
+remoting.SignalStrategy.State = {
+ NOT_CONNECTED: 0,
+ CONNECTING: 1,
+ HANDSHAKE: 2,
+ CONNECTED: 3,
+ FAILED: 4,
+ CLOSED: 5
+};
+
+remoting.SignalStrategy.prototype.dispose = function() {};
+
+/**
+ * @param {?function(Element):void} onIncomingStanzaCallback Callback to call on
+ * incoming messages.
+ */
+remoting.SignalStrategy.prototype.setIncomingStanzaCallback =
+ function(onIncomingStanzaCallback) {};
+
+/**
+ * @param {string} server
+ * @param {string} username
+ * @param {string} authToken
+ */
+remoting.SignalStrategy.prototype.connect =
+ function(server, username, authToken) {
+};
+
+/**
+ * Sends a message. Can be called only in CONNECTED state.
+ * @param {string} message
+ */
+remoting.SignalStrategy.prototype.sendMessage = function(message) {};
+
+/** @return {remoting.SignalStrategy.State} Current state */
+remoting.SignalStrategy.prototype.getState = function() {};
+
+/** @return {remoting.Error} Error when in FAILED state. */
+remoting.SignalStrategy.prototype.getError = function() {};
+
+/** @return {string} Current JID when in CONNECTED state. */
+remoting.SignalStrategy.prototype.getJid = function() {};

Powered by Google App Engine
This is Rietveld 408576698