Chromium Code Reviews| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 /** | 111 /** |
| 112 * Downloads the PeerConnection updates and stats data as a file. | 112 * Downloads the PeerConnection updates and stats data as a file. |
| 113 * | 113 * |
| 114 * @private | 114 * @private |
| 115 */ | 115 */ |
| 116 onDownloadData_: function() { | 116 onDownloadData_: function() { |
| 117 var dump_object = | 117 var dump_object = |
| 118 { | 118 { |
| 119 'getUserMedia': userMediaRequests, | 119 'getUserMedia': userMediaRequests, |
| 120 'PeerConnections': peerConnectionDataStore, | 120 'PeerConnections': peerConnectionDataStore, |
| 121 'User-Agent': navigator.userAgent, | |
|
hta-webrtc
2016/12/01 14:02:18
Nit: Can we make it "UserAgent"? My head hurts eve
| |
| 121 }; | 122 }; |
| 122 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], | 123 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], |
| 123 {type: 'octet/stream'}); | 124 {type: 'octet/stream'}); |
| 124 var URL = window.URL.createObjectURL(textBlob); | 125 var URL = window.URL.createObjectURL(textBlob); |
| 125 | 126 |
| 126 var anchor = this.root_.getElementsByTagName('a')[0]; | 127 var anchor = this.root_.getElementsByTagName('a')[0]; |
| 127 anchor.href = URL; | 128 anchor.href = URL; |
| 128 anchor.download = 'webrtc_internals_dump.txt'; | 129 anchor.download = 'webrtc_internals_dump.txt'; |
| 129 // The default action of the anchor will download the URL. | 130 // The default action of the anchor will download the URL. |
| 130 }, | 131 }, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 152 var enabled = this.root_.getElementsByTagName('input')[1].checked; | 153 var enabled = this.root_.getElementsByTagName('input')[1].checked; |
| 153 if (enabled) { | 154 if (enabled) { |
| 154 chrome.send('enableEventLogRecordings'); | 155 chrome.send('enableEventLogRecordings'); |
| 155 } else { | 156 } else { |
| 156 chrome.send('disableEventLogRecordings'); | 157 chrome.send('disableEventLogRecordings'); |
| 157 } | 158 } |
| 158 }, | 159 }, |
| 159 }; | 160 }; |
| 160 return DumpCreator; | 161 return DumpCreator; |
| 161 })(); | 162 })(); |
| OLD | NEW |