Bug 981198 - Internally move the JSErrorReporter to the JSRuntime. r=terrence

This commit is contained in:
Bobby Holley 2014-09-09 16:02:10 -07:00
parent ca02b737d0
commit 03852284c1
5 changed files with 9 additions and 9 deletions

View File

@ -5769,7 +5769,7 @@ JS_ReportAllocationOverflow(JSContext *cx)
JS_PUBLIC_API(JSErrorReporter)
JS_GetErrorReporter(JSContext *cx)
{
return cx->errorReporter;
return cx->runtime()->errorReporter;
}
JS_PUBLIC_API(JSErrorReporter)
@ -5777,8 +5777,8 @@ JS_SetErrorReporter(JSContext *cx, JSErrorReporter er)
{
JSErrorReporter older;
older = cx->errorReporter;
cx->errorReporter = er;
older = cx->runtime()->errorReporter;
cx->runtime()->errorReporter = er;
return older;
}

View File

@ -387,7 +387,7 @@ js_ReportOutOfMemory(ThreadSafeContext *cxArg)
PopulateReportBlame(cx, &report);
/* Report the error. */
if (JSErrorReporter onError = cx->errorReporter) {
if (JSErrorReporter onError = cx->runtime()->errorReporter) {
AutoSuppressGC suppressGC(cx);
onError(cx, msg, &report);
}
@ -877,7 +877,7 @@ js::CallErrorReporter(JSContext *cx, const char *message, JSErrorReport *reportp
JS_ASSERT(message);
JS_ASSERT(reportp);
if (JSErrorReporter onError = cx->errorReporter)
if (JSErrorReporter onError = cx->runtime()->errorReporter)
onError(cx, message, reportp);
}
@ -1108,7 +1108,6 @@ JSContext::JSContext(JSRuntime *rt)
generatingError(false),
savedFrameChains_(),
cycleDetectorSet(MOZ_THIS_IN_INITIALIZER_LIST()),
errorReporter(nullptr),
data(nullptr),
data2(nullptr),
outstandingRequests(0),

View File

@ -460,9 +460,6 @@ struct JSContext : public js::ExclusiveContext,
/* State for object and array toSource conversion. */
js::ObjectSet cycleDetectorSet;
/* Per-context optional error reporter. */
JSErrorReporter errorReporter;
/* Client opaque pointers. */
void *data;
void *data2;

View File

@ -190,6 +190,7 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime)
destroyPrincipals(nullptr),
structuredCloneCallbacks(nullptr),
telemetryCallback(nullptr),
errorReporter(nullptr),
propertyRemovals(0),
#if !EXPOSE_INTL_API
thousandsSeparator(0),

View File

@ -1095,6 +1095,9 @@ struct JSRuntime : public JS::shadow::Runtime,
/* Call this to accumulate telemetry data. */
JSAccumulateTelemetryDataCallback telemetryCallback;
/* Optional error reporter. */
JSErrorReporter errorReporter;
/* AsmJSCache callbacks are runtime-wide. */
JS::AsmJSCacheOps asmJSCacheOps;