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

Side by Side Diff: remoting/webapp/session_connector.js

Issue 567293005: Fix V1 app crash when verifying sockets API is available. (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Connect set-up state machine for Me2Me and IT2Me 7 * Connect set-up state machine for Me2Me and IT2Me
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 * @param {string} email 364 * @param {string} email
365 */ 365 */
366 function connectSignalingWithTokenAndEmail(token, email) { 366 function connectSignalingWithTokenAndEmail(token, email) {
367 that.signalStrategy_.connect( 367 that.signalStrategy_.connect(
368 remoting.settings.XMPP_SERVER_ADDRESS, email, token); 368 remoting.settings.XMPP_SERVER_ADDRESS, email, token);
369 } 369 }
370 370
371 // Only use XMPP when TCP API is available and TLS support is enabled. That's 371 // Only use XMPP when TCP API is available and TLS support is enabled. That's
372 // not the case for V1 app (socket API is available only to platform apps) 372 // not the case for V1 app (socket API is available only to platform apps)
373 // and for Chrome releases before 38. 373 // and for Chrome releases before 38.
374 if (chrome.socket.secure) { 374 if (chrome.socket && chrome.socket.secure) {
375 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */ 375 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */
376 (new remoting.XmppConnection(this.onSignalingState_.bind(this))); 376 (new remoting.XmppConnection(this.onSignalingState_.bind(this)));
377 } else { 377 } else {
378 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */ 378 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */
379 (new remoting.WcsAdapter(this.onSignalingState_.bind(this))); 379 (new remoting.WcsAdapter(this.onSignalingState_.bind(this)));
380 } 380 }
381 381
382 remoting.identity.callWithToken(connectSignalingWithToken, this.onError_); 382 remoting.identity.callWithToken(connectSignalingWithToken, this.onError_);
383 }; 383 };
384 384
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 * Normalize the access code entered by the user. 585 * Normalize the access code entered by the user.
586 * 586 *
587 * @param {string} accessCode The access code, as entered by the user. 587 * @param {string} accessCode The access code, as entered by the user.
588 * @return {string} The normalized form of the code (whitespace removed). 588 * @return {string} The normalized form of the code (whitespace removed).
589 */ 589 */
590 remoting.SessionConnector.prototype.normalizeAccessCode_ = 590 remoting.SessionConnector.prototype.normalizeAccessCode_ =
591 function(accessCode) { 591 function(accessCode) {
592 // Trim whitespace. 592 // Trim whitespace.
593 return accessCode.replace(/\s/g, ''); 593 return accessCode.replace(/\s/g, '');
594 }; 594 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698