Bug 1362212 - Remove canPlayTelemetry from _delayedStartup. r=dao draft
authorChris Pearce <cpearce@mozilla.com>
Fri, 05 May 2017 17:38:40 +1200
changeset 575154 7075d0a0e1fd88c51da23ab8ef5860a51bf4b2cd
parent 575133 120d8562d4a53e4f78bd86c6f5076f6db265e5a3
child 575155 a8ea7b4b0307a70410d6646d97a96cd8f5d2fa50
child 575158 8a4800ba261cf109e6761f38e3d47a890b1b5dd5
child 576583 72143eab27dd608723ef7eaa7700aa95ab10d3f5
push id57974
push userbmo:cpearce@mozilla.com
push dateWed, 10 May 2017 01:49:25 +0000
reviewersdao
bugs1362212
milestone55.0a1
Bug 1362212 - Remove canPlayTelemetry from _delayedStartup. r=dao Calling HTMLMediaElement.canPlayType() on the main thread will cause us to do disk I/O to load system decoding libraries, so we shouldn't do it on the main thread, let alone on the parent process' main thread. I moved the telemetry into an idle service observer off main thread into Gecko in the previous patch. MozReview-Commit-ID: CH6LNNLzreJ
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1542,30 +1542,16 @@ var gBrowserInit = {
     // Delay this a minute into the idle time because there's no rush.
     requestIdleCallback(() => {
       this.gmpInstallManager = new GMPInstallManager();
       // We don't really care about the results, if someone is interested they
       // can check the log.
       this.gmpInstallManager.simpleCheckAndInstall().then(null, () => {});
     }, {timeout: 1000 * 60});
 
-    // Report via telemetry whether we're able to play MP4/H.264/AAC video.
-    // We suspect that some Windows users have a broken or have not installed
-    // Windows Media Foundation, and we'd like to know how many. We'd also like
-    // to know how good our coverage is on other platforms.
-    // Note: we delay by 90 seconds reporting this, as calling canPlayType()
-    // on Windows will cause DLLs to load, i.e. cause disk I/O.
-    setTimeout(() => {
-      let v = document.createElementNS("http://www.w3.org/1999/xhtml", "video");
-      let aacWorks = v.canPlayType("audio/mp4") != "";
-      Services.telemetry.getHistogramById("VIDEO_CAN_CREATE_AAC_DECODER").add(aacWorks);
-      let h264Works = v.canPlayType("video/mp4") != "";
-      Services.telemetry.getHistogramById("VIDEO_CAN_CREATE_H264_DECODER").add(h264Works);
-    }, 90 * 1000);
-
     SessionStore.promiseInitialized.then(() => {
       // Bail out if the window has been closed in the meantime.
       if (window.closed) {
         return;
       }
 
       // Enable the Restore Last Session command if needed
       RestoreLastSessionObserver.init();