Bug 572656 - Remove the UI language from the UA string and navigator.appVersion. r=bz
authorDão Gottwald <dao@mozilla.com>
Mon, 19 Jul 2010 22:18:11 +0200
changeset 47938 7a07bba40e1470368a475a7385b665fd0fa5e961
parent 47937 6f14e67fbfcd29f15a36b8648f52484463ea075d
child 47939 90b4a68fae07268bbe9534b918eb2596f4829223
push idunknown
push userunknown
push dateunknown
reviewersbz
bugs572656
milestone2.0b2pre
Bug 572656 - Remove the UI language from the UA string and navigator.appVersion. r=bz
dom/base/nsGlobalWindow.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsIHttpProtocolHandler.idl
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9818,23 +9818,16 @@ nsNavigator::GetAppVersion(nsAString& aA
     aAppVersion.AppendLiteral(" (");
 
     rv = service->GetPlatform(str);
     if (NS_FAILED(rv))
       return rv;
 
     AppendASCIItoUTF16(str, aAppVersion);
 
-    aAppVersion.AppendLiteral("; ");
-
-    rv = service->GetLanguage(str);
-    if (NS_FAILED(rv))
-      return rv;
-    AppendASCIItoUTF16(str, aAppVersion);
-
     aAppVersion.Append(PRUnichar(')'));
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsNavigator::GetAppName(nsAString& aAppName)
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -608,17 +608,16 @@ nsHttpHandler::BuildUserAgent()
 
     // preallocate to worst-case size, which should always be better
     // than if we didn't preallocate at all.
     mUserAgent.SetCapacity(mAppName.Length() + 
                            mAppVersion.Length() + 
                            mPlatform.Length() + 
                            mOscpu.Length() +
                            mDeviceType.Length() +
-                           mLanguage.Length() +
                            mMisc.Length() +
                            mProduct.Length() +
                            mProductSub.Length() +
                            mProductComment.Length() +
                            mVendor.Length() +
                            mVendorSub.Length() +
                            mVendorComment.Length() +
                            mExtraUA.Length() +
@@ -630,20 +629,16 @@ nsHttpHandler::BuildUserAgent()
     mUserAgent += mAppVersion;
     mUserAgent += ' ';
 
     // Application comment
     mUserAgent += '(';
     mUserAgent += mPlatform;
     mUserAgent.AppendLiteral("; ");
     mUserAgent += mOscpu;
-    if (!mLanguage.IsEmpty()) {
-        mUserAgent.AppendLiteral("; ");
-        mUserAgent += mLanguage;
-    }
     if (!mMisc.IsEmpty()) {
         mUserAgent.AppendLiteral("; ");
         mUserAgent += mMisc;
     }
     mUserAgent += ')';
 
     // Product portion
     if (!mProduct.IsEmpty()) {
@@ -1730,23 +1725,16 @@ nsHttpHandler::GetDeviceType(nsACString 
 }
 
 NS_IMETHODIMP
 nsHttpHandler::GetLanguage(nsACString &value)
 {
     value = mLanguage;
     return NS_OK;
 }
-NS_IMETHODIMP
-nsHttpHandler::SetLanguage(const nsACString &value)
-{
-    mLanguage = value;
-    mUserAgentIsDirty = PR_TRUE;
-    return NS_OK;
-}
 
 NS_IMETHODIMP
 nsHttpHandler::GetMisc(nsACString &value)
 {
     value = mMisc;
     return NS_OK;
 }
 NS_IMETHODIMP
--- a/netwerk/protocol/http/nsIHttpProtocolHandler.idl
+++ b/netwerk/protocol/http/nsIHttpProtocolHandler.idl
@@ -34,17 +34,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIProxiedProtocolHandler.idl"
 
-[scriptable, uuid(415D4087-79D3-40FE-B194-0ADA8471F895)]
+[scriptable, uuid(a2479d10-9277-11df-981c-0800200c9a66)]
 interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
 {
     /**
      * Get the HTTP advertised user agent string.
      */
     readonly attribute ACString userAgent;
 
     /**
@@ -106,17 +106,17 @@ interface nsIHttpProtocolHandler : nsIPr
      */
     readonly attribute ACString oscpu;
 
     /**
      * Get the translation of the application. The value for language
      * is usually a 2-letter code such as "en" and occasionally a 
      * five-character code to indicate a language subtype, such as "zh_CN". 
      */
-    attribute ACString language;
+    readonly attribute ACString language;
 
     /**
      * Get/Set the application comment misc portion.
      */
     attribute ACString misc;
 
     /**
      * Get the current device type.