mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 1359833 - Part 8. ScriptedNotificationObserver should use nsAutoScriptBlocker when issuing notifications. r=tnikkel
This commit is contained in:
parent
8a1d7d4bf1
commit
3f2ef119ba
@ -7,6 +7,7 @@
|
||||
#include "ScriptedNotificationObserver.h"
|
||||
#include "imgIScriptedNotificationObserver.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsContentUtils.h" // for nsAutoScriptBlocker
|
||||
|
||||
namespace mozilla {
|
||||
namespace image {
|
||||
@ -31,6 +32,13 @@ ScriptedNotificationObserver::Notify(imgIRequest* aRequest,
|
||||
int32_t aType,
|
||||
const nsIntRect* /*aUnused*/)
|
||||
{
|
||||
// For now, we block (other) scripts from running to preserve the historical
|
||||
// behavior from when ScriptedNotificationObserver::Notify was called as part
|
||||
// of the observers list in nsImageLoadingContent::Notify. Now each
|
||||
// ScriptedNotificationObserver has its own imgRequestProxy and thus gets
|
||||
// Notify called directly by imagelib.
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
if (aType == imgINotificationObserver::SIZE_AVAILABLE) {
|
||||
return mInner->SizeAvailable(aRequest);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user