michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [ptr] native JSRuntime(JSRuntime); michael@0: [ptr] native JSContext(JSContext); michael@0: native xpcGCCallback(xpcGCCallback); michael@0: native xpcContextCallback(xpcContextCallback); michael@0: michael@0: %{C++ michael@0: michael@0: #include "jsapi.h" // for JSGCStatus michael@0: michael@0: typedef void michael@0: (* xpcGCCallback)(JSGCStatus status); michael@0: michael@0: typedef bool michael@0: (* xpcContextCallback)(JSContext* cx, unsigned operation); michael@0: michael@0: %} michael@0: michael@0: interface nsIBackstagePass; michael@0: michael@0: [uuid( 2ac111f2-e492-488e-85df-353c453e98f3)] michael@0: interface nsIJSRuntimeService : nsISupports michael@0: { michael@0: readonly attribute JSRuntime runtime; michael@0: michael@0: /** michael@0: * Register additional GC callback which will run after the michael@0: * standard XPConnect callback. michael@0: */ michael@0: [noscript, notxpcom] void registerGCCallback(in xpcGCCallback func); michael@0: [noscript, notxpcom] void unregisterGCCallback(in xpcGCCallback func); michael@0: michael@0: /** michael@0: * Register additional context callback which will run after the michael@0: * standard XPConnect callback. michael@0: */ michael@0: [noscript, notxpcom] void registerContextCallback(in xpcContextCallback func); michael@0: [noscript, notxpcom] void unregisterContextCallback(in xpcContextCallback func); michael@0: };