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

Side by Side Diff: remoting/webapp/crd/js/xmpp_connection.js

Issue 855003008: Log signal strategy progress to server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 /** 10 /**
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 chrome.socket.create("tcp", {}, this.onSocketCreated_.bind(this)); 150 chrome.socket.create("tcp", {}, this.onSocketCreated_.bind(this));
151 this.setState_(remoting.SignalStrategy.State.CONNECTING); 151 this.setState_(remoting.SignalStrategy.State.CONNECTING);
152 }; 152 };
153 153
154 /** @param {string} message */ 154 /** @param {string} message */
155 remoting.XmppConnection.prototype.sendMessage = function(message) { 155 remoting.XmppConnection.prototype.sendMessage = function(message) {
156 base.debug.assert(this.state_ == remoting.SignalStrategy.State.CONNECTED); 156 base.debug.assert(this.state_ == remoting.SignalStrategy.State.CONNECTED);
157 this.sendString_(message); 157 this.sendString_(message);
158 }; 158 };
159 159
160 /**
161 * @param {remoting.LogToServer} logToServer The LogToServer instance for the
162 * connection.
163 */
164 remoting.XmppConnection.prototype.sendConnectionSetupResults =
165 function(logToServer) {
166 };
167
160 /** @return {remoting.SignalStrategy.State} Current state */ 168 /** @return {remoting.SignalStrategy.State} Current state */
161 remoting.XmppConnection.prototype.getState = function() { 169 remoting.XmppConnection.prototype.getState = function() {
162 return this.state_; 170 return this.state_;
163 }; 171 };
164 172
165 /** @return {remoting.Error} Error when in FAILED state. */ 173 /** @return {remoting.Error} Error when in FAILED state. */
166 remoting.XmppConnection.prototype.getError = function() { 174 remoting.XmppConnection.prototype.getError = function() {
167 return this.error_; 175 return this.error_;
168 }; 176 };
169 177
170 /** @return {string} Current JID when in CONNECTED state. */ 178 /** @return {string} Current JID when in CONNECTED state. */
171 remoting.XmppConnection.prototype.getJid = function() { 179 remoting.XmppConnection.prototype.getJid = function() {
172 return this.jid_; 180 return this.jid_;
173 }; 181 };
174 182
183 /** @return {remoting.SignalStrategy.Type} The signal strategy type. */
184 remoting.XmppConnection.prototype.getType = function() {
185 return remoting.SignalStrategy.Type.XMPP;
186 };
187
175 remoting.XmppConnection.prototype.dispose = function() { 188 remoting.XmppConnection.prototype.dispose = function() {
176 this.closeSocket_(); 189 this.closeSocket_();
177 this.setState_(remoting.SignalStrategy.State.CLOSED); 190 this.setState_(remoting.SignalStrategy.State.CLOSED);
178 }; 191 };
179 192
180 /** 193 /**
181 * @param {chrome.socket.CreateInfo} createInfo 194 * @param {chrome.socket.CreateInfo} createInfo
182 * @private 195 * @private
183 */ 196 */
184 remoting.XmppConnection.prototype.onSocketCreated_ = function(createInfo) { 197 remoting.XmppConnection.prototype.onSocketCreated_ = function(createInfo) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 /** 480 /**
468 * @param {remoting.SignalStrategy.State} newState 481 * @param {remoting.SignalStrategy.State} newState
469 * @private 482 * @private
470 */ 483 */
471 remoting.XmppConnection.prototype.setState_ = function(newState) { 484 remoting.XmppConnection.prototype.setState_ = function(newState) {
472 if (this.state_ != newState) { 485 if (this.state_ != newState) {
473 this.state_ = newState; 486 this.state_ = newState;
474 this.onStateChangedCallback_(this.state_); 487 this.onStateChangedCallback_(this.state_);
475 } 488 }
476 }; 489 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/wcs_adapter.js ('k') | remoting/webapp/unittests/fallback_signal_strategy_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698