Skip to content

Commit

Permalink
Bug 1328423 - Add AutoAssertNoContentJS to PresShell::Paint (r=dvander)
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 4M4pYZSygPH
  • Loading branch information
bill-mccloskey committed Jan 17, 2017
1 parent 50b0406 commit aa90d7d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
#include "LayerTreeInvalidation.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsCanvasFrame.h"
Expand Down Expand Up @@ -6239,6 +6240,13 @@ PresShell::Paint(nsView* aViewToPaint,
PROFILER_LABEL("PresShell", "Paint",
js::ProfileEntry::Category::GRAPHICS);

Maybe<js::AutoAssertNoContentJS> nojs;
if (!(aFlags & nsIPresShell::PAINT_COMPOSITE)) {
// We need to allow content JS when the flag is set since we may trigger
// MozAfterPaint events in content in those cases.
nojs.emplace(dom::danger::GetJSContext());
}

NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
NS_ASSERTION(aViewToPaint, "null view");

Expand Down

0 comments on commit aa90d7d

Please sign in to comment.