зеркало из https://github.com/mozilla/gecko-dev.git
Bug 741347 - Remove nsIXPConnect::DefineDOMQuickStubs, call DOM_DefineQuickStubs directly instead; r=bholley
This commit is contained in:
Родитель
dfc44fcf97
Коммит
1d66128fff
|
@ -53,7 +53,9 @@
|
||||||
#include "jsdbgapi.h"
|
#include "jsdbgapi.h"
|
||||||
#include "WrapperFactory.h"
|
#include "WrapperFactory.h"
|
||||||
#include "AccessCheck.h"
|
#include "AccessCheck.h"
|
||||||
|
#include "XrayWrapper.h"
|
||||||
|
|
||||||
|
#include "xpcpublic.h"
|
||||||
#include "xpcprivate.h"
|
#include "xpcprivate.h"
|
||||||
#include "XPCWrapper.h"
|
#include "XPCWrapper.h"
|
||||||
|
|
||||||
|
@ -84,8 +86,6 @@
|
||||||
#include "nsIRunnable.h"
|
#include "nsIRunnable.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsDOMEventTargetHelper.h"
|
#include "nsDOMEventTargetHelper.h"
|
||||||
#include "xpcprivate.h"
|
|
||||||
#include "XrayWrapper.h"
|
|
||||||
|
|
||||||
// General helper includes
|
// General helper includes
|
||||||
#include "nsGlobalWindow.h"
|
#include "nsGlobalWindow.h"
|
||||||
|
@ -4924,8 +4924,7 @@ nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * proto)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sXPConnect->DefineDOMQuickStubs(cx, proto, flags,
|
if (!xpc::DOM_DefineQuickStubs(cx, proto, flags, count, mData->mInterfaces)) {
|
||||||
count, mData->mInterfaces)) {
|
|
||||||
JS_ClearPendingException(cx);
|
JS_ClearPendingException(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,7 @@ enum nsGCType {
|
||||||
};
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
[uuid(08ad2253-3ed6-40ed-beec-6472f2d8dc7f)]
|
[uuid(1239b432-b835-4d28-9dc0-53063cb7f60f)]
|
||||||
interface nsIXPConnect : nsISupports
|
interface nsIXPConnect : nsISupports
|
||||||
{
|
{
|
||||||
%{ C++
|
%{ C++
|
||||||
|
@ -745,30 +745,6 @@ interface nsIXPConnect : nsISupports
|
||||||
*/
|
*/
|
||||||
void NotifyDidPaint();
|
void NotifyDidPaint();
|
||||||
|
|
||||||
/**
|
|
||||||
* Define quick stubs on the given object, @a proto.
|
|
||||||
*
|
|
||||||
* @param cx
|
|
||||||
* A context. Requires request.
|
|
||||||
* @param proto
|
|
||||||
* The (newly created) prototype object for a DOM class. The JS half
|
|
||||||
* of an XPCWrappedNativeProto.
|
|
||||||
* @param flags
|
|
||||||
* Property flags for the quick stub properties--should be either
|
|
||||||
* JSPROP_ENUMERATE or 0.
|
|
||||||
* @param interfaceCount
|
|
||||||
* The number of interfaces the class implements.
|
|
||||||
* @param interfaceArray
|
|
||||||
* The interfaces the class implements; interfaceArray and
|
|
||||||
* interfaceCount are like what nsIClassInfo.getInterfaces returns.
|
|
||||||
*/
|
|
||||||
[noscript,notxpcom] boolean defineDOMQuickStubs(
|
|
||||||
in JSContextPtr cx,
|
|
||||||
in JSObjectPtr proto,
|
|
||||||
in PRUint32 flags,
|
|
||||||
in PRUint32 interfaceCount,
|
|
||||||
[array, size_is(interfaceCount)] in nsIIDPtr interfaceArray);
|
|
||||||
|
|
||||||
%{C++
|
%{C++
|
||||||
/**
|
/**
|
||||||
* Get the object principal for this wrapper. Note that this may well end
|
* Get the object principal for this wrapper. Note that this may well end
|
||||||
|
|
|
@ -2373,18 +2373,6 @@ nsXPConnect::SetReportAllJSExceptions(bool newval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* [noscript, notxpcom] bool defineDOMQuickStubs (in JSContextPtr cx, in JSObjectPtr proto, in PRUint32 flags, in PRUint32 interfaceCount, [array, size_is (interfaceCount)] in nsIIDPtr interfaceArray); */
|
|
||||||
NS_IMETHODIMP_(bool)
|
|
||||||
nsXPConnect::DefineDOMQuickStubs(JSContext * cx,
|
|
||||||
JSObject * proto,
|
|
||||||
PRUint32 flags,
|
|
||||||
PRUint32 interfaceCount,
|
|
||||||
const nsIID * *interfaceArray)
|
|
||||||
{
|
|
||||||
return DOM_DefineQuickStubs(cx, proto, flags,
|
|
||||||
interfaceCount, interfaceArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* attribute JSRuntime runtime; */
|
/* attribute JSRuntime runtime; */
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXPConnect::GetRuntime(JSRuntime **runtime)
|
nsXPConnect::GetRuntime(JSRuntime **runtime)
|
||||||
|
|
|
@ -1274,14 +1274,16 @@ def writeDefiner(f, conf, stringtable, interfaces):
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
# the definer function (entry point to this quick stubs file)
|
# the definer function (entry point to this quick stubs file)
|
||||||
f.write("JSBool %s_DefineQuickStubs(" % conf.name)
|
f.write("namespace xpc {\n")
|
||||||
|
f.write("bool %s_DefineQuickStubs(" % conf.name)
|
||||||
f.write("JSContext *cx, JSObject *proto, unsigned flags, PRUint32 count, "
|
f.write("JSContext *cx, JSObject *proto, unsigned flags, PRUint32 count, "
|
||||||
"const nsID **iids)\n"
|
"const nsID **iids)\n"
|
||||||
"{\n")
|
"{\n")
|
||||||
f.write(" return xpc_qsDefineQuickStubs("
|
f.write(" return !!xpc_qsDefineQuickStubs("
|
||||||
"cx, proto, flags, count, iids, %d, tableData, %s, %s, %s);\n" % (
|
"cx, proto, flags, count, iids, %d, tableData, %s, %s, %s);\n" % (
|
||||||
size, prop_array_name, func_array_name, table_name))
|
size, prop_array_name, func_array_name, table_name))
|
||||||
f.write("}\n\n\n")
|
f.write("}\n")
|
||||||
|
f.write("} // namespace xpc\n\n\n")
|
||||||
|
|
||||||
|
|
||||||
stubTopTemplate = '''\
|
stubTopTemplate = '''\
|
||||||
|
|
|
@ -228,6 +228,28 @@ nsIPrincipal *GetCompartmentPrincipal(JSCompartment *compartment);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void DumpJSHeap(FILE* file);
|
void DumpJSHeap(FILE* file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define quick stubs on the given object, @a proto.
|
||||||
|
*
|
||||||
|
* @param cx
|
||||||
|
* A context. Requires request.
|
||||||
|
* @param proto
|
||||||
|
* The (newly created) prototype object for a DOM class. The JS half
|
||||||
|
* of an XPCWrappedNativeProto.
|
||||||
|
* @param flags
|
||||||
|
* Property flags for the quick stub properties--should be either
|
||||||
|
* JSPROP_ENUMERATE or 0.
|
||||||
|
* @param interfaceCount
|
||||||
|
* The number of interfaces the class implements.
|
||||||
|
* @param interfaceArray
|
||||||
|
* The interfaces the class implements; interfaceArray and
|
||||||
|
* interfaceCount are like what nsIClassInfo.getInterfaces returns.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
DOM_DefineQuickStubs(JSContext *cx, JSObject *proto, PRUint32 flags,
|
||||||
|
PRUint32 interfaceCount, const nsIID **interfaceArray);
|
||||||
|
|
||||||
} // namespace xpc
|
} // namespace xpc
|
||||||
|
|
||||||
class nsIMemoryMultiReporterCallback;
|
class nsIMemoryMultiReporterCallback;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче