Bug 1133862 - Remove MSE debug User Agent string. r=mconley, a=sledru
authorRalph Giles <giles@mozilla.com>
Wed, 01 Apr 2015 16:29:12 -0700
changeset 258297 f9441895096d
parent 258296 f4f4979e09b2
child 258298 ce2f9cedb975
push id4638
push userryanvm@gmail.com
push date2015-04-06 20:41 +0000
treeherdermozilla-beta@499e1c563939 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, sledru
bugs1133862, 1127448
milestone38.0
Bug 1133862 - Remove MSE debug User Agent string. r=mconley, a=sledru This reverts bug 1127448, removing the build id from the user agent string we send to youtube in non-release builds. Now that the feature is in release we no longer need this code for testing.
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -117,23 +117,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "ContentSearch",
                                   "resource:///modules/ContentSearch.jsm");
 
 #ifdef E10S_TESTING_ONLY
 XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
                                   "resource://gre/modules/UpdateChannel.jsm");
 #endif
 
-
-#if defined(MOZ_UPDATE_CHANNEL) && MOZ_UPDATE_CHANNEL != release
-#define MOZ_DEBUG_UA // Shorthand define for subsequent conditional sections.
-XPCOMUtils.defineLazyModuleGetter(this, "UserAgentOverrides",
-                                  "resource://gre/modules/UserAgentOverrides.jsm");
-#endif
-
 XPCOMUtils.defineLazyGetter(this, "ShellService", function() {
   try {
     return Cc["@mozilla.org/browser/shell-service;1"].
            getService(Ci.nsIShellService);
   }
   catch(ex) {
     return null;
   }
@@ -632,21 +625,16 @@ BrowserGlue.prototype = {
     ReaderParent.init();
 
     SelfSupportBackend.init();
 
 #ifdef NIGHTLY_BUILD
     Services.prefs.addObserver(POLARIS_ENABLED, this, false);
 #endif
 
-#ifdef MOZ_DEBUG_UA
-    UserAgentOverrides.init();
-    DebugUserAgent.init();
-#endif
-
     Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
   },
 
   _checkForOldBuildUpdates: function () {
     // check for update if our build is old
     if (Services.prefs.getBoolPref("app.update.enabled") &&
         Services.prefs.getBoolPref("app.update.checkInstallTime")) {
 
@@ -898,19 +886,16 @@ BrowserGlue.prototype = {
 
     CustomizationTabPreloader.uninit();
     WebappManager.uninit();
 #ifdef NIGHTLY_BUILD
     if (Services.prefs.getBoolPref("dom.identity.enabled")) {
       SignInToWebsiteUX.uninit();
     }
 #endif
-#ifdef MOZ_DEBUG_UA
-    UserAgentOverrides.uninit();
-#endif
     webrtcUI.uninit();
     FormValidationHandler.uninit();
   },
 
   _initServiceDiscovery: function () {
     if (!Services.prefs.getBoolPref("browser.casting.enabled")) {
       return;
     }
@@ -2864,41 +2849,8 @@ this.NSGetFactory = XPCOMUtils.generateN
 
 // Listen for UITour messages.
 // Do it here instead of the UITour module itself so that the UITour module is lazy loaded
 // when the first message is received.
 let globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
 globalMM.addMessageListener("UITour:onPageEvent", function(aMessage) {
   UITour.onPageEvent(aMessage, aMessage.data);
 });
-
-#ifdef MOZ_DEBUG_UA
-// Modify the user agent string for specific domains
-// to route debug information through their logging.
-var DebugUserAgent = {
-  DEBUG_UA: null,
-  DOMAINS: [
-    'youtube.com',
-    'www.youtube.com',
-    'youtube-nocookie.com',
-    'www.youtube-nocookie.com',
-  ],
-
-  init: function() {
-    // Only run if the MediaSource Extension API is available.
-    if (!Services.prefs.getBoolPref("media.mediasource.enabled")) {
-      return;
-    }
-    // Install our override filter.
-    UserAgentOverrides.addComplexOverride(this.onRequest.bind(this));
-    let ua = Cc["@mozilla.org/network/protocol;1?name=http"]
-                .getService(Ci.nsIHttpProtocolHandler).userAgent;
-    this.DEBUG_UA = ua + " Build/" + Services.appinfo.appBuildID;
-  },
-
-  onRequest: function(channel, defaultUA) {
-    if (this.DOMAINS.indexOf(channel.URI.host) != -1) {
-      return this.DEBUG_UA;
-    }
-    return null;
-  },
-};
-#endif // MOZ_DEBUG_UA