mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 1849704. Don't create a new ImageBitmapShutdownObserver if we are in XPCOMShutdown or later. r=gfx-reviewers,aosmond
XPCOMShutdownThreads is the phase just after XPCOMShutdown and XPCOMShutdown is when we destory the ImageBitmapShutdownObserver, so we need to not create a new ImageBitmapShutdownObserver if we are in XPCOMShutdown or later. Differential Revision: https://phabricator.services.mozilla.com/D186852
This commit is contained in:
parent
9854503d07
commit
29dee56fcb
@ -647,7 +647,7 @@ ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
|
||||
|
||||
StaticMutexAutoLock lock(sShutdownMutex);
|
||||
if (!sShutdownObserver &&
|
||||
!AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownThreads)) {
|
||||
!AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdown)) {
|
||||
sShutdownObserver = new ImageBitmapShutdownObserver();
|
||||
}
|
||||
if (sShutdownObserver) {
|
||||
|
36
dom/canvas/crashtests/1849704-1.html
Normal file
36
dom/canvas/crashtests/1849704-1.html
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>TransferToImageBitmap</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="description"></div>
|
||||
<div id="console"></div>
|
||||
<script id='myWorker' type='text/worker'>
|
||||
self.onmessage = function(e) {
|
||||
var canvas = new OffscreenCanvas(128, 128);
|
||||
var gl = canvas.getContext("webgl2");
|
||||
gl.clearColor(1.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
var image = canvas.transferToImageBitmap();
|
||||
|
||||
self.postMessage({ bitmap: image },
|
||||
[ image ]);
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
var blob = new Blob([document.getElementById('myWorker').textContent]);
|
||||
var worker = new Worker(URL.createObjectURL(blob));
|
||||
worker.onmessage = function (msg) {
|
||||
try { worker.postMessage('Start worker'); } catch (e) { }
|
||||
};
|
||||
|
||||
try { worker.postMessage('Start worker'); } catch (e) { }
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -65,3 +65,4 @@ load 1757755.html
|
||||
pref(gfx.offscreencanvas.enabled,true) load 1769878.html
|
||||
pref(gfx.offscreencanvas.enabled,true) load 1771007-1.html
|
||||
pref(dom.webgpu.enabled,true) load 1816140.html
|
||||
load 1849704-1.html
|
||||
|
Loading…
Reference in New Issue
Block a user