Bug 1136533 - Remove about:media page. r=gavin, a=lmandel
authorChris Double <chris.double@double.co.nz>
Sun, 01 Mar 2015 16:58:00 -0500
changeset 250316 8628f482efe0
parent 250315 a982b8eabc42
child 250317 73c7414f883d
push id4544
push userryanvm@gmail.com
push date2015-03-09 19:49 +0000
treeherdermozilla-beta@d59086707825 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, lmandel
bugs1136533, 1112424
milestone37.0
Bug 1136533 - Remove about:media page. r=gavin, a=lmandel This reverts part 4 patch in bug 1112424 so that "about:media" no longer works. Only beta has this code at the moment. The functionality has been replaced with an addon available from http://github.com/doublec/aboutmedia.
browser/base/content/content.js
docshell/base/nsAboutRedirector.cpp
docshell/build/nsDocShellModule.cpp
toolkit/components/aboutmedia/content/aboutMedia.js
toolkit/components/aboutmedia/content/aboutMedia.xhtml
toolkit/components/aboutmedia/jar.mn
toolkit/components/aboutmedia/moz.build
toolkit/components/moz.build
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -942,33 +942,8 @@ addMessageListener("ContextMenu:SaveVide
   canvas.height = video.videoHeight;
 
   let ctxDraw = canvas.getContext("2d");
   ctxDraw.drawImage(video, 0, 0);
   sendAsyncMessage("ContextMenu:SaveVideoFrameAsImage:Result", {
     dataURL: canvas.toDataURL("image/jpeg", ""),
   });
 });
-
-addMessageListener("AboutMedia:CollectData", (mesage) => {
-  let text = "";
-  let media = content.document.getElementsByTagName('video');
-  if (media.length > 0) {
-    text += content.document.documentURI + "\n";
-  }
-  for (let mediaEl of media) {
-    text += "\t" + mediaEl.currentSrc + "\n";
-    text += "\t" + "currentTime: " + mediaEl.currentTime + "\n";
-    let ms = mediaEl.mozMediaSourceObject;
-    if (ms) {
-      for (let k = 0; k < ms.sourceBuffers.length; ++k) {
-        let sb = ms.sourceBuffers[k];
-        text += "\t\tSourceBuffer " + k + "\n";
-        for (let l = 0; l < sb.buffered.length; ++l) {
-          text += "\t\t\tstart=" + sb.buffered.start(l) + " end=" + sb.buffered.end(l) + "\n";
-        }
-      }
-      text += "\tInternal Data:\n";
-      text += ms.mozDebugReaderData.split("\n").map(line => { return "\t" + line + "\n"; }).join("");
-     }
-  }
-  sendAsyncMessage("AboutMedia:DataCollected", { text: text });
-});
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -64,18 +64,16 @@ static RedirEntry kRedirMap[] = {
     { "support", "chrome://global/content/aboutSupport.xhtml",
       nsIAboutModule::ALLOW_SCRIPT },
     { "telemetry", "chrome://global/content/aboutTelemetry.xhtml",
       nsIAboutModule::ALLOW_SCRIPT },
     { "networking", "chrome://global/content/aboutNetworking.xhtml",
        nsIAboutModule::ALLOW_SCRIPT },
     { "webrtc", "chrome://global/content/aboutwebrtc/aboutWebrtc.xhtml",
        nsIAboutModule::ALLOW_SCRIPT },
-    { "media", "chrome://global/content/aboutMedia.xhtml",
-       nsIAboutModule::ALLOW_SCRIPT },
     // about:srcdoc is unresolvable by specification.  It is included here
     // because the security manager would disallow srcdoc iframes otherwise.
     { "srcdoc", "about:blank",
       nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
       nsIAboutModule::HIDE_FROM_ABOUTABOUT }
 };
 static const int kRedirTotal = mozilla::ArrayLength(kRedirMap);
 
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -169,17 +169,16 @@ const mozilla::Module::ContractIDEntry k
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "compartments", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "memory", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "addons", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newaddon", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "support", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "telemetry", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "networking", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "webrtc", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
-  { NS_ABOUT_MODULE_CONTRACTID_PREFIX "media", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_ABOUT_MODULE_CONTRACTID_PREFIX "srcdoc", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
   { NS_URI_LOADER_CONTRACTID, &kNS_URI_LOADER_CID },
   { NS_DOCUMENTLOADER_SERVICE_CONTRACTID, &kNS_DOCUMENTLOADER_SERVICE_CID },
   { NS_EXTERNALHELPERAPPSERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID },
   { NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID },
   { NS_MIMESERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID },
   { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"default", &kNS_EXTERNALPROTOCOLHANDLER_CID },
   { NS_PREFETCHSERVICE_CONTRACTID, &kNS_PREFETCHSERVICE_CID },
deleted file mode 100644
--- a/toolkit/components/aboutmedia/content/aboutMedia.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-let listener = {
-  receiveMessage: function (msg) {
-    let text = msg.json.text;
-    document.getElementById('data').innerHTML += text;
-  },
-  QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
-};
-
-function getData() {
-  let globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
-  globalMM.addWeakMessageListener("AboutMedia:DataCollected", listener);
-  globalMM.broadcastAsyncMessage("AboutMedia:CollectData");
-}
deleted file mode 100644
--- a/toolkit/components/aboutmedia/content/aboutMedia.xhtml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>about:media</title>
-    <script type="application/javascript;version=1.8" src="chrome://global/content/aboutMedia.js"></script>
-  </head>
-  <body onload="getData()"><h1>HTMLMediaElement debug data</h1><pre id='data'></pre></body>
-</html>
deleted file mode 100644
--- a/toolkit/components/aboutmedia/jar.mn
+++ /dev/null
@@ -1,7 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-toolkit.jar:
-  content/global/aboutMedia.xhtml                     (content/aboutMedia.xhtml)
-  content/global/aboutMedia.js                        (content/aboutMedia.js)
deleted file mode 100644
--- a/toolkit/components/aboutmedia/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JAR_MANIFESTS += ['jar.mn']
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -5,17 +5,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # These component dirs are built for all apps (including suite)
 if CONFIG['MOZ_ENABLE_XREMOTE']:
     DIRS += ['remote']
 
 DIRS += [
     'aboutcache',
-    'aboutmedia',
     'aboutmemory',
     'addoncompat',
     'alerts',
     'apppicker',
     'asyncshutdown',
     'commandlines',
     'console',
     'contentprefs',