Bug 1724635 - fix Thunderbird build bustage from bug 1719070 - mozilla/browser/NimbusFeatures.h can't be found. r=cpeterson,necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D122055
This commit is contained in:
Magnus Melin 2021-08-09 20:21:13 +00:00
Родитель 8422e6d448
Коммит 8bb66bef55
3 изменённых файлов: 17 добавлений и 14 удалений

Просмотреть файл

@ -204,3 +204,6 @@ if CONFIG["OS_TARGET"] == "Darwin":
DEFINES["HAS_CONNECTX"] = True
include("/tools/fuzzing/libfuzzer-config.mozbuild")
if CONFIG["MOZ_BUILD_APP"] == "browser":
DEFINES["MOZ_BUILD_APP_IS_BROWSER"] = True

Просмотреть файл

@ -98,9 +98,9 @@
# include "nsCocoaFeatures.h"
#endif
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
# include "mozilla/browser/NimbusFeatures.h"
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
//-----------------------------------------------------------------------------
#include "mozilla/net/HttpChannelChild.h"
@ -128,10 +128,10 @@
#define NS_HTTP_PROTOCOL_FLAGS \
(URI_STD | ALLOWS_PROXY | ALLOWS_PROXY_HTTP | URI_LOADABLE_BY_ANYONE)
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
# define UA_EXPERIMENT_NAME "firefox100"_ns
# define UA_EXPERIMENT_VAR "firefoxVersion"_ns
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
//-----------------------------------------------------------------------------
@ -141,7 +141,7 @@ namespace mozilla::net {
LazyLogModule gHttpLog("nsHttp");
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
static void ExperimentUserAgentUpdated(const char* /* aNimbusPref */,
void* aUserData) {
MOZ_ASSERT(aUserData != nullptr);
@ -175,7 +175,7 @@ static void ExperimentUserAgentUpdated(const char* /* aNimbusPref */,
aExperimentUserAgent->Truncate();
aExperimentUserAgent->AppendPrintf(uaFormat, firefoxVersion, firefoxVersion);
}
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
#ifdef ANDROID
static nsCString GetDeviceModelId() {
@ -278,9 +278,9 @@ nsHttpHandler::nsHttpHandler()
mUserAgentOverride.SetIsVoid(true);
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
mExperimentUserAgent.SetIsVoid(true);
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
MOZ_ASSERT(!gHttpHandler, "HTTP handler already created!");
@ -388,11 +388,11 @@ nsresult nsHttpHandler::Init() {
gCallbackPrefs, this);
PrefsChanged(nullptr);
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
// monitor Firefox Version Experiment enrollment
NimbusFeatures::OnUpdate(UA_EXPERIMENT_NAME, UA_EXPERIMENT_VAR,
ExperimentUserAgentUpdated, &mExperimentUserAgent);
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
Telemetry::ScalarSet(Telemetry::ScalarID::NETWORKING_HTTP3_ENABLED,
mHttp3Enabled);
@ -755,13 +755,13 @@ const nsCString& nsHttpHandler::UserAgent() {
return mUserAgentOverride;
}
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
if (!mExperimentUserAgent.IsVoid()) {
LOG(("using Firefox 100 Experiment User-Agent : %s\n",
mExperimentUserAgent.get()));
return mExperimentUserAgent;
}
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
if (mUserAgentIsDirty) {
BuildUserAgent();

Просмотреть файл

@ -648,9 +648,9 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
nsCString mSpoofedUserAgent;
nsCString mUserAgentOverride;
#ifndef ANDROID
#if defined(MOZ_BUILD_APP_IS_BROWSER) && !defined(ANDROID)
nsCString mExperimentUserAgent;
#endif // ANDROID
#endif // MOZ_BUILD_APP_IS_BROWSER && !ANDROID
bool mUserAgentIsDirty{true}; // true if mUserAgent should be rebuilt
bool mAcceptLanguagesIsDirty{true};