OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * Session class that handles creation and teardown of a remoting session. | 7 * Session class that handles creation and teardown of a remoting session. |
8 * | 8 * |
9 * This abstracts a <embed> element and controls the plugin which does the | 9 * This abstracts a <embed> element and controls the plugin which does the |
10 * actual remoting work. There should be no UI code inside this class. It | 10 * actual remoting work. There should be no UI code inside this class. It |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 function(oauth2AccessToken) { | 247 function(oauth2AccessToken) { |
248 this.clientJid = remoting.wcs.getJid(); | 248 this.clientJid = remoting.wcs.getJid(); |
249 if (this.clientJid == '') { | 249 if (this.clientJid == '') { |
250 remoting.debug.log('Tried to connect without a full JID.'); | 250 remoting.debug.log('Tried to connect without a full JID.'); |
251 } | 251 } |
252 var that = this; | 252 var that = this; |
253 remoting.wcs.setOnIq(function(stanza) { | 253 remoting.wcs.setOnIq(function(stanza) { |
254 remoting.debug.log('Receiving Iq: ' + stanza); | 254 remoting.debug.log('Receiving Iq: ' + stanza); |
255 that.plugin.onIq(stanza); | 255 that.plugin.onIq(stanza); |
256 }); | 256 }); |
257 if (remoting.useP2pApi) { | 257 that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, |
258 this.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, | 258 this.accessCode); |
259 this.accessCode, remoting.useP2pApi); | |
260 } else { | |
261 that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, | |
262 this.accessCode); | |
263 } | |
264 }; | 259 }; |
265 | 260 |
266 /** | 261 /** |
267 * Callback that the plugin invokes to indicate that the connection | 262 * Callback that the plugin invokes to indicate that the connection |
268 * status has changed. | 263 * status has changed. |
269 */ | 264 */ |
270 remoting.ClientSession.prototype.connectionInfoUpdateCallback = function() { | 265 remoting.ClientSession.prototype.connectionInfoUpdateCallback = function() { |
271 var state = this.plugin.status; | 266 var state = this.plugin.status; |
272 | 267 |
273 // TODO(ajwong): We're doing silly type translation here. Any way to avoid? | 268 // TODO(ajwong): We're doing silly type translation here. Any way to avoid? |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 'video_bandwidth': this.plugin.videoBandwidth, | 377 'video_bandwidth': this.plugin.videoBandwidth, |
383 'capture_latency': this.plugin.videoCaptureLatency, | 378 'capture_latency': this.plugin.videoCaptureLatency, |
384 'encode_latency': this.plugin.videoEncodeLatency, | 379 'encode_latency': this.plugin.videoEncodeLatency, |
385 'decode_latency': this.plugin.videoDecodeLatency, | 380 'decode_latency': this.plugin.videoDecodeLatency, |
386 'render_latency': this.plugin.videoRenderLatency, | 381 'render_latency': this.plugin.videoRenderLatency, |
387 'roundtrip_latency': this.plugin.roundTripLatency | 382 'roundtrip_latency': this.plugin.roundTripLatency |
388 }; | 383 }; |
389 }; | 384 }; |
390 | 385 |
391 }()); | 386 }()); |
OLD | NEW |