fixing apparent mismatch between IDL and generated source. seems to fix the Windows startup crasher. a:sar
This commit is contained in:
Родитель
fba9b07486
Коммит
bb4c1e7adc
|
@ -39,15 +39,16 @@ public:
|
|||
|
||||
NS_IMETHOD Forward()=0;
|
||||
|
||||
#ifdef ClientWallet
|
||||
NS_IMETHOD WalletEditor()=0;
|
||||
NS_IMETHOD WalletSafeFillin()=0;
|
||||
NS_IMETHOD WalletQuickFillin()=0;
|
||||
NS_IMETHOD WalletSamples()=0;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD LoadUrl(const nsString& aUrl)=0;
|
||||
|
||||
NS_IMETHOD WalletEditor()=0;
|
||||
|
||||
NS_IMETHOD WalletSafeFillin()=0;
|
||||
|
||||
NS_IMETHOD WalletQuickFillin()=0;
|
||||
|
||||
NS_IMETHOD WalletSamples()=0;
|
||||
|
||||
NS_IMETHOD SetToolbarWindow(nsIDOMWindow* aWin)=0;
|
||||
|
||||
NS_IMETHOD SetContentWindow(nsIDOMWindow* aWin)=0;
|
||||
|
@ -72,6 +73,10 @@ public:
|
|||
NS_IMETHOD Back(); \
|
||||
NS_IMETHOD Forward(); \
|
||||
NS_IMETHOD LoadUrl(const nsString& aUrl); \
|
||||
NS_IMETHOD WalletEditor(); \
|
||||
NS_IMETHOD WalletSafeFillin(); \
|
||||
NS_IMETHOD WalletQuickFillin(); \
|
||||
NS_IMETHOD WalletSamples(); \
|
||||
NS_IMETHOD SetToolbarWindow(nsIDOMWindow* aWin); \
|
||||
NS_IMETHOD SetContentWindow(nsIDOMWindow* aWin); \
|
||||
NS_IMETHOD SetWebShellWindow(nsIDOMWindow* aWin); \
|
||||
|
@ -88,6 +93,10 @@ public:
|
|||
NS_IMETHOD Back() { return _to##Back(); } \
|
||||
NS_IMETHOD Forward() { return _to##Forward(); } \
|
||||
NS_IMETHOD LoadUrl(const nsString& aUrl) { return _to##LoadUrl(aUrl); } \
|
||||
NS_IMETHOD WalletEditor() { return _to##WalletEditor(); } \
|
||||
NS_IMETHOD WalletSafeFillin() { return _to##WalletSafeFillin(); } \
|
||||
NS_IMETHOD WalletQuickFillin() { return _to##WalletQuickFillin(); } \
|
||||
NS_IMETHOD WalletSamples() { return _to##WalletSamples(); } \
|
||||
NS_IMETHOD SetToolbarWindow(nsIDOMWindow* aWin) { return _to##SetToolbarWindow(aWin); } \
|
||||
NS_IMETHOD SetContentWindow(nsIDOMWindow* aWin) { return _to##SetContentWindow(aWin); } \
|
||||
NS_IMETHOD SetWebShellWindow(nsIDOMWindow* aWin) { return _to##SetWebShellWindow(aWin); } \
|
||||
|
@ -99,7 +108,7 @@ public:
|
|||
NS_IMETHOD SetEnableCallback(const nsString& aScript) { return _to##SetEnableCallback(aScript); } \
|
||||
|
||||
|
||||
extern nsresult NS_InitBrowserAppCoreClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
extern "C" NS_DOM nsresult NS_InitBrowserAppCoreClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
||||
extern "C" NS_DOM nsresult NS_NewScriptBrowserAppCore(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||
|
||||
|
|
|
@ -63,12 +63,10 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
|||
NS_IMETHOD Back();
|
||||
NS_IMETHOD Forward();
|
||||
|
||||
#ifdef ClientWallet
|
||||
NS_IMETHOD WalletEditor();
|
||||
NS_IMETHOD WalletSafeFillin();
|
||||
NS_IMETHOD WalletQuickFillin();
|
||||
NS_IMETHOD WalletSamples();
|
||||
#endif
|
||||
|
||||
NS_IMETHOD LoadUrl(const nsString& aUrl);
|
||||
NS_IMETHOD SetToolbarWindow(nsIDOMWindow* aWin);
|
||||
|
|
|
@ -196,7 +196,42 @@ BrowserAppCoreForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
|
||||
|
||||
#ifdef ClientWallet
|
||||
//
|
||||
// Native method LoadUrl
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
BrowserAppCoreLoadUrl(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMBrowserAppCore *nativeThis = (nsIDOMBrowserAppCore*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
if (NS_OK != nativeThis->LoadUrl(b0)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function loadUrl requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method WalletEditor
|
||||
//
|
||||
|
@ -327,43 +362,6 @@ BrowserAppCoreWalletSamples(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
return JS_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Native method LoadUrl
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
BrowserAppCoreLoadUrl(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMBrowserAppCore *nativeThis = (nsIDOMBrowserAppCore*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
if (NS_OK != nativeThis->LoadUrl(b0)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function loadUrl requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
@ -730,13 +728,11 @@ static JSFunctionSpec BrowserAppCoreMethods[] =
|
|||
{
|
||||
{"back", BrowserAppCoreBack, 0},
|
||||
{"forward", BrowserAppCoreForward, 0},
|
||||
#ifdef ClientWallet
|
||||
{"loadUrl", BrowserAppCoreLoadUrl, 1},
|
||||
{"walletEditor", BrowserAppCoreWalletEditor, 0},
|
||||
{"walletSafeFillin", BrowserAppCoreWalletSafeFillin, 0},
|
||||
{"walletQuickFillin", BrowserAppCoreWalletQuickFillin, 0},
|
||||
{"walletSamples", BrowserAppCoreWalletSamples, 0},
|
||||
#endif
|
||||
{"loadUrl", BrowserAppCoreLoadUrl, 1},
|
||||
{"setToolbarWindow", BrowserAppCoreSetToolbarWindow, 1},
|
||||
{"setContentWindow", BrowserAppCoreSetContentWindow, 1},
|
||||
{"setWebShellWindow", BrowserAppCoreSetWebShellWindow, 1},
|
||||
|
@ -802,7 +798,7 @@ BrowserAppCore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
|
|||
//
|
||||
// BrowserAppCore class initialization
|
||||
//
|
||||
nsresult NS_InitBrowserAppCoreClass(nsIScriptContext *aContext, void **aPrototype)
|
||||
extern "C" NS_DOM nsresult NS_InitBrowserAppCoreClass(nsIScriptContext *aContext, void **aPrototype)
|
||||
{
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
JSObject *proto = nsnull;
|
||||
|
|
Загрузка…
Ссылка в новой задаче