Backed out 2 changesets (bug 1899874) It is crashing the browser on windows and linux, Bug 1906687. CLOSED TREE

Backed out changeset cd0e7d18bbff (bug 1899874)
Backed out changeset 347c3fe4a18f (bug 1899874)
This commit is contained in:
Cristian Tuns
2024-07-09 17:48:05 -04:00
parent 94878f8c4f
commit eaf1eefde7
22 changed files with 37 additions and 127 deletions

View File

@@ -425,7 +425,6 @@ nsIXPConnect* nsContentUtils::sXPConnect;
nsIScriptSecurityManager* nsContentUtils::sSecurityManager; nsIScriptSecurityManager* nsContentUtils::sSecurityManager;
nsIPrincipal* nsContentUtils::sSystemPrincipal; nsIPrincipal* nsContentUtils::sSystemPrincipal;
nsIPrincipal* nsContentUtils::sNullSubjectPrincipal; nsIPrincipal* nsContentUtils::sNullSubjectPrincipal;
nsIPrincipal* nsContentUtils::sFingerprintingProtectionPrincipal;
nsIConsoleService* nsContentUtils::sConsoleService; nsIConsoleService* nsContentUtils::sConsoleService;
static nsTHashMap<RefPtr<nsAtom>, EventNameMapping>* sAtomEventTable; static nsTHashMap<RefPtr<nsAtom>, EventNameMapping>* sAtomEventTable;
@@ -819,15 +818,6 @@ nsresult nsContentUtils::Init() {
nullPrincipal.forget(&sNullSubjectPrincipal); nullPrincipal.forget(&sNullSubjectPrincipal);
RefPtr<nsIPrincipal> fingerprintingProtectionPrincipal =
BasePrincipal::CreateContentPrincipal(
"about:fingerprintingprotection"_ns);
if (!fingerprintingProtectionPrincipal) {
return NS_ERROR_FAILURE;
}
fingerprintingProtectionPrincipal.forget(&sFingerprintingProtectionPrincipal);
if (!InitializeEventTable()) return NS_ERROR_FAILURE; if (!InitializeEventTable()) return NS_ERROR_FAILURE;
if (!sEventListenerManagersHash) { if (!sEventListenerManagersHash) {
@@ -1982,7 +1972,6 @@ void nsContentUtils::Shutdown() {
NS_IF_RELEASE(sSecurityManager); NS_IF_RELEASE(sSecurityManager);
NS_IF_RELEASE(sSystemPrincipal); NS_IF_RELEASE(sSystemPrincipal);
NS_IF_RELEASE(sNullSubjectPrincipal); NS_IF_RELEASE(sNullSubjectPrincipal);
NS_IF_RELEASE(sFingerprintingProtectionPrincipal);
sBidiKeyboard = nullptr; sBidiKeyboard = nullptr;

View File

@@ -2164,13 +2164,6 @@ class nsContentUtils {
return sNullSubjectPrincipal; return sNullSubjectPrincipal;
} }
/**
* Gets the about:fingerprintingprotection principal.
*/
static nsIPrincipal* GetFingerprintingProtectionPrincipal() {
return sFingerprintingProtectionPrincipal;
}
/** /**
* *aResourcePrincipal is a principal describing who may access the contents * *aResourcePrincipal is a principal describing who may access the contents
* of a resource. The resource can only be consumed by a principal that * of a resource. The resource can only be consumed by a principal that
@@ -3648,7 +3641,6 @@ class nsContentUtils {
static nsIScriptSecurityManager* sSecurityManager; static nsIScriptSecurityManager* sSecurityManager;
static nsIPrincipal* sSystemPrincipal; static nsIPrincipal* sSystemPrincipal;
static nsIPrincipal* sNullSubjectPrincipal; static nsIPrincipal* sNullSubjectPrincipal;
static nsIPrincipal* sFingerprintingProtectionPrincipal;
static nsIConsoleService* sConsoleService; static nsIConsoleService* sConsoleService;

View File

@@ -1121,7 +1121,6 @@ void CanvasRenderingContext2D::GetContextAttributes(
aSettings.mAlpha = mContextAttributesHasAlpha; aSettings.mAlpha = mContextAttributesHasAlpha;
aSettings.mWillReadFrequently = mWillReadFrequently; aSettings.mWillReadFrequently = mWillReadFrequently;
aSettings.mForceSoftwareRendering = mForceSoftwareRendering;
// We don't support the 'desynchronized' and 'colorSpace' attributes, so // We don't support the 'desynchronized' and 'colorSpace' attributes, so
// those just keep their default values. // those just keep their default values.
@@ -1472,7 +1471,7 @@ bool CanvasRenderingContext2D::BorrowTarget(const IntRect& aPersistedRect,
// acceleration, then we skip trying to use this provider so that it will be // acceleration, then we skip trying to use this provider so that it will be
// recreated by EnsureTarget later. // recreated by EnsureTarget later.
if (!mBufferProvider || mBufferProvider->RequiresRefresh() || if (!mBufferProvider || mBufferProvider->RequiresRefresh() ||
(mBufferProvider->IsAccelerated() && UseSoftwareRendering())) { (mBufferProvider->IsAccelerated() && GetEffectiveWillReadFrequently())) {
return false; return false;
} }
mTarget = mBufferProvider->BorrowDrawTarget(aPersistedRect); mTarget = mBufferProvider->BorrowDrawTarget(aPersistedRect);
@@ -1723,7 +1722,7 @@ bool CanvasRenderingContext2D::TryAcceleratedTarget(
} }
// Don't try creating an accelerate DrawTarget if either acceleration failed // Don't try creating an accelerate DrawTarget if either acceleration failed
// previously or if the application expects acceleration to be slow. // previously or if the application expects acceleration to be slow.
if (!mAllowAcceleration || UseSoftwareRendering()) { if (!mAllowAcceleration || GetEffectiveWillReadFrequently()) {
return false; return false;
} }
@@ -1780,7 +1779,7 @@ bool CanvasRenderingContext2D::TrySharedTarget(
aOutProvider = renderer->CreatePersistentBufferProvider( aOutProvider = renderer->CreatePersistentBufferProvider(
GetSize(), GetSurfaceFormat(), GetSize(), GetSurfaceFormat(),
!mAllowAcceleration || UseSoftwareRendering()); !mAllowAcceleration || GetEffectiveWillReadFrequently());
} else if (mOffscreenCanvas) { } else if (mOffscreenCanvas) {
if (!StaticPrefs::gfx_offscreencanvas_shared_provider()) { if (!StaticPrefs::gfx_offscreencanvas_shared_provider()) {
return false; return false;
@@ -1794,7 +1793,7 @@ bool CanvasRenderingContext2D::TrySharedTarget(
aOutProvider = PersistentBufferProviderShared::Create( aOutProvider = PersistentBufferProviderShared::Create(
GetSize(), GetSurfaceFormat(), imageBridge, GetSize(), GetSurfaceFormat(), imageBridge,
!mAllowAcceleration || UseSoftwareRendering(), !mAllowAcceleration || GetEffectiveWillReadFrequently(),
mOffscreenCanvas->GetWindowID()); mOffscreenCanvas->GetWindowID());
} }
@@ -1815,7 +1814,7 @@ bool CanvasRenderingContext2D::TryBasicTarget(
RefPtr<layers::PersistentBufferProvider>& aOutProvider, RefPtr<layers::PersistentBufferProvider>& aOutProvider,
ErrorResult& aError) { ErrorResult& aError) {
aOutDT = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget( aOutDT = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(
GetSize(), GetSurfaceFormat(), UseSoftwareRendering()); GetSize(), GetSurfaceFormat());
if (!aOutDT) { if (!aOutDT) {
aError.ThrowInvalidStateError("Canvas could not create basic draw target."); aError.ThrowInvalidStateError("Canvas could not create basic draw target.");
return false; return false;
@@ -2028,7 +2027,6 @@ CanvasRenderingContext2D::SetContextOptions(JSContext* aCx,
} }
mWillReadFrequently = attributes.mWillReadFrequently; mWillReadFrequently = attributes.mWillReadFrequently;
mForceSoftwareRendering = attributes.mForceSoftwareRendering;
mContextAttributesHasAlpha = attributes.mAlpha; mContextAttributesHasAlpha = attributes.mAlpha;
UpdateIsOpaque(); UpdateIsOpaque();
@@ -6671,10 +6669,9 @@ void CanvasRenderingContext2D::SetWriteOnly() {
} }
} }
bool CanvasRenderingContext2D::UseSoftwareRendering() const { bool CanvasRenderingContext2D::GetEffectiveWillReadFrequently() const {
return (StaticPrefs::gfx_canvas_willreadfrequently_enabled_AtStartup() && return StaticPrefs::gfx_canvas_willreadfrequently_enabled_AtStartup() &&
mWillReadFrequently) || mWillReadFrequently;
mForceSoftwareRendering;
} }
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPath, mParent) NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPath, mParent)

View File

@@ -811,7 +811,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
return CurrentState().font; return CurrentState().font;
} }
bool UseSoftwareRendering() const; bool GetEffectiveWillReadFrequently() const;
// Member vars // Member vars
int32_t mWidth, mHeight; int32_t mWidth, mHeight;
@@ -857,8 +857,6 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
// Whether the application expects to use operations that perform poorly with // Whether the application expects to use operations that perform poorly with
// acceleration. // acceleration.
bool mWillReadFrequently = false; bool mWillReadFrequently = false;
// Whether to force software rendering
bool mForceSoftwareRendering = false;
// Whether or not we have already shutdown. // Whether or not we have already shutdown.
bool mHasShutdown = false; bool mHasShutdown = false;
// Whether or not remote canvas is currently unavailable. // Whether or not remote canvas is currently unavailable.

View File

@@ -769,7 +769,6 @@ void ClientWebGLContext::GetContextAttributes(
result.mPreserveDrawingBuffer = options.preserveDrawingBuffer; result.mPreserveDrawingBuffer = options.preserveDrawingBuffer;
result.mFailIfMajorPerformanceCaveat = options.failIfMajorPerformanceCaveat; result.mFailIfMajorPerformanceCaveat = options.failIfMajorPerformanceCaveat;
result.mPowerPreference = options.powerPreference; result.mPowerPreference = options.powerPreference;
result.mForceSoftwareRendering = options.forceSoftwareRendering;
} }
// ----------------------- // -----------------------
@@ -1062,7 +1061,6 @@ ClientWebGLContext::SetContextOptions(JSContext* cx,
attributes.mFailIfMajorPerformanceCaveat; attributes.mFailIfMajorPerformanceCaveat;
newOpts.xrCompatible = attributes.mXrCompatible; newOpts.xrCompatible = attributes.mXrCompatible;
newOpts.powerPreference = attributes.mPowerPreference; newOpts.powerPreference = attributes.mPowerPreference;
newOpts.forceSoftwareRendering = attributes.mForceSoftwareRendering;
newOpts.enableDebugRendererInfo = newOpts.enableDebugRendererInfo =
StaticPrefs::webgl_enable_debug_renderer_info(); StaticPrefs::webgl_enable_debug_renderer_info();
MOZ_ASSERT(mCanvasElement || mOffscreenCanvas); MOZ_ASSERT(mCanvasElement || mOffscreenCanvas);

View File

@@ -287,11 +287,6 @@ bool WebGLContext::CreateAndInitGL(
flags |= gl::CreateContextFlags::FORBID_SOFTWARE; flags |= gl::CreateContextFlags::FORBID_SOFTWARE;
} }
if (mOptions.forceSoftwareRendering) {
flags |= gl::CreateContextFlags::FORBID_HARDWARE;
flags &= ~gl::CreateContextFlags::FORBID_SOFTWARE;
}
if (forceEnabled) { if (forceEnabled) {
flags &= ~gl::CreateContextFlags::FORBID_HARDWARE; flags &= ~gl::CreateContextFlags::FORBID_HARDWARE;
flags &= ~gl::CreateContextFlags::FORBID_SOFTWARE; flags &= ~gl::CreateContextFlags::FORBID_SOFTWARE;

View File

@@ -363,11 +363,9 @@ struct WebGLContextOptions final {
dom::WebGLPowerPreference powerPreference = dom::WebGLPowerPreference powerPreference =
dom::WebGLPowerPreference::Default; dom::WebGLPowerPreference::Default;
std::optional<dom::PredefinedColorSpace> colorSpace; std::optional<dom::PredefinedColorSpace> colorSpace;
bool forceSoftwareRendering = false;
bool shouldResistFingerprinting = true; bool shouldResistFingerprinting = true;
bool enableDebugRendererInfo = false; bool enableDebugRendererInfo = false;
PaddingField<uint8_t, 7> _padding;
auto MutTiedFields() { auto MutTiedFields() {
// clang-format off // clang-format off
@@ -384,12 +382,9 @@ struct WebGLContextOptions final {
powerPreference, powerPreference,
colorSpace, colorSpace,
forceSoftwareRendering,
shouldResistFingerprinting, shouldResistFingerprinting,
enableDebugRendererInfo, enableDebugRendererInfo);
_padding);
// clang-format on // clang-format on
} }

View File

@@ -34,9 +34,6 @@ dictionary CanvasRenderingContext2DSettings {
// whether or not we're planning to do a lot of readback operations // whether or not we're planning to do a lot of readback operations
boolean willReadFrequently = false; boolean willReadFrequently = false;
[Func="nsRFPService::IsSoftwareRenderingOptionExposed"]
boolean forceSoftwareRendering = false;
}; };
dictionary HitRegionOptions { dictionary HitRegionOptions {

View File

@@ -56,9 +56,6 @@ dictionary WebGLContextAttributes {
// We are experimenting here, though this should be close to where we end up. // We are experimenting here, though this should be close to where we end up.
[Pref="webgl.colorspaces.prototype"] [Pref="webgl.colorspaces.prototype"]
PredefinedColorSpace colorSpace; // = "srgb"; Default is gfx::ColorSpace2::UNKNOWN for now. PredefinedColorSpace colorSpace; // = "srgb"; Default is gfx::ColorSpace2::UNKNOWN for now.
[Func="nsRFPService::IsSoftwareRenderingOptionExposed"]
GLboolean forceSoftwareRendering = false;
}; };
[Exposed=(Window,Worker), [Exposed=(Window,Worker),

View File

@@ -228,7 +228,7 @@ already_AddRefed<GLContext> GLContextEGLFactory::CreateImpl(
gfxCriticalNote << "Failed[3] to load EGL library: " << failureId.get(); gfxCriticalNote << "Failed[3] to load EGL library: " << failureId.get();
return nullptr; return nullptr;
} }
const auto egl = lib->CreateDisplay(true, false, &failureId); const auto egl = lib->CreateDisplay(true, &failureId);
if (!egl) { if (!egl) {
gfxCriticalNote << "Failed[3] to create EGL library display: " gfxCriticalNote << "Failed[3] to create EGL library display: "
<< failureId.get(); << failureId.get();

View File

@@ -887,11 +887,6 @@ static already_AddRefed<GLContextGLX> CreateOffscreenPixmapContext(
auto fullDesc = GLContextDesc{desc}; auto fullDesc = GLContextDesc{desc};
fullDesc.isOffscreen = true; fullDesc.isOffscreen = true;
if (fullDesc.flags & CreateContextFlags::FORBID_HARDWARE) {
fullDesc.flags |= CreateContextFlags::REQUIRE_COMPAT_PROFILE;
}
return GLContextGLX::CreateGLContext(fullDesc, display, pixmap, config, return GLContextGLX::CreateGLContext(fullDesc, display, pixmap, config,
drawable); drawable);
} }

View File

@@ -472,9 +472,7 @@ already_AddRefed<GLContext> GLContextProviderWGL::CreateHeadless(
int chosenFormat; int chosenFormat;
UINT foundFormats = 0; UINT foundFormats = 0;
bool forbidHardware = if (!foundFormats) {
static_cast<bool>(desc.flags & CreateContextFlags::FORBID_HARDWARE);
if (!foundFormats && forbidHardware) {
const int kAttribs[] = {LOCAL_WGL_DRAW_TO_PBUFFER_ARB, const int kAttribs[] = {LOCAL_WGL_DRAW_TO_PBUFFER_ARB,
true, true,
LOCAL_WGL_SUPPORT_OPENGL_ARB, LOCAL_WGL_SUPPORT_OPENGL_ARB,

View File

@@ -868,27 +868,26 @@ std::shared_ptr<EglDisplay> GLLibraryEGL::DefaultDisplay(
auto ret = mDefaultDisplay.lock(); auto ret = mDefaultDisplay.lock();
if (ret) return ret; if (ret) return ret;
ret = CreateDisplayLocked(false, false, out_failureId, lock); ret = CreateDisplayLocked(false, out_failureId, lock);
mDefaultDisplay = ret; mDefaultDisplay = ret;
return ret; return ret;
} }
std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplay( std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplay(
const bool forceAccel, const bool forceSoftware, const bool forceAccel, nsACString* const out_failureId) {
nsACString* const out_failureId) {
StaticMutexAutoLock lock(sMutex); StaticMutexAutoLock lock(sMutex);
return CreateDisplayLocked(forceAccel, forceSoftware, out_failureId, lock); return CreateDisplayLocked(forceAccel, out_failureId, lock);
} }
std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplayLocked( std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplayLocked(
const bool forceAccel, const bool forceSoftware, const bool forceAccel, nsACString* const out_failureId,
nsACString* const out_failureId, const StaticMutexAutoLock& aProofOfLock) { const StaticMutexAutoLock& aProofOfLock) {
std::shared_ptr<EglDisplay> ret; std::shared_ptr<EglDisplay> ret;
if (IsExtensionSupported(EGLLibExtension::ANGLE_platform_angle_d3d)) { if (IsExtensionSupported(EGLLibExtension::ANGLE_platform_angle_d3d)) {
nsCString accelAngleFailureId; nsCString accelAngleFailureId;
bool accelAngleSupport = IsAccelAngleSupported(&accelAngleFailureId); bool accelAngleSupport = IsAccelAngleSupported(&accelAngleFailureId);
bool shouldTryAccel = (forceAccel || accelAngleSupport) && !forceSoftware; bool shouldTryAccel = forceAccel || accelAngleSupport;
bool shouldTryWARP = !forceAccel; // Only if ANGLE not supported or fails bool shouldTryWARP = !forceAccel; // Only if ANGLE not supported or fails
// If WARP preferred, will override ANGLE support // If WARP preferred, will override ANGLE support
@@ -933,7 +932,7 @@ std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplayLocked(
} else { } else {
void* nativeDisplay = EGL_DEFAULT_DISPLAY; void* nativeDisplay = EGL_DEFAULT_DISPLAY;
#ifdef MOZ_WIDGET_GTK #ifdef MOZ_WIDGET_GTK
if (!ret && (!gfx::gfxVars::WebglUseHardware() || forceSoftware)) { if (!ret && !gfx::gfxVars::WebglUseHardware()) {
// Initialize a swrast egl device such as llvmpipe // Initialize a swrast egl device such as llvmpipe
ret = GetAndInitSoftwareDisplay(*this, aProofOfLock); ret = GetAndInitSoftwareDisplay(*this, aProofOfLock);
} }

View File

@@ -152,13 +152,13 @@ class GLLibraryEGL final {
void InitLibExtensions(); void InitLibExtensions();
std::shared_ptr<EglDisplay> CreateDisplayLocked( std::shared_ptr<EglDisplay> CreateDisplayLocked(
bool forceAccel, bool forceSoftware, nsACString* const out_failureId, bool forceAccel, nsACString* const out_failureId,
const StaticMutexAutoLock& aProofOfLock); const StaticMutexAutoLock& aProofOfLock);
public: public:
Maybe<SymbolLoader> GetSymbolLoader() const; Maybe<SymbolLoader> GetSymbolLoader() const;
std::shared_ptr<EglDisplay> CreateDisplay(bool forceAccel, bool forceSoftware, std::shared_ptr<EglDisplay> CreateDisplay(bool forceAccel,
nsACString* const out_failureId); nsACString* const out_failureId);
std::shared_ptr<EglDisplay> CreateDisplay(ID3D11Device*); std::shared_ptr<EglDisplay> CreateDisplay(ID3D11Device*);
std::shared_ptr<EglDisplay> DefaultDisplay(nsACString* const out_failureId); std::shared_ptr<EglDisplay> DefaultDisplay(nsACString* const out_failureId);

View File

@@ -312,15 +312,13 @@ static TextureType ChooseTextureType(gfx::SurfaceFormat aFormat,
#endif #endif
#ifdef XP_MACOSX #ifdef XP_MACOSX
if (StaticPrefs::gfx_use_iosurface_textures_AtStartup() && if (StaticPrefs::gfx_use_iosurface_textures_AtStartup()) {
!aKnowsCompositor->UsingSoftwareWebRender()) {
return TextureType::MacIOSurface; return TextureType::MacIOSurface;
} }
#endif #endif
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
if (StaticPrefs::gfx_use_surfacetexture_textures_AtStartup() && if (StaticPrefs::gfx_use_surfacetexture_textures_AtStartup()) {
!aKnowsCompositor->UsingSoftwareWebRender()) {
return TextureType::AndroidNativeWindow; return TextureType::AndroidNativeWindow;
} }
#endif #endif
@@ -1494,7 +1492,6 @@ already_AddRefed<TextureClient> TextureClient::CreateForRawBufferAccess(
aMoz2DBackend == gfx::BackendType::DIRECT2D1_1, aMoz2DBackend == gfx::BackendType::DIRECT2D1_1,
"Unsupported TextureClient backend type"); "Unsupported TextureClient backend type");
// For future changes, check aAllocFlags aAllocFlags & ALLOC_DO_NOT_ACCELERATE
TextureData* texData = BufferTextureData::Create( TextureData* texData = BufferTextureData::Create(
aSize, aFormat, gfx::BackendType::SKIA, aLayersBackend, aTextureFlags, aSize, aFormat, gfx::BackendType::SKIA, aLayersBackend, aTextureFlags,
aAllocFlags, aAllocator); aAllocFlags, aAllocator);

View File

@@ -1678,36 +1678,20 @@ already_AddRefed<DrawTarget> gfxPlatform::CreateDrawTargetForBackend(
} }
already_AddRefed<DrawTarget> gfxPlatform::CreateOffscreenCanvasDrawTarget( already_AddRefed<DrawTarget> gfxPlatform::CreateOffscreenCanvasDrawTarget(
const IntSize& aSize, SurfaceFormat aFormat, bool aRequireSoftwareRender) { const IntSize& aSize, SurfaceFormat aFormat) {
NS_ASSERTION(mPreferredCanvasBackend != BackendType::NONE, "No backend."); NS_ASSERTION(mPreferredCanvasBackend != BackendType::NONE, "No backend.");
BackendType backend = mFallbackCanvasBackend;
// If we are using remote canvas we don't want to use acceleration in // If we are using remote canvas we don't want to use acceleration in
// canvas DrawTargets we are not remoting, so we always use the fallback // canvas DrawTargets we are not remoting, so we always use the fallback
// software one. // software one.
if (!gfxPlatform::UseRemoteCanvas() || if (!gfxPlatform::UseRemoteCanvas() ||
!gfxPlatform::IsBackendAccelerated(mPreferredCanvasBackend)) { !gfxPlatform::IsBackendAccelerated(mPreferredCanvasBackend)) {
backend = mPreferredCanvasBackend;
}
if (aRequireSoftwareRender) {
backend = gfxPlatform::IsBackendAccelerated(mPreferredCanvasBackend)
? mFallbackCanvasBackend
: mPreferredCanvasBackend;
}
#ifdef XP_WIN
// On Windows, the fallback backend (Cairo) should use its image backend.
RefPtr<DrawTarget> target = RefPtr<DrawTarget> target =
Factory::CreateDrawTarget(backend, aSize, aFormat); CreateDrawTargetForBackend(mPreferredCanvasBackend, aSize, aFormat);
#else
RefPtr<DrawTarget> target =
CreateDrawTargetForBackend(backend, aSize, aFormat);
#endif
if (target || mFallbackCanvasBackend == BackendType::NONE) { if (target || mFallbackCanvasBackend == BackendType::NONE) {
return target.forget(); return target.forget();
} }
}
#ifdef XP_WIN #ifdef XP_WIN
// On Windows, the fallback backend (Cairo) should use its image backend. // On Windows, the fallback backend (Cairo) should use its image backend.

View File

@@ -265,8 +265,7 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
bool aFallback = false); bool aFallback = false);
already_AddRefed<DrawTarget> CreateOffscreenCanvasDrawTarget( already_AddRefed<DrawTarget> CreateOffscreenCanvasDrawTarget(
const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat, const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
bool aRequireSoftwareRender = false);
already_AddRefed<DrawTarget> CreateSimilarSoftwareDrawTarget( already_AddRefed<DrawTarget> CreateSimilarSoftwareDrawTarget(
DrawTarget* aDT, const IntSize& aSize, DrawTarget* aDT, const IntSize& aSize,

View File

@@ -160,7 +160,7 @@ export class UserCharacteristicsPageService {
shutdown() {} shutdown() {}
createContentPage(principal) { createContentPage() {
lazy.console.debug("called createContentPage"); lazy.console.debug("called createContentPage");
lazy.console.debug("Registering actor"); lazy.console.debug("Registering actor");
@@ -184,6 +184,7 @@ export class UserCharacteristicsPageService {
let { promise, resolve } = Promise.withResolvers(); let { promise, resolve } = Promise.withResolvers();
this._backgroundBrowsers.set(browser, resolve); this._backgroundBrowsers.set(browser, resolve);
let principal = Services.scriptSecurityManager.getSystemPrincipal();
let loadURIOptions = { let loadURIOptions = {
triggeringPrincipal: principal, triggeringPrincipal: principal,
}; };

View File

@@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl" #include "nsISupports.idl"
#include "nsIPrincipal.idl"
webidl BrowsingContext; webidl BrowsingContext;
@@ -14,7 +13,7 @@ interface nsIUserCharacteristicsPageService : nsISupports {
* Create the UserCharacteristics about: page as a HiddenFrame * Create the UserCharacteristics about: page as a HiddenFrame
* and begin the data collection. * and begin the data collection.
*/ */
Promise createContentPage(in nsIPrincipal principal); Promise createContentPage();
/* /*
* Called when the UserCharacteristics about: page has been loaded * Called when the UserCharacteristics about: page has been loaded

View File

@@ -1888,22 +1888,6 @@ bool nsRFPService::CheckSuspiciousFingerprintingActivity(
return cnt > kSuspiciousFingerprintingActivityThreshold; return cnt > kSuspiciousFingerprintingActivityThreshold;
} }
/* static */
bool nsRFPService::IsSoftwareRenderingOptionExposed(JSContext* aCx,
JSObject* aObj) {
if (!NS_IsMainThread()) {
return false;
}
nsIPrincipal* principal = nsContentUtils::ObjectPrincipal(aObj);
if (nsContentUtils::SubjectPrincipal(aCx)->IsSystemPrincipal()) {
return true;
}
return principal->Equals(
nsContentUtils::GetFingerprintingProtectionPrincipal());
}
/* static */ /* static */
nsresult nsRFPService::CreateOverrideDomainKey( nsresult nsRFPService::CreateOverrideDomainKey(
nsIFingerprintingOverride* aOverride, nsACString& aDomainKey) { nsIFingerprintingOverride* aOverride, nsACString& aDomainKey) {

View File

@@ -221,8 +221,6 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
bool aIsPrivateMode, RFPTarget aTarget, bool aIsPrivateMode, RFPTarget aTarget,
const Maybe<RFPTarget>& aOverriddenFingerprintingSettings); const Maybe<RFPTarget>& aOverriddenFingerprintingSettings);
static bool IsSoftwareRenderingOptionExposed(JSContext*, JSObject*);
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
static double TimerResolution(RTPCallerType aRTPCallerType); static double TimerResolution(RTPCallerType aRTPCallerType);

View File

@@ -109,9 +109,7 @@ RefPtr<PopulatePromise> ContentPageStuff() {
RefPtr<PopulatePromise> populatePromise = new PopulatePromise(__func__); RefPtr<PopulatePromise> populatePromise = new PopulatePromise(__func__);
RefPtr<mozilla::dom::Promise> promise; RefPtr<mozilla::dom::Promise> promise;
nsresult rv = ucp->CreateContentPage( nsresult rv = ucp->CreateContentPage(getter_AddRefs(promise));
nsContentUtils::GetFingerprintingProtectionPrincipal(),
getter_AddRefs(promise));
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
MOZ_LOG(gUserCharacteristicsLog, mozilla::LogLevel::Error, MOZ_LOG(gUserCharacteristicsLog, mozilla::LogLevel::Error,
("Could not create Content Page")); ("Could not create Content Page"));