| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 /** | 6 /** |
| 7 * Provides the UI to start and stop RTP recording, forwards the start/stop | 7 * Provides the UI to start and stop RTP recording, forwards the start/stop |
| 8 * commands to Chrome, and updates the UI based on dump updates. Also provides | 8 * commands to Chrome, and updates the UI based on dump updates. Also provides |
| 9 * creating a file containing all PeerConnection updates and stats. | 9 * creating a file containing all PeerConnection updates and stats. |
| 10 */ | 10 */ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 enableAecRecording: function() { | 82 enableAecRecording: function() { |
| 83 this.root_.getElementsByTagName('input')[0].checked = true; | 83 this.root_.getElementsByTagName('input')[0].checked = true; |
| 84 }, | 84 }, |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Downloads the PeerConnection updates and stats data as a file. | 87 * Downloads the PeerConnection updates and stats data as a file. |
| 88 * | 88 * |
| 89 * @private | 89 * @private |
| 90 */ | 90 */ |
| 91 onDownloadData_: function() { | 91 onDownloadData_: function() { |
| 92 var textBlob = | 92 var dump_object = |
| 93 new Blob([JSON.stringify(peerConnectionDataStore, null, ' ')], | 93 { |
| 94 {type: 'octet/stream'}); | 94 'getUserMedia': userMediaRequests, |
| 95 'PeerConnections': peerConnectionDataStore, |
| 96 }; |
| 97 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], |
| 98 {type: 'octet/stream'}); |
| 95 var URL = window.webkitURL.createObjectURL(textBlob); | 99 var URL = window.webkitURL.createObjectURL(textBlob); |
| 96 this.root_.getElementsByTagName('a')[0].href = URL; | 100 this.root_.getElementsByTagName('a')[0].href = URL; |
| 97 // The default action of the anchor will download the URL. | 101 // The default action of the anchor will download the URL. |
| 98 }, | 102 }, |
| 99 | 103 |
| 100 /** | 104 /** |
| 101 * Handles the event of toggling the rtp recording state. | 105 * Handles the event of toggling the rtp recording state. |
| 102 * | 106 * |
| 103 * @private | 107 * @private |
| 104 */ | 108 */ |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 */ | 156 */ |
| 153 onUpdate: function(update) { | 157 onUpdate: function(update) { |
| 154 if (this.recording_) { | 158 if (this.recording_) { |
| 155 this.status_ = JSON.stringify(update); | 159 this.status_ = JSON.stringify(update); |
| 156 this.updateDisplay_(); | 160 this.updateDisplay_(); |
| 157 } | 161 } |
| 158 }, | 162 }, |
| 159 }; | 163 }; |
| 160 return DumpCreator; | 164 return DumpCreator; |
| 161 })(); | 165 })(); |
| OLD | NEW |