1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/xpconnect/idl/nsIJSRuntimeService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +[ptr] native JSRuntime(JSRuntime); 1.13 +[ptr] native JSContext(JSContext); 1.14 +native xpcGCCallback(xpcGCCallback); 1.15 +native xpcContextCallback(xpcContextCallback); 1.16 + 1.17 +%{C++ 1.18 + 1.19 +#include "jsapi.h" // for JSGCStatus 1.20 + 1.21 +typedef void 1.22 +(* xpcGCCallback)(JSGCStatus status); 1.23 + 1.24 +typedef bool 1.25 +(* xpcContextCallback)(JSContext* cx, unsigned operation); 1.26 + 1.27 +%} 1.28 + 1.29 +interface nsIBackstagePass; 1.30 + 1.31 +[uuid( 2ac111f2-e492-488e-85df-353c453e98f3)] 1.32 +interface nsIJSRuntimeService : nsISupports 1.33 +{ 1.34 + readonly attribute JSRuntime runtime; 1.35 + 1.36 + /** 1.37 + * Register additional GC callback which will run after the 1.38 + * standard XPConnect callback. 1.39 + */ 1.40 + [noscript, notxpcom] void registerGCCallback(in xpcGCCallback func); 1.41 + [noscript, notxpcom] void unregisterGCCallback(in xpcGCCallback func); 1.42 + 1.43 + /** 1.44 + * Register additional context callback which will run after the 1.45 + * standard XPConnect callback. 1.46 + */ 1.47 + [noscript, notxpcom] void registerContextCallback(in xpcContextCallback func); 1.48 + [noscript, notxpcom] void unregisterContextCallback(in xpcContextCallback func); 1.49 +};