Bug 1342863 - (Part 3) DocGroup labeling for runnables dispatched by NS_DispatchTo(Main|Current)Thread in ZoomConstraintsClient. r?dholbert
MozReview-Commit-ID: GcExvSnUB8o
--- a/layout/base/ZoomConstraintsClient.cpp
+++ b/layout/base/ZoomConstraintsClient.cpp
@@ -153,18 +153,22 @@ ZoomConstraintsClient::Observe(nsISuppor
if (SameCOMIdentity(aSubject, mDocument) && BEFORE_FIRST_PAINT.EqualsASCII(aTopic)) {
ZCC_LOG("Got a before-first-paint event in %p\n", this);
RefreshZoomConstraints();
} else if (NS_PREF_CHANGED.EqualsASCII(aTopic)) {
ZCC_LOG("Got a pref-change event in %p\n", this);
// We need to run this later because all the pref change listeners need
// to execute before we can be guaranteed that gfxPrefs::ForceUserScalable()
// returns the updated value.
- NS_DispatchToMainThread(NewRunnableMethod(
- this, &ZoomConstraintsClient::RefreshZoomConstraints));
+
+ RefPtr<nsRunnableMethod<ZoomConstraintsClient>> event =
+ NewRunnableMethod(this, &ZoomConstraintsClient::RefreshZoomConstraints);
+ mDocument->Dispatch("ZoomConstraintsClient::RefreshZoomConstraints",
+ TaskCategory::Other,
+ event.forget());
}
return NS_OK;
}
void
ZoomConstraintsClient::ScreenSizeChanged()
{
ZCC_LOG("Got a screen-size change notification in %p\n", this);