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

Unified Diff: remoting/webapp/signal_strategy.js

Issue 595063005: Save the client base JID for authentication in case it differs from the email (for accounts non-Goo… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add jsdoc 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
« no previous file with comments | « remoting/webapp/session_connector_impl.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/signal_strategy.js
diff --git a/remoting/webapp/signal_strategy.js b/remoting/webapp/signal_strategy.js
index b94acc35e3708184abb6d46e7316512f9a4f89dc..02c8acbd5f0cc27829d59aa1b6dbd8a6f020b57b 100644
--- a/remoting/webapp/signal_strategy.js
+++ b/remoting/webapp/signal_strategy.js
@@ -65,3 +65,19 @@ remoting.SignalStrategy.prototype.getError = function() {};
/** @return {string} Current JID when in CONNECTED state. */
remoting.SignalStrategy.prototype.getJid = function() {};
+
+/**
+ * Creates the appropriate signal strategy for the current environment.
+ * @param {function(remoting.SignalStrategy.State): void} onStateChangedCallback
+ * @return {remoting.SignalStrategy} New signal strategy object.
+ */
+remoting.SignalStrategy.create = function(onStateChangedCallback) {
+ // 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) {
+ return new remoting.XmppConnection(onStateChangedCallback);
+ } else {
+ return new remoting.WcsAdapter(onStateChangedCallback);
+ }
+};
« no previous file with comments | « remoting/webapp/session_connector_impl.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698