Bug 1291364 - Make sure workers unmark things gray before passing them to JS_CallFunctionValue when running timeouts. r=terrence, a=ritu
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 02 Aug 2016 11:31:02 -0700
changeset 348113 f4b3eabf73713db73c49dbb32cf7ab1fa02b29b0
parent 348112 aa7999336fdab1455194e6c4a3aed03b3d4238f0
child 348114 fc1db61e30cdbc18be66eea66948255ec7eb721b
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence, ritu
bugs1291364
milestone50.0a2
Bug 1291364 - Make sure workers unmark things gray before passing them to JS_CallFunctionValue when running timeouts. r=terrence, a=ritu
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -6177,16 +6177,20 @@ WorkerPrivate::RunExpiredTimeouts(JSCont
     } else {
       reason = "setTimeout handler";
     }
 
     { // scope for the AutoEntryScript, so it comes off the stack before we do
       // Promise::PerformMicroTaskCheckpoint.
       AutoEntryScript aes(global, reason, false);
       if (!info->mTimeoutCallable.isUndefined()) {
+        JS::ExposeValueToActiveJS(info->mTimeoutCallable);
+        for (uint32_t i = 0; i < info->mExtraArgVals.Length(); ++i) {
+          JS::ExposeValueToActiveJS(info->mExtraArgVals[i]);
+        }
         JS::Rooted<JS::Value> rval(aCx);
         JS::HandleValueArray args =
           JS::HandleValueArray::fromMarkedLocation(info->mExtraArgVals.Length(),
                                                    info->mExtraArgVals.Elements()->address());
         JS::Rooted<JS::Value> callable(aCx, info->mTimeoutCallable);
         if (!JS_CallFunctionValue(aCx, global, callable, args, &rval) &&
             !JS_IsExceptionPending(aCx)) {
           retval = false;