зеркало из https://github.com/mozilla/gecko-dev.git
Bug 776376 - Hardcode navigator.productSub to 20100101 for backward compatibility. r=bz sr=jst
This commit is contained in:
Родитель
b52dbb1296
Коммит
f84feecdf8
|
@ -341,52 +341,16 @@ Navigator::GetVendorSub(nsAString& aVendorSub)
|
|||
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
|
||||
|
|
|
@ -1463,20 +1463,6 @@ nsHttpHandler::GetAppVersion(nsACString &value)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "nsIProxiedProtocolHandler.idl"
|
||||
|
||||
[scriptable, uuid(9814fdf0-5ac3-11e0-80e3-0800200c9a66)]
|
||||
[scriptable, uuid(c48126d9-2ddd-485b-a51a-378e917e75f8)]
|
||||
interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
|
||||
{
|
||||
/**
|
||||
|
@ -27,16 +27,6 @@ interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче