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

Unified Diff: remoting/webapp/crd/js/signal_strategy.js

Issue 1133913002: [Chromoting] Move shared webapp JS files from crd/js -> base/js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « remoting/webapp/crd/js/server_log_entry.js ('k') | remoting/webapp/crd/js/smart_reconnector.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/signal_strategy.js
diff --git a/remoting/webapp/crd/js/signal_strategy.js b/remoting/webapp/crd/js/signal_strategy.js
deleted file mode 100644
index 89b18f4cf818f8e124b82f315144f3b2adf792d4..0000000000000000000000000000000000000000
--- a/remoting/webapp/crd/js/signal_strategy.js
+++ /dev/null
@@ -1,123 +0,0 @@
-// 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).
- * CONNECTED -> FAILED (connection was terminated).
- * * -> CLOSED (dispose() called).
- *
- * Do not re-order these values without updating fallback_signal_strategy.js.
- */
-remoting.SignalStrategy.State = {
- NOT_CONNECTED: 0,
- CONNECTING: 1,
- HANDSHAKE: 2,
- CONNECTED: 3,
- FAILED: 4,
- CLOSED: 5
-};
-
-/**
- * @enum {string} SignalStrategy types. Do not add to these values without
- * updating the corresponding enum in chromoting_extensions.proto.
- */
-remoting.SignalStrategy.Type = {
- XMPP: 'xmpp',
- WCS: 'wcs'
-};
-
-remoting.SignalStrategy.prototype.dispose = function() {};
-
-/**
- * @param {function(remoting.SignalStrategy.State):void} onStateChangedCallback
- * Callback to call on state change.
- */
-remoting.SignalStrategy.prototype.setStateChangedCallback =
- function(onStateChangedCallback) {};
-
-/**
- * @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) {};
-
-/**
- * Send any messages accumulated during connection set-up.
- *
- * @param {remoting.LogToServer} logToServer The LogToServer instance for the
- * connection.
- */
-remoting.SignalStrategy.prototype.sendConnectionSetupResults =
- function(logToServer) {
-};
-
-/** @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() {};
-
-/** @return {remoting.SignalStrategy.Type} The signal strategy type. */
-remoting.SignalStrategy.prototype.getType = function() {};
-
-/**
- * Creates the appropriate signal strategy for the current environment.
- * @return {remoting.SignalStrategy} New signal strategy object.
- */
-remoting.SignalStrategy.create = function() {
- // Only use XMPP when TCP API is available and TLS support is enabled. That's
- // not the case for V1 app (socket API is available only to platform apps)
- // and for Chrome releases before 38.
- if (chrome.socket && chrome.socket.secure) {
- /**
- * @param {remoting.FallbackSignalStrategy.Progress} progress
- */
- var progressCallback = function(progress) {
- console.log('FallbackSignalStrategy progress: ' + progress);
- };
-
- return new remoting.FallbackSignalStrategy(
- new remoting.DnsBlackholeChecker(new remoting.XmppConnection()),
- new remoting.WcsAdapter());
- } else {
- return new remoting.WcsAdapter();
- }
-};
« no previous file with comments | « remoting/webapp/crd/js/server_log_entry.js ('k') | remoting/webapp/crd/js/smart_reconnector.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698