Bug 1412192 - Use main-thread JSContext in SystemZoneResource::IsAvailable (r=froydnj)
authorBill McCloskey <billm@mozilla.com>
Fri, 22 Sep 2017 15:58:06 -0700
changeset 444707 af490228394eeebd48dcc2c326a9d2bbe369d59a
parent 444706 f367f91a3bde6553e3d93a479dca222a35a23904
child 444708 8d8519a2b6dce407afe3cacd86e30592bcf7fe1b
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1412192
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1412192 - Use main-thread JSContext in SystemZoneResource::IsAvailable (r=froydnj) MozReview-Commit-ID: BC9OoHVaMEI
xpcom/threads/Scheduler.cpp
--- a/xpcom/threads/Scheduler.cpp
+++ b/xpcom/threads/Scheduler.cpp
@@ -553,17 +553,19 @@ SchedulerImpl::QueueResource::IsAvailabl
   return queue->HasPendingEvent(aProofOfLock);
 }
 
 bool
 SchedulerImpl::SystemZoneResource::IsAvailable(const MutexAutoLock& aProofOfLock)
 {
   mScheduler->mLock.AssertCurrentThreadOwns();
 
-  JSContext* cx = dom::danger::GetJSContext();
+  // It doesn't matter which context we pick; we really just some main-thread
+  // JSContext.
+  JSContext* cx = mScheduler->mContexts[0];
   return js::SystemZoneAvailable(cx);
 }
 
 MOZ_THREAD_LOCAL(Scheduler::EventLoopActivation*) Scheduler::EventLoopActivation::sTopActivation;
 
 /* static */ void
 Scheduler::EventLoopActivation::Init()
 {