Bug 776376 - Hardcode navigator.productSub to 20100101 for backward compatibility. r=bz sr=jst
authorDão Gottwald <dao@mozilla.com>
Fri, 27 Jul 2012 14:09:59 +0200
changeset 100732 8ddfcd0a45a545f3193a2db28866b8e4e418ff7d
parent 100731 cfd51eea1b4c98f575d3819cff1fda9ecc6a7461
child 100733 c6b3dbee10d967878c9d7a3ef3502f929d7703b0
push id23193
push userryanvm@gmail.com
push dateSat, 28 Jul 2012 21:54:39 +0000
treeherdermozilla-central@29bff59d3bbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, jst
bugs776376, 20100101
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 776376 - Hardcode navigator.productSub to 20100101 for backward compatibility. r=bz sr=jst
dom/base/Navigator.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsIHttpProtocolHandler.idl
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -336,62 +336,26 @@ Navigator::GetVendorSub(nsAString& aVend
 {
   aVendorSub.Truncate();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Navigator::GetProduct(nsAString& aProduct)
 {
-  nsresult rv;
-
-  nsCOMPtr<nsIHttpProtocolHandler>
-    service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCAutoString product;
-  rv = service->GetProduct(product);
-  CopyASCIItoUTF16(product, aProduct);
-
-  return rv;
+  aProduct.AssignLiteral("Gecko");
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 Navigator::GetProductSub(nsAString& aProductSub)
 {
-  if (!nsContentUtils::IsCallerTrustedForRead()) {
-    const nsAdoptingString& override =
-      Preferences::GetString("general.productSub.override");
-
-    if (override) {
-      aProductSub = override;
-      return NS_OK;
-    }
-
-    // 'general.useragent.productSub' backwards compatible with 1.8 branch.
-    const nsAdoptingString& override2 =
-      Preferences::GetString("general.useragent.productSub");
-
-    if (override2) {
-      aProductSub = override2;
-      return NS_OK;
-    }
-  }
-
-  nsresult rv;
-
-  nsCOMPtr<nsIHttpProtocolHandler>
-    service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCAutoString productSub;
-  rv = service->GetProductSub(productSub);
-  CopyASCIItoUTF16(productSub, aProductSub);
-
-  return rv;
+  // Legacy build ID hardcoded for backward compatibility (bug 776376)
+  aProductSub.AssignLiteral("20100101");
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 Navigator::GetMimeTypes(nsIDOMMimeTypeArray** aMimeTypes)
 {
   if (!mMimeTypes) {
     mMimeTypes = new nsMimeTypeArray(this);
   }
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -1459,30 +1459,16 @@ nsHttpHandler::GetAppName(nsACString &va
 NS_IMETHODIMP
 nsHttpHandler::GetAppVersion(nsACString &value)
 {
     value = mLegacyAppVersion;
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHttpHandler::GetProduct(nsACString &value)
-{
-    value = mProduct;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHttpHandler::GetProductSub(nsACString &value)
-{
-    value = mProductSub;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
 nsHttpHandler::GetPlatform(nsACString &value)
 {
     value = mPlatform;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHttpHandler::GetOscpu(nsACString &value)
--- a/netwerk/protocol/http/nsIHttpProtocolHandler.idl
+++ b/netwerk/protocol/http/nsIHttpProtocolHandler.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #include "nsIProxiedProtocolHandler.idl"
 
-[scriptable, uuid(9814fdf0-5ac3-11e0-80e3-0800200c9a66)]
+[scriptable, uuid(c48126d9-2ddd-485b-a51a-378e917e75f8)]
 interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
 {
     /**
      * Get the HTTP advertised user agent string.
      */
     readonly attribute ACString userAgent;
 
     /**
@@ -23,26 +23,16 @@ interface nsIHttpProtocolHandler : nsIPr
     /**
      * Get the application version string.
      *
      * @return The complete version (major and minor) string. (eg. "5.0")
      */
     readonly attribute ACString appVersion;
 
     /**
-     * @return The product name.
-     */
-    readonly attribute ACString product;
-
-    /**
-     * @return A product sub string.
-     */
-    readonly attribute ACString productSub;
-
-    /**
      * Get the current platform.
      *
      * @return The platform this application is running on
      *		   (eg. "Windows", "Macintosh", "X11")
      */
     readonly attribute ACString platform;
 
     /**