mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 581008 - Remove support for appending arbitrary data to the User Agent string. r=jst,khuey sr=dveditz
This commit is contained in:
parent
c570e41da2
commit
ff02b582e2
@ -59,8 +59,6 @@ DEFINES += -DAB_CD=$(AB_CD)
|
|||||||
|
|
||||||
APP_VERSION = $(shell cat $(srcdir)/../config/version.txt)
|
APP_VERSION = $(shell cat $(srcdir)/../config/version.txt)
|
||||||
DEFINES += -DAPP_VERSION="$(APP_VERSION)"
|
DEFINES += -DAPP_VERSION="$(APP_VERSION)"
|
||||||
APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
|
|
||||||
DEFINES += -DAPP_UA_NAME="$(APP_UA_NAME)"
|
|
||||||
|
|
||||||
DIST_FILES = application.ini
|
DIST_FILES = application.ini
|
||||||
|
|
||||||
|
@ -191,7 +191,6 @@ pref("keyword.URL", "");
|
|||||||
|
|
||||||
pref("general.useragent.locale", "@AB_CD@");
|
pref("general.useragent.locale", "@AB_CD@");
|
||||||
pref("general.skins.selectedSkin", "classic/1.0");
|
pref("general.skins.selectedSkin", "classic/1.0");
|
||||||
pref("general.useragent.extra.firefox", "@APP_UA_NAME@/@APP_VERSION@");
|
|
||||||
|
|
||||||
pref("general.smoothScroll", false);
|
pref("general.smoothScroll", false);
|
||||||
#ifdef UNIX_BUT_NOT_MAC
|
#ifdef UNIX_BUT_NOT_MAC
|
||||||
|
@ -1 +1,2 @@
|
|||||||
MOZ_APP_DISPLAYNAME=Minefield
|
MOZ_APP_DISPLAYNAME=Minefield
|
||||||
|
MOZ_APP_UA_NAME=Minefield
|
||||||
|
@ -1 +1,2 @@
|
|||||||
MOZ_APP_DISPLAYNAME="MozillaDeveloperPreview"
|
MOZ_APP_DISPLAYNAME="MozillaDeveloperPreview"
|
||||||
|
MOZ_APP_UA_NAME="MozillaDeveloperPreview"
|
||||||
|
@ -50,8 +50,8 @@ FIREFOX_VERSION = @FIREFOX_VERSION@
|
|||||||
MOZ_BUILD_APP = @MOZ_BUILD_APP@
|
MOZ_BUILD_APP = @MOZ_BUILD_APP@
|
||||||
MOZ_APP_NAME = @MOZ_APP_NAME@
|
MOZ_APP_NAME = @MOZ_APP_NAME@
|
||||||
MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
|
MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
|
||||||
|
MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@
|
||||||
MOZ_APP_VERSION = @MOZ_APP_VERSION@
|
MOZ_APP_VERSION = @MOZ_APP_VERSION@
|
||||||
MOZ_APP_UA_EXTRA = @MOZ_APP_UA_EXTRA@
|
|
||||||
|
|
||||||
MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
|
MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
|
||||||
|
|
||||||
|
@ -8767,8 +8767,11 @@ AC_SUBST(OGLES_SDK_DIR)
|
|||||||
|
|
||||||
AC_SUBST(MOZ_APP_NAME)
|
AC_SUBST(MOZ_APP_NAME)
|
||||||
AC_SUBST(MOZ_APP_DISPLAYNAME)
|
AC_SUBST(MOZ_APP_DISPLAYNAME)
|
||||||
|
AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
|
||||||
|
AC_SUBST(MOZ_APP_UA_NAME)
|
||||||
|
AC_DEFINE_UNQUOTED(MOZ_APP_VERSION, "$MOZ_APP_VERSION")
|
||||||
AC_SUBST(MOZ_APP_VERSION)
|
AC_SUBST(MOZ_APP_VERSION)
|
||||||
AC_SUBST(MOZ_APP_UA_EXTRA)
|
AC_DEFINE_UNQUOTED(FIREFOX_VERSION, "$FIREFOX_VERSION")
|
||||||
AC_SUBST(FIREFOX_VERSION)
|
AC_SUBST(FIREFOX_VERSION)
|
||||||
|
|
||||||
AC_SUBST(MOZ_PKG_SPECIAL)
|
AC_SUBST(MOZ_PKG_SPECIAL)
|
||||||
|
@ -5064,7 +5064,9 @@ AC_SUBST(WINCE_WINDOWS_MOBILE)
|
|||||||
|
|
||||||
AC_SUBST(MOZ_APP_NAME)
|
AC_SUBST(MOZ_APP_NAME)
|
||||||
AC_SUBST(MOZ_APP_DISPLAYNAME)
|
AC_SUBST(MOZ_APP_DISPLAYNAME)
|
||||||
|
AC_SUBST(MOZ_APP_UA_NAME)
|
||||||
AC_SUBST(MOZ_APP_VERSION)
|
AC_SUBST(MOZ_APP_VERSION)
|
||||||
|
AC_SUBST(FIREFOX_VERSION)
|
||||||
|
|
||||||
AC_SUBST(MOZ_PKG_SPECIAL)
|
AC_SUBST(MOZ_PKG_SPECIAL)
|
||||||
|
|
||||||
|
@ -353,8 +353,8 @@ function BuildConditionSandbox(aURL) {
|
|||||||
getService(CI.nsIHttpProtocolHandler);
|
getService(CI.nsIHttpProtocolHandler);
|
||||||
sandbox.http = {};
|
sandbox.http = {};
|
||||||
for each (var prop in [ "userAgent", "appName", "appVersion",
|
for each (var prop in [ "userAgent", "appName", "appVersion",
|
||||||
"vendor", "vendorSub", "vendorComment",
|
"vendor", "vendorSub",
|
||||||
"product", "productSub", "productComment",
|
"product", "productSub",
|
||||||
"platform", "oscpu", "language", "misc" ])
|
"platform", "oscpu", "language", "misc" ])
|
||||||
sandbox.http[prop] = hh[prop];
|
sandbox.http[prop] = hh[prop];
|
||||||
// see if we have the test plugin available,
|
// see if we have the test plugin available,
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
pref("keyword.URL", "http://www.google.com/search?ie=UTF-8&oe=utf-8&q=");
|
pref("keyword.URL", "http://www.google.com/search?ie=UTF-8&oe=utf-8&q=");
|
||||||
pref("keyword.enabled", false);
|
pref("keyword.enabled", false);
|
||||||
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
||||||
|
pref("general.useragent.compatMode.firefox", false);
|
||||||
|
|
||||||
pref("general.config.obscure_value", 13); // for MCD .cfg files
|
pref("general.config.obscure_value", 13); // for MCD .cfg files
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
* Bradley Baetz <bbaetz@netscape.com>
|
* Bradley Baetz <bbaetz@netscape.com>
|
||||||
* Benjamin Smedberg <bsmedberg@covad.net>
|
* Benjamin Smedberg <bsmedberg@covad.net>
|
||||||
* Josh Aas <josh@mozilla.com>
|
* Josh Aas <josh@mozilla.com>
|
||||||
|
* Dão Gottwald <dao@mozilla.com>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
@ -119,8 +120,6 @@ static NS_DEFINE_CID(kCacheServiceCID, NS_CACHESERVICE_CID);
|
|||||||
static NS_DEFINE_CID(kSocketProviderServiceCID, NS_SOCKETPROVIDERSERVICE_CID);
|
static NS_DEFINE_CID(kSocketProviderServiceCID, NS_SOCKETPROVIDERSERVICE_CID);
|
||||||
|
|
||||||
#define UA_PREF_PREFIX "general.useragent."
|
#define UA_PREF_PREFIX "general.useragent."
|
||||||
#define UA_APPNAME "Mozilla"
|
|
||||||
#define UA_APPVERSION "5.0"
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#define UA_SPARE_PLATFORM
|
#define UA_SPARE_PLATFORM
|
||||||
#endif
|
#endif
|
||||||
@ -191,6 +190,8 @@ nsHttpHandler::nsHttpHandler()
|
|||||||
, mLastUniqueID(NowInSeconds())
|
, mLastUniqueID(NowInSeconds())
|
||||||
, mSessionStartTime(0)
|
, mSessionStartTime(0)
|
||||||
, mProduct("Gecko")
|
, mProduct("Gecko")
|
||||||
|
, mLegacyAppName("Mozilla")
|
||||||
|
, mLegacyAppVersion("5.0")
|
||||||
, mUserAgentIsDirty(PR_TRUE)
|
, mUserAgentIsDirty(PR_TRUE)
|
||||||
, mUseCache(PR_TRUE)
|
, mUseCache(PR_TRUE)
|
||||||
, mPromptTempRedirect(PR_TRUE)
|
, mPromptTempRedirect(PR_TRUE)
|
||||||
@ -275,21 +276,32 @@ nsHttpHandler::Init()
|
|||||||
|
|
||||||
mMisc.AssignLiteral("rv:" MOZILLA_VERSION);
|
mMisc.AssignLiteral("rv:" MOZILLA_VERSION);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIXULAppInfo> appInfo =
|
||||||
|
do_GetService("@mozilla.org/xre/app-info;1");
|
||||||
|
|
||||||
|
mAppName.AssignLiteral(MOZ_APP_UA_NAME);
|
||||||
|
if (mAppName.Length() == 0 && appInfo) {
|
||||||
|
appInfo->GetName(mAppName);
|
||||||
|
appInfo->GetVersion(mAppVersion);
|
||||||
|
} else {
|
||||||
|
mAppVersion.AssignLiteral(MOZ_APP_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
// dump user agent prefs
|
// dump user agent prefs
|
||||||
LOG(("> app-name = %s\n", mAppName.get()));
|
LOG(("> legacy-app-name = %s\n", mLegacyAppName.get()));
|
||||||
LOG(("> app-version = %s\n", mAppVersion.get()));
|
LOG(("> legacy-app-version = %s\n", mLegacyAppVersion.get()));
|
||||||
LOG(("> platform = %s\n", mPlatform.get()));
|
LOG(("> platform = %s\n", mPlatform.get()));
|
||||||
LOG(("> oscpu = %s\n", mOscpu.get()));
|
LOG(("> oscpu = %s\n", mOscpu.get()));
|
||||||
LOG(("> language = %s\n", mLanguage.get()));
|
LOG(("> language = %s\n", mLanguage.get()));
|
||||||
LOG(("> misc = %s\n", mMisc.get()));
|
LOG(("> misc = %s\n", mMisc.get()));
|
||||||
LOG(("> vendor = %s\n", mVendor.get()));
|
LOG(("> vendor = %s\n", mVendor.get()));
|
||||||
LOG(("> vendor-sub = %s\n", mVendorSub.get()));
|
LOG(("> vendor-sub = %s\n", mVendorSub.get()));
|
||||||
LOG(("> vendor-comment = %s\n", mVendorComment.get()));
|
|
||||||
LOG(("> extra = %s\n", mExtraUA.get()));
|
|
||||||
LOG(("> product = %s\n", mProduct.get()));
|
LOG(("> product = %s\n", mProduct.get()));
|
||||||
LOG(("> product-sub = %s\n", mProductSub.get()));
|
LOG(("> product-sub = %s\n", mProductSub.get()));
|
||||||
LOG(("> product-comment = %s\n", mProductComment.get()));
|
LOG(("> app-name = %s\n", mAppName.get()));
|
||||||
|
LOG(("> app-version = %s\n", mAppVersion.get()));
|
||||||
|
LOG(("> compat-firefox = %s\n", mCompatFirefox.get()));
|
||||||
LOG(("> user-agent = %s\n", UserAgent().get()));
|
LOG(("> user-agent = %s\n", UserAgent().get()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -301,8 +313,6 @@ nsHttpHandler::Init()
|
|||||||
rv = InitConnectionMgr();
|
rv = InitConnectionMgr();
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
nsCOMPtr<nsIXULAppInfo> appInfo =
|
|
||||||
do_GetService("@mozilla.org/xre/app-info;1");
|
|
||||||
if (appInfo)
|
if (appInfo)
|
||||||
appInfo->GetPlatformBuildID(mProductSub);
|
appInfo->GetPlatformBuildID(mProductSub);
|
||||||
if (mProductSub.Length() > 8)
|
if (mProductSub.Length() > 8)
|
||||||
@ -602,16 +612,16 @@ nsHttpHandler::BuildUserAgent()
|
|||||||
{
|
{
|
||||||
LOG(("nsHttpHandler::BuildUserAgent\n"));
|
LOG(("nsHttpHandler::BuildUserAgent\n"));
|
||||||
|
|
||||||
NS_ASSERTION(!mAppName.IsEmpty() &&
|
NS_ASSERTION(!mLegacyAppName.IsEmpty() &&
|
||||||
!mAppVersion.IsEmpty() &&
|
!mLegacyAppVersion.IsEmpty() &&
|
||||||
!mPlatform.IsEmpty() &&
|
!mPlatform.IsEmpty() &&
|
||||||
!mOscpu.IsEmpty(),
|
!mOscpu.IsEmpty(),
|
||||||
"HTTP cannot send practical requests without this much");
|
"HTTP cannot send practical requests without this much");
|
||||||
|
|
||||||
// preallocate to worst-case size, which should always be better
|
// preallocate to worst-case size, which should always be better
|
||||||
// than if we didn't preallocate at all.
|
// than if we didn't preallocate at all.
|
||||||
mUserAgent.SetCapacity(mAppName.Length() +
|
mUserAgent.SetCapacity(mLegacyAppName.Length() +
|
||||||
mAppVersion.Length() +
|
mLegacyAppVersion.Length() +
|
||||||
#ifndef UA_SPARE_PLATFORM
|
#ifndef UA_SPARE_PLATFORM
|
||||||
mPlatform.Length() +
|
mPlatform.Length() +
|
||||||
#endif
|
#endif
|
||||||
@ -619,17 +629,17 @@ nsHttpHandler::BuildUserAgent()
|
|||||||
mMisc.Length() +
|
mMisc.Length() +
|
||||||
mProduct.Length() +
|
mProduct.Length() +
|
||||||
mProductSub.Length() +
|
mProductSub.Length() +
|
||||||
mProductComment.Length() +
|
|
||||||
mVendor.Length() +
|
mVendor.Length() +
|
||||||
mVendorSub.Length() +
|
mVendorSub.Length() +
|
||||||
mVendorComment.Length() +
|
mAppName.Length() +
|
||||||
mExtraUA.Length() +
|
mAppVersion.Length() +
|
||||||
22);
|
mCompatFirefox.Length() +
|
||||||
|
15);
|
||||||
|
|
||||||
// Application portion
|
// Application portion
|
||||||
mUserAgent.Assign(mAppName);
|
mUserAgent.Assign(mLegacyAppName);
|
||||||
mUserAgent += '/';
|
mUserAgent += '/';
|
||||||
mUserAgent += mAppVersion;
|
mUserAgent += mLegacyAppVersion;
|
||||||
mUserAgent += ' ';
|
mUserAgent += ' ';
|
||||||
|
|
||||||
// Application comment
|
// Application comment
|
||||||
@ -639,26 +649,15 @@ nsHttpHandler::BuildUserAgent()
|
|||||||
mUserAgent.AppendLiteral("; ");
|
mUserAgent.AppendLiteral("; ");
|
||||||
#endif
|
#endif
|
||||||
mUserAgent += mOscpu;
|
mUserAgent += mOscpu;
|
||||||
if (!mMisc.IsEmpty()) {
|
mUserAgent.AppendLiteral("; ");
|
||||||
mUserAgent.AppendLiteral("; ");
|
mUserAgent += mMisc;
|
||||||
mUserAgent += mMisc;
|
|
||||||
}
|
|
||||||
mUserAgent += ')';
|
mUserAgent += ')';
|
||||||
|
|
||||||
// Product portion
|
// Product portion
|
||||||
if (!mProduct.IsEmpty()) {
|
mUserAgent += ' ';
|
||||||
mUserAgent += ' ';
|
mUserAgent += mProduct;
|
||||||
mUserAgent += mProduct;
|
mUserAgent += '/';
|
||||||
if (!mProductSub.IsEmpty()) {
|
mUserAgent += mProductSub;
|
||||||
mUserAgent += '/';
|
|
||||||
mUserAgent += mProductSub;
|
|
||||||
}
|
|
||||||
if (!mProductComment.IsEmpty()) {
|
|
||||||
mUserAgent.AppendLiteral(" (");
|
|
||||||
mUserAgent += mProductComment;
|
|
||||||
mUserAgent += ')';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vendor portion
|
// Vendor portion
|
||||||
if (!mVendor.IsEmpty()) {
|
if (!mVendor.IsEmpty()) {
|
||||||
@ -668,15 +667,17 @@ nsHttpHandler::BuildUserAgent()
|
|||||||
mUserAgent += '/';
|
mUserAgent += '/';
|
||||||
mUserAgent += mVendorSub;
|
mUserAgent += mVendorSub;
|
||||||
}
|
}
|
||||||
if (!mVendorComment.IsEmpty()) {
|
|
||||||
mUserAgent.AppendLiteral(" (");
|
|
||||||
mUserAgent += mVendorComment;
|
|
||||||
mUserAgent += ')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mExtraUA.IsEmpty())
|
mUserAgent += ' ';
|
||||||
mUserAgent += mExtraUA;
|
mUserAgent += mAppName;
|
||||||
|
mUserAgent += '/';
|
||||||
|
mUserAgent += mAppVersion;
|
||||||
|
|
||||||
|
if (!mCompatFirefox.IsEmpty()) {
|
||||||
|
mUserAgent += ' ';
|
||||||
|
mUserAgent += mCompatFirefox;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
@ -827,22 +828,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||||||
// UA components
|
// UA components
|
||||||
//
|
//
|
||||||
|
|
||||||
// Gather application values.
|
|
||||||
if (PREF_CHANGED(UA_PREF("appName"))) {
|
|
||||||
prefs->GetCharPref(UA_PREF("appName"),
|
|
||||||
getter_Copies(mAppName));
|
|
||||||
if (mAppName.IsEmpty())
|
|
||||||
mAppName.AssignLiteral(UA_APPNAME);
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
}
|
|
||||||
if (PREF_CHANGED(UA_PREF("appVersion"))) {
|
|
||||||
prefs->GetCharPref(UA_PREF("appVersion"),
|
|
||||||
getter_Copies(mAppVersion));
|
|
||||||
if (mAppVersion.IsEmpty())
|
|
||||||
mAppVersion.AssignLiteral(UA_APPVERSION);
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gather vendor values.
|
// Gather vendor values.
|
||||||
if (PREF_CHANGED(UA_PREF("vendor"))) {
|
if (PREF_CHANGED(UA_PREF("vendor"))) {
|
||||||
prefs->GetCharPref(UA_PREF("vendor"),
|
prefs->GetCharPref(UA_PREF("vendor"),
|
||||||
@ -854,46 +839,16 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||||||
getter_Copies(mVendorSub));
|
getter_Copies(mVendorSub));
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
mUserAgentIsDirty = PR_TRUE;
|
||||||
}
|
}
|
||||||
if (PREF_CHANGED(UA_PREF("vendorComment"))) {
|
|
||||||
prefs->GetCharPref(UA_PREF("vendorComment"),
|
|
||||||
getter_Copies(mVendorComment));
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MULTI_PREF_CHANGED(UA_PREF("extra."))) {
|
PRBool cVar = PR_FALSE;
|
||||||
mExtraUA.Truncate();
|
|
||||||
|
|
||||||
// Unfortunately, we can't do this using the pref branch.
|
if (PREF_CHANGED(UA_PREF("compatMode.firefox"))) {
|
||||||
nsCOMPtr<nsIPrefService> service =
|
rv = prefs->GetBoolPref(UA_PREF("compatMode.firefox"), &cVar);
|
||||||
do_GetService(NS_PREFSERVICE_CONTRACTID);
|
if (NS_SUCCEEDED(rv) && cVar) {
|
||||||
nsCOMPtr<nsIPrefBranch> branch;
|
mCompatFirefox.AssignLiteral("Firefox/" FIREFOX_VERSION);
|
||||||
service->GetBranch(UA_PREF("extra."), getter_AddRefs(branch));
|
} else {
|
||||||
if (branch) {
|
mCompatFirefox.Truncate();
|
||||||
PRUint32 extraCount;
|
|
||||||
char **extraItems;
|
|
||||||
rv = branch->GetChildList("", &extraCount, &extraItems);
|
|
||||||
if (NS_SUCCEEDED(rv) && extraItems) {
|
|
||||||
NS_QuickSort(extraItems, extraCount, sizeof(extraItems[0]),
|
|
||||||
StringCompare, nsnull);
|
|
||||||
for (char **item = extraItems,
|
|
||||||
**item_end = extraItems + extraCount;
|
|
||||||
item < item_end; ++item) {
|
|
||||||
nsXPIDLCString valStr;
|
|
||||||
branch->GetCharPref(*item, getter_Copies(valStr));
|
|
||||||
if (!valStr.IsEmpty())
|
|
||||||
mExtraUA += NS_LITERAL_CSTRING(" ") + valStr;
|
|
||||||
}
|
|
||||||
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(extraCount, extraItems);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gather product values.
|
|
||||||
if (PREF_CHANGED(UA_PREF("productComment"))) {
|
|
||||||
prefs->GetCharPref(UA_PREF("productComment"),
|
|
||||||
getter_Copies(mProductComment));
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
mUserAgentIsDirty = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1032,8 +987,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool cVar = PR_FALSE;
|
|
||||||
|
|
||||||
if (PREF_CHANGED(HTTP_PREF("keep-alive"))) {
|
if (PREF_CHANGED(HTTP_PREF("keep-alive"))) {
|
||||||
rv = prefs->GetBoolPref(HTTP_PREF("keep-alive"), &cVar);
|
rv = prefs->GetBoolPref(HTTP_PREF("keep-alive"), &cVar);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
@ -1607,14 +1560,14 @@ nsHttpHandler::GetUserAgent(nsACString &value)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpHandler::GetAppName(nsACString &value)
|
nsHttpHandler::GetAppName(nsACString &value)
|
||||||
{
|
{
|
||||||
value = mAppName;
|
value = mLegacyAppName;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpHandler::GetAppVersion(nsACString &value)
|
nsHttpHandler::GetAppVersion(nsACString &value)
|
||||||
{
|
{
|
||||||
value = mAppVersion;
|
value = mLegacyAppVersion;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1624,13 +1577,6 @@ nsHttpHandler::GetVendor(nsACString &value)
|
|||||||
value = mVendor;
|
value = mVendor;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetVendor(const nsACString &value)
|
|
||||||
{
|
|
||||||
mVendor = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpHandler::GetVendorSub(nsACString &value)
|
nsHttpHandler::GetVendorSub(nsACString &value)
|
||||||
@ -1638,27 +1584,6 @@ nsHttpHandler::GetVendorSub(nsACString &value)
|
|||||||
value = mVendorSub;
|
value = mVendorSub;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetVendorSub(const nsACString &value)
|
|
||||||
{
|
|
||||||
mVendorSub = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::GetVendorComment(nsACString &value)
|
|
||||||
{
|
|
||||||
value = mVendorComment;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetVendorComment(const nsACString &value)
|
|
||||||
{
|
|
||||||
mVendorComment = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpHandler::GetProduct(nsACString &value)
|
nsHttpHandler::GetProduct(nsACString &value)
|
||||||
@ -1666,13 +1591,6 @@ nsHttpHandler::GetProduct(nsACString &value)
|
|||||||
value = mProduct;
|
value = mProduct;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetProduct(const nsACString &value)
|
|
||||||
{
|
|
||||||
mProduct = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpHandler::GetProductSub(nsACString &value)
|
nsHttpHandler::GetProductSub(nsACString &value)
|
||||||
@ -1680,27 +1598,6 @@ nsHttpHandler::GetProductSub(nsACString &value)
|
|||||||
value = mProductSub;
|
value = mProductSub;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetProductSub(const nsACString &value)
|
|
||||||
{
|
|
||||||
mProductSub = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::GetProductComment(nsACString &value)
|
|
||||||
{
|
|
||||||
value = mProductComment;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetProductComment(const nsACString &value)
|
|
||||||
{
|
|
||||||
mProductComment = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpHandler::GetPlatform(nsACString &value)
|
nsHttpHandler::GetPlatform(nsACString &value)
|
||||||
@ -1729,13 +1626,6 @@ nsHttpHandler::GetMisc(nsACString &value)
|
|||||||
value = mMisc;
|
value = mMisc;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHttpHandler::SetMisc(const nsACString &value)
|
|
||||||
{
|
|
||||||
mMisc = value;
|
|
||||||
mUserAgentIsDirty = PR_TRUE;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// nsHttpHandler::nsIObserver
|
// nsHttpHandler::nsIObserver
|
||||||
|
@ -303,19 +303,19 @@ private:
|
|||||||
PRUint32 mSessionStartTime;
|
PRUint32 mSessionStartTime;
|
||||||
|
|
||||||
// useragent components
|
// useragent components
|
||||||
nsXPIDLCString mAppName;
|
nsCString mLegacyAppName;
|
||||||
nsXPIDLCString mAppVersion;
|
nsCString mLegacyAppVersion;
|
||||||
nsCString mPlatform;
|
nsCString mPlatform;
|
||||||
nsCString mOscpu;
|
nsCString mOscpu;
|
||||||
nsCString mLanguage;
|
nsCString mLanguage;
|
||||||
nsCString mMisc;
|
nsCString mMisc;
|
||||||
nsXPIDLCString mVendor;
|
nsXPIDLCString mVendor;
|
||||||
nsXPIDLCString mVendorSub;
|
nsXPIDLCString mVendorSub;
|
||||||
nsXPIDLCString mVendorComment;
|
|
||||||
nsCString mProduct;
|
nsCString mProduct;
|
||||||
nsXPIDLCString mProductSub;
|
nsXPIDLCString mProductSub;
|
||||||
nsXPIDLCString mProductComment;
|
nsXPIDLCString mAppName;
|
||||||
nsCString mExtraUA;
|
nsXPIDLCString mAppVersion;
|
||||||
|
nsCString mCompatFirefox;
|
||||||
|
|
||||||
nsCString mUserAgent;
|
nsCString mUserAgent;
|
||||||
nsXPIDLCString mUserAgentOverride;
|
nsXPIDLCString mUserAgentOverride;
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#include "nsIProxiedProtocolHandler.idl"
|
#include "nsIProxiedProtocolHandler.idl"
|
||||||
|
|
||||||
[scriptable, uuid(cf549f80-9423-11df-981c-0800200c9a66)]
|
[scriptable, uuid(36709064-d2c8-40cb-b754-d30d970be639)]
|
||||||
interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
|
interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -64,32 +64,22 @@ interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
|
|||||||
/**
|
/**
|
||||||
* @return The vendor name.
|
* @return The vendor name.
|
||||||
*/
|
*/
|
||||||
attribute ACString vendor;
|
readonly attribute ACString vendor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The vendor sub string.
|
* @return The vendor sub string.
|
||||||
*/
|
*/
|
||||||
attribute ACString vendorSub;
|
readonly attribute ACString vendorSub;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The vendor comment.
|
|
||||||
*/
|
|
||||||
attribute ACString vendorComment;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The product name.
|
* @return The product name.
|
||||||
*/
|
*/
|
||||||
attribute ACString product;
|
readonly attribute ACString product;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A product sub string.
|
* @return A product sub string.
|
||||||
*/
|
*/
|
||||||
attribute ACString productSub;
|
readonly attribute ACString productSub;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return A product comment.
|
|
||||||
*/
|
|
||||||
attribute ACString productComment;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current platform.
|
* Get the current platform.
|
||||||
@ -114,9 +104,9 @@ interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
|
|||||||
readonly attribute ACString language;
|
readonly attribute ACString language;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get/Set the application comment misc portion.
|
* Get the application comment misc portion.
|
||||||
*/
|
*/
|
||||||
attribute ACString misc;
|
readonly attribute ACString misc;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user