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

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: 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
index b94acc35e3708184abb6d46e7316512f9a4f89dc..c50041d55c56d6f2e99c35167fc73fc5d91aab51 100644
--- a/remoting/webapp/signal_strategy.js
+++ b/remoting/webapp/signal_strategy.js
@@ -65,3 +65,18 @@ remoting.SignalStrategy.prototype.getError = function() {};
/** @return {string} Current JID when in CONNECTED state. */
remoting.SignalStrategy.prototype.getJid = function() {};
+
+/** Creates the appropriate signal strategy for this environment.
Sergey Ulanov 2014/09/25 02:28:46 nit: "/**" should be on its own line unless the wh
rmsousa 2014/09/27 01:42:17 Done.
+ * @param {function(remoting.SignalStrategy.State): void} onStateChangedCallback
+ * @return {remoting.SignalStrategy} New signal strategy object.
+ */
+remoting.SignalStrategy.create = function(onStateChangedCallback) {
rmsousa 2014/09/24 02:53:27 I moved this here to keep the implementation selec
+ // 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);
+ }
+};
« remoting/webapp/host_controller.js ('K') | « remoting/webapp/session_connector_impl.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698