diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/content/browser/resources | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/browser/resources')
9 files changed, 33 insertions, 73 deletions
diff --git a/chromium/content/browser/resources/BUILD.gn b/chromium/content/browser/resources/BUILD.gn index a0c48ddc8ae..f7c84ddb913 100644 --- a/chromium/content/browser/resources/BUILD.gn +++ b/chromium/content/browser/resources/BUILD.gn @@ -2,9 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//ui/webui/webui_features.gni") +import("//third_party/closure_compiler/compile_js.gni") -if (closure_compile) { +if (enable_js_type_check) { group("closure_compile") { deps = [ "histograms:closure_compile", diff --git a/chromium/content/browser/resources/conversions/conversion_internals.js b/chromium/content/browser/resources/conversions/conversion_internals.js index 9b87dfdf1ea..cd89543f203 100644 --- a/chromium/content/browser/resources/conversions/conversion_internals.js +++ b/chromium/content/browser/resources/conversions/conversion_internals.js @@ -28,7 +28,7 @@ let reports = null; * @param {!HTMLElement} table DOM element corresponding to table body. */ function clearTable(table) { - table.innerHTML = ''; + table.innerHTML = trustedTypes.emptyHTML; } /** diff --git a/chromium/content/browser/resources/gpu/info_view.js b/chromium/content/browser/resources/gpu/info_view.js index 8499070823b..3a31fd212e6 100644 --- a/chromium/content/browser/resources/gpu/info_view.js +++ b/chromium/content/browser/resources/gpu/info_view.js @@ -537,7 +537,7 @@ cr.define('gpu', function() { throw new Error('Node ' + outputElementId + ' not found'); } - peg.innerHTML = ''; + peg.innerHTML = trustedTypes.emptyHTML; peg.appendChild(template); } }; diff --git a/chromium/content/browser/resources/histograms/histograms_internals.js b/chromium/content/browser/resources/histograms/histograms_internals.js index 8069d46c206..00d71ea3318 100644 --- a/chromium/content/browser/resources/histograms/histograms_internals.js +++ b/chromium/content/browser/resources/histograms/histograms_internals.js @@ -19,6 +19,7 @@ function requestHistograms() { * of header and body strings representing histograms. */ function addHistograms(histograms) { + $('histograms').innerHTML = trustedTypes.emptyHTML; // TBD(jar) Write a nice HTML bar chart, with divs an mouse-overs etc. for (const histogram of histograms) { const {header, body} = histogram; diff --git a/chromium/content/browser/resources/media/dump_creator.js b/chromium/content/browser/resources/media/dump_creator.js index c4758e784de..328d45ca2b5 100644 --- a/chromium/content/browser/resources/media/dump_creator.js +++ b/chromium/content/browser/resources/media/dump_creator.js @@ -28,58 +28,7 @@ var DumpCreator = (function() { var content = document.createElement('div'); this.root_.appendChild(content); - content.innerHTML = '<div><a><button>' + - 'Download the PeerConnection updates and stats data' + - '</button></a></div>' + - '<p><label><input type=checkbox>' + - 'Enable diagnostic audio recordings</label></p>' + - '<p class=audio-diagnostic-dumps-info>A diagnostic audio recording is' + - ' used for analyzing audio problems. It consists of several files and' + - ' contains the audio played out to the speaker (output) and captured' + - ' from the microphone (input). The data is saved locally.' + - ' Checking this box will enable recordings of all ongoing input and' + - ' output audio streams (including non-WebRTC streams) and for future' + - ' audio streams. When the box is unchecked or this page is closed,' + - ' all ongoing recordings will be stopped and this recording' + - ' functionality disabled. Recording audio from multiple tabs is' + - ' supported as well as multiple recordings from the same tab.</p>' + - '<p>When enabling, select a base filename to which the following' + - ' suffixes will be added:</p>' + - '<p><div><base filename>.<render process ID>' + - '.aec_dump.<AEC dump recording ID></div>' + - '<div><base filename>.input.<stream recording ID>.wav' + - '</div><div>' + - '<base filename>.output.<stream recording ID>.wav' + - '</div></p>' + - '<p class=audio-diagnostic-dumps-info>It is recommended to choose a' + - ' new base filename each time the feature is enabled to avoid ending' + - ' up with partially overwritten or unusable audio files.</p>' + - '<p><label><input type=checkbox disabled=true>' + - 'Enable diagnostic packet and event recording' + - '<label name="placeholder_for_warning"/></label></p>' + - '<p class=audio-diagnostic-dumps-info>A diagnostic packet and event' + - ' recording can be used for analyzing various issues related to' + - ' thread starvation, jitter buffers or bandwidth estimation. Two' + - ' types of data are logged. First, incoming and outgoing RTP headers' + - ' and RTCP packets are logged. These do not include any audio or' + - ' video information, nor any other types of personally identifiable' + - ' information (so no IP addresses or URLs). Checking this box will' + - ' enable the recording for ongoing WebRTC calls and for future' + - ' WebRTC calls. When the box is unchecked or this page is closed,' + - ' all ongoing recordings will be stopped and this recording' + - ' functionality will be disabled for future WebRTC calls. Recording' + - ' in multiple tabs or multiple recordings in the same tab will cause' + - ' multiple log files to be created. When enabling, a filename for the' + - ' recording can be entered. The entered filename is used as a' + - ' base, to which the following suffixes will be appended.</p>' + - ' <p><base filename>_<date>_<timestamp>_<render ' + - 'process ID>_<recording ID></p>' + - '<p class=audio-diagnostic-dumps-info>If a file with the same name' + - ' already exists, it will be overwritten. No more than 5 logfiles ' + - ' will be created, and each of them is limited to 60MB of storage. ' + - ' On Android these limits are 3 files of at most 10MB each. ' + - ' When the limit is reached, the checkbox must be unchecked and ' + - ' rechecked to resume logging.</p>'; + content.appendChild($('dump-template').content.cloneNode(true)); content.getElementsByTagName('a')[0].addEventListener( 'click', this.onDownloadData_.bind(this)); content.getElementsByTagName('input')[0].addEventListener( @@ -128,13 +77,13 @@ var DumpCreator = (function() { * @private */ onDownloadData_: function() { - var dump_object = { + var dumpObject = { 'getUserMedia': userMediaRequests, 'PeerConnections': peerConnectionDataStore, 'UserAgent': navigator.userAgent, }; var textBlob = new Blob( - [JSON.stringify(dump_object, null, ' ')], {type: 'octet/stream'}); + [JSON.stringify(dumpObject, null, 1)], {type: 'octet/stream'}); var URL = window.URL.createObjectURL(textBlob); var anchor = this.root_.getElementsByTagName('a')[0]; diff --git a/chromium/content/browser/resources/media/media_internals_resources.grd b/chromium/content/browser/resources/media/media_internals_resources.grd index 09b41a4e56f..149213037db 100644 --- a/chromium/content/browser/resources/media/media_internals_resources.grd +++ b/chromium/content/browser/resources/media/media_internals_resources.grd @@ -18,12 +18,10 @@ file="media_internals.html" flattenhtml="true" allowexternalscript="true" - compress="gzip" type="BINDATA" /> <include name="IDR_MEDIA_INTERNALS_JS" file="media_internals.js" flattenhtml="true" - compress="gzip" type="BINDATA" /> </includes> </release> diff --git a/chromium/content/browser/resources/media/peer_connection_update_table.js b/chromium/content/browser/resources/media/peer_connection_update_table.js index 289a08b9c63..3d9fb920d2c 100644 --- a/chromium/content/browser/resources/media/peer_connection_update_table.js +++ b/chromium/content/browser/resources/media/peer_connection_update_table.js @@ -82,7 +82,9 @@ var PeerConnectionUpdateTable = (function() { tableElement.firstChild.appendChild(row); var time = new Date(parseFloat(update.time)); - row.innerHTML = '<td>' + time.toLocaleString() + '</td>'; + const timeItem = document.createElement('td'); + timeItem.textContent = time.toLocaleString(); + row.appendChild(timeItem); // map internal event names to spec event names. var type = { @@ -98,7 +100,9 @@ var PeerConnectionUpdateTable = (function() { update.type; if (update.value.length === 0) { - row.innerHTML += '<td>' + type + '</td>'; + const typeItem = document.createElement('td'); + typeItem.textContent = type; + row.appendChild(typeItem); return; } @@ -118,8 +122,9 @@ var PeerConnectionUpdateTable = (function() { type += ' (munged)'; } } - row.innerHTML += - '<td><details><summary>' + type + '</summary></details></td>'; + const summaryItem = $('summary-template').content.cloneNode(true); + summaryItem.querySelector('summary').textContent = type; + row.appendChild(summaryItem); var valueContainer = document.createElement('pre'); var details = row.cells[1].childNodes[0]; @@ -190,8 +195,8 @@ var PeerConnectionUpdateTable = (function() { tableElement.id = tableId; tableElement.border = 1; tableContainer.appendChild(tableElement); - tableElement.innerHTML = '<tr><th>Time</th>' + - '<th class="update-log-header-event">Event</th></tr>'; + tableElement.appendChild( + $('time-event-template').content.cloneNode(true)); } return tableElement; }, diff --git a/chromium/content/browser/resources/media/stats_graph_helper.js b/chromium/content/browser/resources/media/stats_graph_helper.js index ac31f4a49e6..cc222ab8acd 100644 --- a/chromium/content/browser/resources/media/stats_graph_helper.js +++ b/chromium/content/browser/resources/media/stats_graph_helper.js @@ -387,7 +387,7 @@ function ensureStatsGraphTopContainer(peerConnectionElement, report) { container.className = 'stats-graph-container'; peerConnectionElement.appendChild(container); - container.innerHTML = '<summary><span></span></summary>'; + container.appendChild($('summary-span-template').content.cloneNode(true)); container.firstChild.firstChild.className = STATS_GRAPH_CONTAINER_HEADING_CLASS; container.firstChild.firstChild.textContent = @@ -421,8 +421,11 @@ function createStatsGraphView(peerConnectionElement, report, statsName) { container.className = 'stats-graph-sub-container'; topContainer.appendChild(container); - container.innerHTML = '<div>' + statsName + '</div>' + - '<div id=' + divId + '><canvas id=' + canvasId + '></canvas></div>'; + const canvasDiv = $('container-template').content.cloneNode(true); + canvasDiv.querySelectorAll('div')[0].textContent = statsName; + canvasDiv.querySelectorAll('div')[1].id = divId; + canvasDiv.querySelector('canvas').id = canvasId; + container.appendChild(canvasDiv); if (statsName === 'bweCompound') { container.insertBefore( createBweCompoundLegend(peerConnectionElement, report.id), $(divId)); @@ -437,7 +440,8 @@ function createBweCompoundLegend(peerConnectionElement, reportId) { for (var prop in bweCompoundGraphConfig) { var div = document.createElement('div'); legend.appendChild(div); - div.innerHTML = '<input type=checkbox checked>' + prop; + div.appendChild($('checkbox-template').content.cloneNode(true)); + div.appendChild(document.createTextNode(prop)); div.style.color = bweCompoundGraphConfig[prop].color; div.dataSeriesId = reportId + '-' + prop; div.graphViewId = diff --git a/chromium/content/browser/resources/media/stats_table.js b/chromium/content/browser/resources/media/stats_table.js index 4bf82af5905..f567c8a0df9 100644 --- a/chromium/content/browser/resources/media/stats_table.js +++ b/chromium/content/browser/resources/media/stats_table.js @@ -105,11 +105,12 @@ var StatsTable = (function(ssrcInfoManager) { table.id = tableId; table.border = 1; - table.innerHTML = '<tr><th colspan=2></th></tr>'; + table.appendChild($('trth-template').content.cloneNode(true)); table.rows[0].cells[0].textContent = 'Statistics ' + report.id; if (report.type === 'ssrc') { table.insertRow(1); - table.rows[1].innerHTML = '<td colspan=2></td>'; + table.rows[1].appendChild( + $('td-colspan-template').content.cloneNode(true)); this.ssrcInfoManager_.populateSsrcInfo( table.rows[1].cells[0], GetSsrcFromReport(report)); } @@ -150,7 +151,9 @@ var StatsTable = (function(ssrcInfoManager) { trElement = document.createElement('tr'); trElement.id = trId; statsTable.firstChild.appendChild(trElement); - trElement.innerHTML = '<td>' + rowName + '</td><td></td>'; + const item = $('td2-template').content.cloneNode(true); + item.querySelector('td').textContent = rowName; + trElement.appendChild(item); } trElement.cells[1].textContent = value; |