Bug 1384397 - Add API to request interrupt callback using CanWait mode (r=jandem)
authorBill McCloskey <billm@mozilla.com>
Wed, 19 Jul 2017 16:24:16 -0700
changeset 420574 8853b5119f6881cad9693231dd03648b45eaee79
parent 420573 74b6145a2873a7c72efd011eb07881b255b7d960
child 420575 35368df4e011b0b1e7bef2936ad656d2cd4e17b1
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1384397
milestone56.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 1384397 - Add API to request interrupt callback using CanWait mode (r=jandem) MozReview-Commit-ID: E0S0my7Xdfk
js/src/jsapi.cpp
js/src/jsapi.h
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5243,16 +5243,22 @@ JS::SetAsyncTaskCallbacks(JSContext* cx,
 }
 
 JS_PUBLIC_API(void)
 JS_RequestInterruptCallback(JSContext* cx)
 {
     cx->requestInterrupt(JSContext::RequestInterruptUrgent);
 }
 
+JS_PUBLIC_API(void)
+JS_RequestInterruptCallbackCanWait(JSContext* cx)
+{
+    cx->requestInterrupt(JSContext::RequestInterruptCanWait);
+}
+
 JS::AutoSetAsyncStackForNewCalls::AutoSetAsyncStackForNewCalls(
   JSContext* cx, HandleObject stack, const char* asyncCause,
   JS::AutoSetAsyncStackForNewCalls::AsyncCallKind kind)
   : cx(cx),
     oldAsyncStack(cx, cx->asyncStackForNewActivations()),
     oldAsyncCause(cx->asyncCauseForNewActivations),
     oldAsyncCallIsExplicit(cx->asyncCallIsExplicit)
 {
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -4588,16 +4588,19 @@ extern JS_PUBLIC_API(bool)
 JS_DisableInterruptCallback(JSContext* cx);
 
 extern JS_PUBLIC_API(void)
 JS_ResetInterruptCallback(JSContext* cx, bool enable);
 
 extern JS_PUBLIC_API(void)
 JS_RequestInterruptCallback(JSContext* cx);
 
+extern JS_PUBLIC_API(void)
+JS_RequestInterruptCallbackCanWait(JSContext* cx);
+
 namespace JS {
 
 /**
  * Sets the callback that's invoked whenever an incumbent global is required.
  *
  * SpiderMonkey doesn't itself have a notion of incumbent globals as defined
  * by the html spec, so we need the embedding to provide this.
  * See dom/base/ScriptSettings.h for details.