mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1335308 - Proxy mSpecifiedTransform releases that occur during the servo traversal to the main thread. r=heycam
This commit is contained in:
parent
02e0614b63
commit
8a7297e161
@ -3306,6 +3306,31 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
|
||||
MOZ_COUNT_CTOR(nsStyleDisplay);
|
||||
}
|
||||
|
||||
nsStyleDisplay::~nsStyleDisplay()
|
||||
{
|
||||
// We don't allow releasing nsCSSValues with refcounted data in the Servo
|
||||
// traversal, since the refcounts aren't threadsafe. Since Servo may trigger
|
||||
// the deallocation of style structs during styling, we need to handle it
|
||||
// here.
|
||||
if (mSpecifiedTransform && ServoStyleSet::IsInServoTraversal()) {
|
||||
// The default behavior of NS_ReleaseOnMainThread is to only proxy the
|
||||
// release if we're not already on the main thread. This is a nice
|
||||
// optimization for the cases we happen to be doing a sequential traversal
|
||||
// (i.e. a single-core machine), but it trips our assertions which check
|
||||
// whether we're in a Servo traversal, parallel or not. So we
|
||||
// unconditionally proxy in debug builds.
|
||||
bool alwaysProxy =
|
||||
#ifdef DEBUG
|
||||
true;
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
NS_ReleaseOnMainThread(mSpecifiedTransform.forget(), alwaysProxy);
|
||||
}
|
||||
|
||||
MOZ_COUNT_DTOR(nsStyleDisplay);
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
|
||||
{
|
||||
|
@ -2794,9 +2794,8 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
|
||||
{
|
||||
explicit nsStyleDisplay(const nsPresContext* aContext);
|
||||
nsStyleDisplay(const nsStyleDisplay& aOther);
|
||||
~nsStyleDisplay() {
|
||||
MOZ_COUNT_DTOR(nsStyleDisplay);
|
||||
}
|
||||
~nsStyleDisplay();
|
||||
|
||||
void FinishStyle(nsPresContext* aPresContext) {}
|
||||
|
||||
void* operator new(size_t sz, nsStyleDisplay* aSelf) { return aSelf; }
|
||||
|
Loading…
Reference in New Issue
Block a user