| 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 for dump creation. | 7 * Provides the UI for dump creation. |
| 8 */ | 8 */ |
| 9 var DumpCreator = (function() { | 9 var DumpCreator = (function() { |
| 10 /** | 10 /** |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ' recommended to choose a new base filename each time or move' + | 50 ' recommended to choose a new base filename each time or move' + |
| 51 ' the resulting files before enabling again. If track processing is' + | 51 ' the resulting files before enabling again. If track processing is' + |
| 52 ' disabled (--disable-audio-track-processing): (1) Only one recording' + | 52 ' disabled (--disable-audio-track-processing): (1) Only one recording' + |
| 53 ' per render process is supported. (2) When the box is unchecked or' + | 53 ' per render process is supported. (2) When the box is unchecked or' + |
| 54 ' this page is closed, ongoing recordings will continue until the' + | 54 ' this page is closed, ongoing recordings will continue until the' + |
| 55 ' call ends or the page with the recording is closed</p>'; | 55 ' call ends or the page with the recording is closed</p>'; |
| 56 | 56 |
| 57 content.getElementsByTagName('a')[0].addEventListener( | 57 content.getElementsByTagName('a')[0].addEventListener( |
| 58 'click', this.onDownloadData_.bind(this)); | 58 'click', this.onDownloadData_.bind(this)); |
| 59 content.getElementsByTagName('input')[0].addEventListener( | 59 content.getElementsByTagName('input')[0].addEventListener( |
| 60 'click', this.onAecRecordingChanged_.bind(this)); | 60 'click', this.onAudioDebugRecordingsChanged_.bind(this)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 DumpCreator.prototype = { | 63 DumpCreator.prototype = { |
| 64 // Mark the AEC recording checkbox checked. | 64 // Mark the diagnostic audio recording checkbox checked. |
| 65 enableAecRecording: function() { | 65 enableAudioDebugRecordings: function() { |
| 66 this.root_.getElementsByTagName('input')[0].checked = true; | 66 this.root_.getElementsByTagName('input')[0].checked = true; |
| 67 }, | 67 }, |
| 68 | 68 |
| 69 // Mark the AEC recording checkbox unchecked. | 69 // Mark the diagnostic audio recording checkbox unchecked. |
| 70 disableAecRecording: function() { | 70 disableAudioDebugRecordings: function() { |
| 71 this.root_.getElementsByTagName('input')[0].checked = false; | 71 this.root_.getElementsByTagName('input')[0].checked = false; |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * Downloads the PeerConnection updates and stats data as a file. | 75 * Downloads the PeerConnection updates and stats data as a file. |
| 76 * | 76 * |
| 77 * @private | 77 * @private |
| 78 */ | 78 */ |
| 79 onDownloadData_: function() { | 79 onDownloadData_: function() { |
| 80 var dump_object = | 80 var dump_object = |
| 81 { | 81 { |
| 82 'getUserMedia': userMediaRequests, | 82 'getUserMedia': userMediaRequests, |
| 83 'PeerConnections': peerConnectionDataStore, | 83 'PeerConnections': peerConnectionDataStore, |
| 84 }; | 84 }; |
| 85 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], | 85 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], |
| 86 {type: 'octet/stream'}); | 86 {type: 'octet/stream'}); |
| 87 var URL = window.URL.createObjectURL(textBlob); | 87 var URL = window.URL.createObjectURL(textBlob); |
| 88 | 88 |
| 89 var anchor = this.root_.getElementsByTagName('a')[0]; | 89 var anchor = this.root_.getElementsByTagName('a')[0]; |
| 90 anchor.href = URL; | 90 anchor.href = URL; |
| 91 anchor.download = 'webrtc_internals_dump.txt'; | 91 anchor.download = 'webrtc_internals_dump.txt'; |
| 92 // The default action of the anchor will download the URL. | 92 // The default action of the anchor will download the URL. |
| 93 }, | 93 }, |
| 94 | 94 |
| 95 /** | 95 /** |
| 96 * Handles the event of toggling the AEC recording state. | 96 * Handles the event of toggling the audio debug recordings state. |
| 97 * | 97 * |
| 98 * @private | 98 * @private |
| 99 */ | 99 */ |
| 100 onAecRecordingChanged_: function() { | 100 onAudioDebugRecordingsChanged_: function() { |
| 101 var enabled = this.root_.getElementsByTagName('input')[0].checked; | 101 var enabled = this.root_.getElementsByTagName('input')[0].checked; |
| 102 if (enabled) { | 102 if (enabled) { |
| 103 chrome.send('enableAecRecording'); | 103 chrome.send('enableAudioDebugRecordings'); |
| 104 } else { | 104 } else { |
| 105 chrome.send('disableAecRecording'); | 105 chrome.send('disableAudioDebugRecordings'); |
| 106 } | 106 } |
| 107 }, | 107 }, |
| 108 }; | 108 }; |
| 109 return DumpCreator; | 109 return DumpCreator; |
| 110 })(); | 110 })(); |
| OLD | NEW |