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 * Class handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 }; | 192 }; |
193 | 193 |
194 /** | 194 /** |
195 * Deletes the <embed> element from the container and disconnects. | 195 * Deletes the <embed> element from the container and disconnects. |
196 * | 196 * |
197 * @return {void} Nothing. | 197 * @return {void} Nothing. |
198 */ | 198 */ |
199 remoting.ClientSession.prototype.disconnect = function() { | 199 remoting.ClientSession.prototype.disconnect = function() { |
200 if (remoting.wcs) { | 200 if (remoting.wcs) { |
201 remoting.wcs.setOnIq(function(stanza) {}); | 201 remoting.wcs.setOnIq(function(stanza) {}); |
| 202 this.sendIq_( |
| 203 '<cli:iq ' + |
| 204 'to="' + this.hostJid + '" ' + |
| 205 'type="set" ' + |
| 206 'id="session-terminate" ' + |
| 207 'xmlns:cli="jabber:client">' + |
| 208 '<jingle ' + |
| 209 'xmlns="urn:xmpp:jingle:1" ' + |
| 210 'action="session-terminate" ' + |
| 211 'initiator="' + this.clientJid + '" ' + |
| 212 'sid="' + this.sessionId + '">' + |
| 213 '<reason><success/></reason>' + |
| 214 '</jingle>' + |
| 215 '</cli:iq>'); |
202 } | 216 } |
203 this.removePlugin(); | 217 this.removePlugin(); |
204 this.sendIq_( | |
205 '<cli:iq ' + | |
206 'to="' + this.hostJid + '" ' + | |
207 'type="set" ' + | |
208 'id="session-terminate" ' + | |
209 'xmlns:cli="jabber:client">' + | |
210 '<jingle ' + | |
211 'xmlns="urn:xmpp:jingle:1" ' + | |
212 'action="session-terminate" ' + | |
213 'initiator="' + this.clientJid + '" ' + | |
214 'sid="' + this.sessionId + '">' + | |
215 '<reason><success/></reason>' + | |
216 '</jingle>' + | |
217 '</cli:iq>'); | |
218 }; | 218 }; |
219 | 219 |
220 /** | 220 /** |
221 * Sends an IQ stanza via the http xmpp proxy. | 221 * Sends an IQ stanza via the http xmpp proxy. |
222 * | 222 * |
223 * @private | 223 * @private |
224 * @param {string} msg XML string of IQ stanza to send to server. | 224 * @param {string} msg XML string of IQ stanza to send to server. |
225 * @return {void} Nothing. | 225 * @return {void} Nothing. |
226 */ | 226 */ |
227 remoting.ClientSession.prototype.sendIq_ = function(msg) { | 227 remoting.ClientSession.prototype.sendIq_ = function(msg) { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 return { | 408 return { |
409 'video_bandwidth': this.plugin.videoBandwidth, | 409 'video_bandwidth': this.plugin.videoBandwidth, |
410 'video_frame_rate': this.plugin.videoFramerate, | 410 'video_frame_rate': this.plugin.videoFramerate, |
411 'capture_latency': this.plugin.videoCaptureLatency, | 411 'capture_latency': this.plugin.videoCaptureLatency, |
412 'encode_latency': this.plugin.videoEncodeLatency, | 412 'encode_latency': this.plugin.videoEncodeLatency, |
413 'decode_latency': this.plugin.videoDecodeLatency, | 413 'decode_latency': this.plugin.videoDecodeLatency, |
414 'render_latency': this.plugin.videoRenderLatency, | 414 'render_latency': this.plugin.videoRenderLatency, |
415 'roundtrip_latency': this.plugin.roundTripLatency | 415 'roundtrip_latency': this.plugin.roundTripLatency |
416 }; | 416 }; |
417 }; | 417 }; |
OLD | NEW |