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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 textBlob = |
93 new Blob([JSON.stringify(peerConnectionDataStore, null, ' ')], | 93 new Blob([JSON.stringify(peerConnectionDataStore, null, ' ')], |
94 {type: 'octet/stream'}); | 94 {type: 'octet/stream'}); |
95 var URL = window.webkitURL.createObjectURL(textBlob); | 95 var URL = window.URL.createObjectURL(textBlob); |
96 this.root_.getElementsByTagName('a')[0].href = URL; | 96 this.root_.getElementsByTagName('a')[0].href = URL; |
97 // The default action of the anchor will download the URL. | 97 // The default action of the anchor will download the URL. |
98 }, | 98 }, |
99 | 99 |
100 /** | 100 /** |
101 * Handles the event of toggling the rtp recording state. | 101 * Handles the event of toggling the rtp recording state. |
102 * | 102 * |
103 * @private | 103 * @private |
104 */ | 104 */ |
105 onRtpToggled_: function() { | 105 onRtpToggled_: function() { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 */ | 152 */ |
153 onUpdate: function(update) { | 153 onUpdate: function(update) { |
154 if (this.recording_) { | 154 if (this.recording_) { |
155 this.status_ = JSON.stringify(update); | 155 this.status_ = JSON.stringify(update); |
156 this.updateDisplay_(); | 156 this.updateDisplay_(); |
157 } | 157 } |
158 }, | 158 }, |
159 }; | 159 }; |
160 return DumpCreator; | 160 return DumpCreator; |
161 })(); | 161 })(); |
OLD | NEW |