mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 662000 part 2: Remove XPC_IDISPATCH_SUPPORT from the build-system and XPConnect. r=mrbkap
This commit is contained in:
parent
5764937981
commit
892ad17efd
@ -588,13 +588,6 @@ private:
|
|||||||
nsresult
|
nsresult
|
||||||
InitPrincipals(PRUint32 prefCount, const char** prefNames);
|
InitPrincipals(PRUint32 prefCount, const char** prefNames);
|
||||||
|
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// While this header is included outside of caps, this class isn't
|
|
||||||
// referenced so this should be fine.
|
|
||||||
nsresult
|
|
||||||
CheckComponentPermissions(JSContext *cx, const nsCID &aCID);
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_CAPS_HACKER
|
#ifdef DEBUG_CAPS_HACKER
|
||||||
void
|
void
|
||||||
PrintPolicyDB();
|
PrintPolicyDB();
|
||||||
@ -632,10 +625,6 @@ private:
|
|||||||
PRPackedBool mIsJavaScriptEnabled;
|
PRPackedBool mIsJavaScriptEnabled;
|
||||||
PRPackedBool mIsWritingPrefs;
|
PRPackedBool mIsWritingPrefs;
|
||||||
PRPackedBool mPolicyPrefsChanged;
|
PRPackedBool mPolicyPrefsChanged;
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
PRPackedBool mXPCDefaultGrantAll;
|
|
||||||
static const char sXPCDefaultGrantAllName[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static PRBool sStrictFileOriginPolicy;
|
static PRBool sStrictFileOriginPolicy;
|
||||||
|
|
||||||
|
@ -58,10 +58,6 @@ CPPSRCS = \
|
|||||||
nsSecurityManagerFactory.cpp \
|
nsSecurityManagerFactory.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
DEFINES += -DXPC_IDISPATCH_SUPPORT
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
INCLUDES += -I$(srcdir)/../include \
|
INCLUDES += -I$(srcdir)/../include \
|
||||||
|
@ -3090,60 +3090,6 @@ nsScriptSecurityManager::CanCreateWrapper(JSContext *cx,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
nsresult
|
|
||||||
nsScriptSecurityManager::CheckComponentPermissions(JSContext *cx,
|
|
||||||
const nsCID &aCID)
|
|
||||||
{
|
|
||||||
nsresult rv;
|
|
||||||
nsIPrincipal* subjectPrincipal = GetSubjectPrincipal(cx, &rv);
|
|
||||||
if (NS_FAILED(rv))
|
|
||||||
return rv;
|
|
||||||
|
|
||||||
// Reformat the CID string so it's suitable for prefs
|
|
||||||
nsXPIDLCString cidTemp;
|
|
||||||
cidTemp.Adopt(aCID.ToString());
|
|
||||||
nsCAutoString cid(NS_LITERAL_CSTRING("CID") +
|
|
||||||
Substring(cidTemp, 1, cidTemp.Length() - 2));
|
|
||||||
ToUpperCase(cid);
|
|
||||||
|
|
||||||
#ifdef DEBUG_CAPS_CheckComponentPermissions
|
|
||||||
printf("### CheckComponentPermissions(ClassID.%s) ",cid.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Look up the policy for this class.
|
|
||||||
// while this isn't a property we'll treat it as such, using ACCESS_CALL_METHOD
|
|
||||||
JSAutoRequest ar(cx);
|
|
||||||
jsid cidId = INTERNED_STRING_TO_JSID(::JS_InternString(cx, cid.get()));
|
|
||||||
|
|
||||||
ClassInfoData nameData(nsnull, "ClassID");
|
|
||||||
SecurityLevel securityLevel;
|
|
||||||
rv = LookupPolicy(subjectPrincipal, nameData, cidId,
|
|
||||||
nsIXPCSecurityManager::ACCESS_CALL_METHOD,
|
|
||||||
nsnull, &securityLevel);
|
|
||||||
if (NS_FAILED(rv))
|
|
||||||
return rv;
|
|
||||||
|
|
||||||
// If there's no policy stored, use the "security.classID.allowByDefault" pref
|
|
||||||
if (securityLevel.level == SCRIPT_SECURITY_UNDEFINED_ACCESS)
|
|
||||||
securityLevel.level = mXPCDefaultGrantAll ? SCRIPT_SECURITY_ALL_ACCESS :
|
|
||||||
SCRIPT_SECURITY_NO_ACCESS;
|
|
||||||
|
|
||||||
if (securityLevel.level == SCRIPT_SECURITY_ALL_ACCESS)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_CAPS_CheckComponentPermissions
|
|
||||||
printf(" GRANTED.\n");
|
|
||||||
#endif
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_CAPS_CheckComponentPermissions
|
|
||||||
printf(" DENIED.\n");
|
|
||||||
#endif
|
|
||||||
return NS_ERROR_DOM_PROP_ACCESS_DENIED;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsScriptSecurityManager::CanCreateInstance(JSContext *cx,
|
nsScriptSecurityManager::CanCreateInstance(JSContext *cx,
|
||||||
const nsCID &aCID)
|
const nsCID &aCID)
|
||||||
@ -3156,12 +3102,6 @@ nsScriptSecurityManager::CanCreateInstance(JSContext *cx,
|
|||||||
|
|
||||||
nsresult rv = CheckXPCPermissions(nsnull, nsnull, nsnull, nsnull, nsnull);
|
nsresult rv = CheckXPCPermissions(nsnull, nsnull, nsnull, nsnull, nsnull);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
{
|
|
||||||
rv = CheckComponentPermissions(cx, aCID);
|
|
||||||
}
|
|
||||||
if (NS_FAILED(rv))
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
//-- Access denied, report an error
|
//-- Access denied, report an error
|
||||||
nsCAutoString errorMsg("Permission denied to create instance of class. CID=");
|
nsCAutoString errorMsg("Permission denied to create instance of class. CID=");
|
||||||
@ -3382,9 +3322,6 @@ nsScriptSecurityManager::nsScriptSecurityManager(void)
|
|||||||
mIsJavaScriptEnabled(PR_FALSE),
|
mIsJavaScriptEnabled(PR_FALSE),
|
||||||
mIsWritingPrefs(PR_FALSE),
|
mIsWritingPrefs(PR_FALSE),
|
||||||
mPolicyPrefsChanged(PR_TRUE)
|
mPolicyPrefsChanged(PR_TRUE)
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
, mXPCDefaultGrantAll(PR_FALSE)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
NS_ASSERTION(sizeof(PRWord) == sizeof(void*),
|
NS_ASSERTION(sizeof(PRWord) == sizeof(void*),
|
||||||
"PRWord and void* have different lengths on this platform. "
|
"PRWord and void* have different lengths on this platform. "
|
||||||
@ -3982,10 +3919,6 @@ const char nsScriptSecurityManager::sJSEnabledPrefName[] =
|
|||||||
"javascript.enabled";
|
"javascript.enabled";
|
||||||
const char nsScriptSecurityManager::sFileOriginPolicyPrefName[] =
|
const char nsScriptSecurityManager::sFileOriginPolicyPrefName[] =
|
||||||
"security.fileuri.strict_origin_policy";
|
"security.fileuri.strict_origin_policy";
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
const char nsScriptSecurityManager::sXPCDefaultGrantAllName[] =
|
|
||||||
"security.classID.allowByDefault";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
nsScriptSecurityManager::ScriptSecurityPrefChanged()
|
nsScriptSecurityManager::ScriptSecurityPrefChanged()
|
||||||
@ -3995,11 +3928,6 @@ nsScriptSecurityManager::ScriptSecurityPrefChanged()
|
|||||||
|
|
||||||
sStrictFileOriginPolicy = PR_TRUE;
|
sStrictFileOriginPolicy = PR_TRUE;
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// Granting XPC Priveleges defaults to disabled in failure cases.
|
|
||||||
mXPCDefaultGrantAll = PR_FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
if (!mPrefBranch) {
|
if (!mPrefBranch) {
|
||||||
rv = InitPrefs();
|
rv = InitPrefs();
|
||||||
@ -4015,12 +3943,6 @@ nsScriptSecurityManager::ScriptSecurityPrefChanged()
|
|||||||
rv = mPrefBranch->GetBoolPref(sFileOriginPolicyPrefName, &temp);
|
rv = mPrefBranch->GetBoolPref(sFileOriginPolicyPrefName, &temp);
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
sStrictFileOriginPolicy = NS_SUCCEEDED(rv) && temp;
|
sStrictFileOriginPolicy = NS_SUCCEEDED(rv) && temp;
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
rv = mPrefBranch->GetBoolPref(sXPCDefaultGrantAllName, &temp);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
|
||||||
mXPCDefaultGrantAll = temp;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@ -4039,9 +3961,6 @@ nsScriptSecurityManager::InitPrefs()
|
|||||||
// set observer callbacks in case the value of the prefs change
|
// set observer callbacks in case the value of the prefs change
|
||||||
prefBranchInternal->AddObserver(sJSEnabledPrefName, this, PR_FALSE);
|
prefBranchInternal->AddObserver(sJSEnabledPrefName, this, PR_FALSE);
|
||||||
prefBranchInternal->AddObserver(sFileOriginPolicyPrefName, this, PR_FALSE);
|
prefBranchInternal->AddObserver(sFileOriginPolicyPrefName, this, PR_FALSE);
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
prefBranchInternal->AddObserver(sXPCDefaultGrantAllName, this, PR_FALSE);
|
|
||||||
#endif
|
|
||||||
PRUint32 prefCount;
|
PRUint32 prefCount;
|
||||||
char** prefNames;
|
char** prefNames;
|
||||||
|
|
||||||
|
@ -138,7 +138,6 @@ MOZ_UPDATE_PACKAGING = @MOZ_UPDATE_PACKAGING@
|
|||||||
MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
|
MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
|
||||||
MOZ_ACTIVEX_SCRIPTING_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
|
MOZ_ACTIVEX_SCRIPTING_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
|
||||||
MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
|
MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
|
||||||
XPC_IDISPATCH_SUPPORT = @XPC_IDISPATCH_SUPPORT@
|
|
||||||
NS_ENABLE_TSF = @NS_ENABLE_TSF@
|
NS_ENABLE_TSF = @NS_ENABLE_TSF@
|
||||||
MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
|
MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
|
||||||
MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
|
MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
|
||||||
|
11
configure.in
11
configure.in
@ -4819,7 +4819,6 @@ NECKO_DISK_CACHE=1
|
|||||||
NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg"
|
NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg"
|
||||||
USE_ARM_KUSER=
|
USE_ARM_KUSER=
|
||||||
BUILD_CTYPES=1
|
BUILD_CTYPES=1
|
||||||
XPC_IDISPATCH_SUPPORT=
|
|
||||||
|
|
||||||
|
|
||||||
case "${target}" in
|
case "${target}" in
|
||||||
@ -6503,14 +6502,6 @@ dnl ========================================================
|
|||||||
dnl ActiveX
|
dnl ActiveX
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
|
|
||||||
MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
|
|
||||||
[ --disable-xpconnect-idispatch
|
|
||||||
Disable building of xpconnect support for IDispatch
|
|
||||||
(win32 only)],
|
|
||||||
XPC_IDISPATCH_SUPPORT=,
|
|
||||||
XPC_IDISPATCH_SUPPORT=1)
|
|
||||||
AC_SUBST(XPC_IDISPATCH_SUPPORT)
|
|
||||||
|
|
||||||
MOZ_ARG_DISABLE_BOOL(activex,
|
MOZ_ARG_DISABLE_BOOL(activex,
|
||||||
[ --disable-activex Disable building of ActiveX control (win32 only)],
|
[ --disable-activex Disable building of ActiveX control (win32 only)],
|
||||||
MOZ_NO_ACTIVEX_SUPPORT=1,
|
MOZ_NO_ACTIVEX_SUPPORT=1,
|
||||||
@ -6530,7 +6521,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$COMPILE_ENVIRONMENT" = "1"; then
|
if test "$COMPILE_ENVIRONMENT" = "1"; then
|
||||||
if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
|
if test -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*-mingw*)
|
*-mingw*)
|
||||||
if test "$ac_cv_header_atlbase_h" = "no"; then
|
if test "$ac_cv_header_atlbase_h" = "no"; then
|
||||||
|
@ -63,17 +63,9 @@ XPIDLSRCS = \
|
|||||||
nsIScriptError.idl \
|
nsIScriptError.idl \
|
||||||
nsIXPCScriptNotify.idl \
|
nsIXPCScriptNotify.idl \
|
||||||
nsIScriptableInterfaces.idl \
|
nsIScriptableInterfaces.idl \
|
||||||
XPCIDispatch.idl \
|
|
||||||
xpcIJSWeakReference.idl \
|
xpcIJSWeakReference.idl \
|
||||||
xpcIJSGetFactory.idl \
|
xpcIJSGetFactory.idl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
XPIDLSRCS += \
|
|
||||||
nsIDispatchSupport.idl \
|
|
||||||
nsIActiveXSecurityPolicy.idl \
|
|
||||||
$(NULL)
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
|
@ -137,14 +137,6 @@ class nsWrapperCache;
|
|||||||
#define NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN GENERATE_XPC_FAILURE(52)
|
#define NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN GENERATE_XPC_FAILURE(52)
|
||||||
#define NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL GENERATE_XPC_FAILURE(53)
|
#define NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL GENERATE_XPC_FAILURE(53)
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// IDispatch support related errors
|
|
||||||
#define NS_ERROR_XPC_COM_UNKNOWN GENERATE_XPC_FAILURE(54)
|
|
||||||
#define NS_ERROR_XPC_COM_ERROR GENERATE_XPC_FAILURE(55)
|
|
||||||
#define NS_ERROR_XPC_COM_INVALID_CLASS_ID GENERATE_XPC_FAILURE(56)
|
|
||||||
#define NS_ERROR_XPC_COM_CREATE_FAILED GENERATE_XPC_FAILURE(57)
|
|
||||||
#define NS_ERROR_XPC_IDISPATCH_NOT_ENABLED GENERATE_XPC_FAILURE(58)
|
|
||||||
#endif
|
|
||||||
// any new errors here should have an associated entry added in xpc.msg
|
// any new errors here should have an associated entry added in xpc.msg
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
%}
|
%}
|
||||||
|
@ -93,18 +93,6 @@ CPPSRCS = \
|
|||||||
xpcquickstubs.cpp \
|
xpcquickstubs.cpp \
|
||||||
dom_quickstubs.cpp \
|
dom_quickstubs.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
CPPSRCS += XPCDispObject.cpp \
|
|
||||||
XPCDispInterface.cpp \
|
|
||||||
XPCDispConvert.cpp \
|
|
||||||
XPCDispTypeInfo.cpp \
|
|
||||||
XPCDispTearOff.cpp \
|
|
||||||
XPCIDispatchExtension.cpp \
|
|
||||||
XPCDispParams.cpp \
|
|
||||||
XPCIDispatchClassInfo.cpp \
|
|
||||||
nsDispatchSupport.cpp \
|
|
||||||
$(NULL)
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
|
|
||||||
@ -154,14 +142,6 @@ ENABLE_TRACEABLE_FLAGS = --enable-traceables
|
|||||||
|
|
||||||
endif # ENABLE_JIT
|
endif # ENABLE_JIT
|
||||||
|
|
||||||
ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
DEFINES += -DXPC_IDISPATCH_SUPPORT
|
|
||||||
ifdef XPC_COMOBJECT
|
|
||||||
DEFINES += -DXPC_COMOBJECT
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
ifndef GNU_CXX
|
ifndef GNU_CXX
|
||||||
ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
|
ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
|
||||||
|
@ -162,14 +162,6 @@ XPC_MSG_DEF(NS_ERROR_OBJECT_IS_IMMUTABLE , "Can not modify immutable
|
|||||||
XPC_MSG_DEF(NS_ERROR_LOSS_OF_SIGNIFICANT_DATA , "Data conversion failed because significant data would be lost")
|
XPC_MSG_DEF(NS_ERROR_LOSS_OF_SIGNIFICANT_DATA , "Data conversion failed because significant data would be lost")
|
||||||
XPC_MSG_DEF(NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA , "Data conversion succeeded but data was rounded to fit")
|
XPC_MSG_DEF(NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA , "Data conversion succeeded but data was rounded to fit")
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
XPC_MSG_DEF(NS_ERROR_XPC_COM_UNKNOWN , "Unknown COM error occurred")
|
|
||||||
XPC_MSG_DEF(NS_ERROR_XPC_COM_ERROR , "COM Error")
|
|
||||||
XPC_MSG_DEF(NS_ERROR_XPC_COM_INVALID_CLASS_ID , "Invalid class ID")
|
|
||||||
XPC_MSG_DEF(NS_ERROR_XPC_COM_CREATE_FAILED , "Unable to create an instance of the desired COM class")
|
|
||||||
XPC_MSG_DEF(NS_ERROR_XPC_IDISPATCH_NOT_ENABLED , "IDispatch support is not enabled")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* network related codes (from nsNetError.h) */
|
/* network related codes (from nsNetError.h) */
|
||||||
|
|
||||||
XPC_MSG_DEF(NS_BINDING_FAILED , "The async request failed for some unknown reason")
|
XPC_MSG_DEF(NS_BINDING_FAILED , "The async request failed for some unknown reason")
|
||||||
|
@ -216,9 +216,6 @@ XPCCallContext::SetName(jsid name)
|
|||||||
|
|
||||||
mName = name;
|
mName = name;
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
mIDispatchMember = nsnull;
|
|
||||||
#endif
|
|
||||||
if(mTearOff)
|
if(mTearOff)
|
||||||
{
|
{
|
||||||
mSet = nsnull;
|
mSet = nsnull;
|
||||||
@ -274,9 +271,6 @@ XPCCallContext::SetCallInfo(XPCNativeInterface* iface, XPCNativeMember* member,
|
|||||||
|
|
||||||
if(mState < HAVE_NAME)
|
if(mState < HAVE_NAME)
|
||||||
mState = HAVE_NAME;
|
mState = HAVE_NAME;
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
mIDispatchMember = nsnull;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -291,9 +285,6 @@ XPCCallContext::SetArgsAndResultPtr(uintN argc,
|
|||||||
mSet = nsnull;
|
mSet = nsnull;
|
||||||
mInterface = nsnull;
|
mInterface = nsnull;
|
||||||
mMember = nsnull;
|
mMember = nsnull;
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
mIDispatchMember = nsnull;
|
|
||||||
#endif
|
|
||||||
mStaticMemberIsLocal = JS_FALSE;
|
mStaticMemberIsLocal = JS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,33 +544,6 @@ XPCCallContext::SetReturnValueWasSet(PRBool aReturnValueWasSet)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
|
|
||||||
void
|
|
||||||
XPCCallContext::SetIDispatchInfo(XPCNativeInterface* iface,
|
|
||||||
void * member)
|
|
||||||
{
|
|
||||||
CHECK_STATE(HAVE_CONTEXT);
|
|
||||||
|
|
||||||
// We are going straight to the method info and need not do a lookup
|
|
||||||
// by id.
|
|
||||||
|
|
||||||
// don't be tricked if method is called with wrong 'this'
|
|
||||||
if(mTearOff && mTearOff->GetInterface() != iface)
|
|
||||||
mTearOff = nsnull;
|
|
||||||
|
|
||||||
mSet = nsnull;
|
|
||||||
mInterface = iface;
|
|
||||||
mMember = nsnull;
|
|
||||||
mIDispatchMember = member;
|
|
||||||
mName = reinterpret_cast<XPCDispInterface::Member*>(member)->GetName();
|
|
||||||
|
|
||||||
if(mState < HAVE_NAME)
|
|
||||||
mState = HAVE_NAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
XPCCallContext::GetPreviousCallContext(nsAXPCNativeCallContext **aResult)
|
XPCCallContext::GetPreviousCallContext(nsAXPCNativeCallContext **aResult)
|
||||||
{
|
{
|
||||||
|
@ -101,14 +101,4 @@ class AutoMarkingPtr;
|
|||||||
|
|
||||||
class xpcProperty;
|
class xpcProperty;
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
class XPCDispInterface;
|
|
||||||
struct IDispatch;
|
|
||||||
class XPCDispParams;
|
|
||||||
class XPCDispJSPropertyInfo;
|
|
||||||
class nsIXPConnectWrappedJS;
|
|
||||||
class XPCIDispatchExtension;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* xpcforwards_h___ */
|
#endif /* xpcforwards_h___ */
|
||||||
|
@ -271,11 +271,7 @@ XPCCallContext::GetMember() const
|
|||||||
inline JSBool
|
inline JSBool
|
||||||
XPCCallContext::HasInterfaceAndMember() const
|
XPCCallContext::HasInterfaceAndMember() const
|
||||||
{
|
{
|
||||||
return mState >= HAVE_NAME && mInterface && (mMember
|
return mState >= HAVE_NAME && mInterface && mMember;
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
|| mIDispatchMember
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline jsid
|
inline jsid
|
||||||
@ -612,65 +608,19 @@ inline void XPCNativeSet::ASSERT_NotMarked()
|
|||||||
inline
|
inline
|
||||||
JSObject* XPCWrappedNativeTearOff::GetJSObject() const
|
JSObject* XPCWrappedNativeTearOff::GetJSObject() const
|
||||||
{
|
{
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
if(IsIDispatch())
|
|
||||||
{
|
|
||||||
XPCDispInterface * iface = GetIDispatchInfo();
|
|
||||||
return iface ? iface->GetJSObject() : nsnull;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return mJSObject;
|
return mJSObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
void XPCWrappedNativeTearOff::SetJSObject(JSObject* JSObj)
|
void XPCWrappedNativeTearOff::SetJSObject(JSObject* JSObj)
|
||||||
{
|
{
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
if(IsIDispatch())
|
|
||||||
{
|
|
||||||
XPCDispInterface* iface = GetIDispatchInfo();
|
|
||||||
if(iface)
|
|
||||||
iface->SetJSObject(JSObj);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
mJSObject = JSObj;
|
mJSObject = JSObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
inline void
|
|
||||||
XPCWrappedNativeTearOff::SetIDispatch(JSContext* cx)
|
|
||||||
{
|
|
||||||
mJSObject = (JSObject*)(((jsword)
|
|
||||||
::XPCDispInterface::NewInstance(cx,
|
|
||||||
mNative)) | 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline XPCDispInterface*
|
|
||||||
XPCWrappedNativeTearOff::GetIDispatchInfo() const
|
|
||||||
{
|
|
||||||
NS_ASSERTION((jsword)mJSObject & 2, "XPCWrappedNativeTearOff::GetIDispatchInfo "
|
|
||||||
"called on a non IDispatch interface");
|
|
||||||
return reinterpret_cast<XPCDispInterface*>
|
|
||||||
((((jsword)mJSObject) & ~JSOBJECT_MASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline JSBool
|
|
||||||
XPCWrappedNativeTearOff::IsIDispatch() const
|
|
||||||
{
|
|
||||||
return (JSBool)(((jsword)mJSObject) & IDISPATCH_BIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inline
|
inline
|
||||||
XPCWrappedNativeTearOff::~XPCWrappedNativeTearOff()
|
XPCWrappedNativeTearOff::~XPCWrappedNativeTearOff()
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!(GetInterface()||GetNative()||GetJSObject()), "tearoff not empty in dtor");
|
NS_ASSERTION(!(GetInterface()||GetNative()||GetJSObject()), "tearoff not empty in dtor");
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
if(IsIDispatch())
|
|
||||||
delete GetIDispatchInfo();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
@ -49,10 +49,6 @@ xpcModuleCtor()
|
|||||||
XPCWrappedNativeScope::InitStatics();
|
XPCWrappedNativeScope::InitStatics();
|
||||||
XPCPerThreadData::InitStatics();
|
XPCPerThreadData::InitStatics();
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
XPCIDispatchExtension::InitStatics();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,8 +58,4 @@ xpcModuleDtor()
|
|||||||
// Release our singletons
|
// Release our singletons
|
||||||
nsXPConnect::ReleaseXPConnectSingleton();
|
nsXPConnect::ReleaseXPConnectSingleton();
|
||||||
xpc_DestroyJSxIDClassObjects();
|
xpc_DestroyJSxIDClassObjects();
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
nsDispatchSupport::FreeSingleton();
|
|
||||||
XPCIDispatchClassInfo::FreeSingleton();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -67,11 +67,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsXPCComponents_Interfaces)
|
|||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSComponentLoader)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSComponentLoader)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSSubScriptLoader)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSSubScriptLoader)
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIDispatchSupport,
|
|
||||||
nsDispatchSupport::GetSingleton)
|
|
||||||
#endif // XPC_IDISPATCH_SUPPORT
|
|
||||||
|
|
||||||
NS_DEFINE_NAMED_CID(NS_JS_ID_CID);
|
NS_DEFINE_NAMED_CID(NS_JS_ID_CID);
|
||||||
NS_DEFINE_NAMED_CID(NS_XPCONNECT_CID);
|
NS_DEFINE_NAMED_CID(NS_XPCONNECT_CID);
|
||||||
NS_DEFINE_NAMED_CID(NS_XPCEXCEPTION_CID);
|
NS_DEFINE_NAMED_CID(NS_XPCEXCEPTION_CID);
|
||||||
@ -80,16 +75,6 @@ NS_DEFINE_NAMED_CID(SCRIPTABLE_INTERFACES_CID);
|
|||||||
NS_DEFINE_NAMED_CID(NS_XPC_JSCONTEXT_STACK_ITERATOR_CID);
|
NS_DEFINE_NAMED_CID(NS_XPC_JSCONTEXT_STACK_ITERATOR_CID);
|
||||||
NS_DEFINE_NAMED_CID(MOZJSCOMPONENTLOADER_CID);
|
NS_DEFINE_NAMED_CID(MOZJSCOMPONENTLOADER_CID);
|
||||||
NS_DEFINE_NAMED_CID(MOZ_JSSUBSCRIPTLOADER_CID);
|
NS_DEFINE_NAMED_CID(MOZ_JSSUBSCRIPTLOADER_CID);
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
NS_DEFINE_NAMED_CID(NS_IDISPATCH_SUPPORT_CID);
|
|
||||||
#define XPCIDISPATCH_CIDS \
|
|
||||||
{ &kNS_IDISPATCH_SUPPORT_CID, false, NULL, nsIDispatchSupportConstructor },
|
|
||||||
#define XPCIDISPATCH_CONTRACTS \
|
|
||||||
{ NS_IDISPATCH_SUPPORT_CONTRACTID, &kNS_IDISPATCH_SUPPORT_CID },
|
|
||||||
#else
|
|
||||||
#define XPCIDISPATCH_CIDS
|
|
||||||
#define XPCIDISPATCH_CONTRACTS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define XPCONNECT_CIDENTRIES \
|
#define XPCONNECT_CIDENTRIES \
|
||||||
{ &kNS_JS_ID_CID, false, NULL, nsJSIDConstructor }, \
|
{ &kNS_JS_ID_CID, false, NULL, nsJSIDConstructor }, \
|
||||||
@ -99,8 +84,7 @@ NS_DEFINE_NAMED_CID(NS_IDISPATCH_SUPPORT_CID);
|
|||||||
{ &kSCRIPTABLE_INTERFACES_CID, false, NULL, nsXPCComponents_InterfacesConstructor }, \
|
{ &kSCRIPTABLE_INTERFACES_CID, false, NULL, nsXPCComponents_InterfacesConstructor }, \
|
||||||
{ &kNS_XPC_JSCONTEXT_STACK_ITERATOR_CID, false, NULL, nsXPCJSContextStackIteratorConstructor }, \
|
{ &kNS_XPC_JSCONTEXT_STACK_ITERATOR_CID, false, NULL, nsXPCJSContextStackIteratorConstructor }, \
|
||||||
{ &kMOZJSCOMPONENTLOADER_CID, false, NULL, mozJSComponentLoaderConstructor }, \
|
{ &kMOZJSCOMPONENTLOADER_CID, false, NULL, mozJSComponentLoaderConstructor }, \
|
||||||
{ &kMOZ_JSSUBSCRIPTLOADER_CID, false, NULL, mozJSSubScriptLoaderConstructor }, \
|
{ &kMOZ_JSSUBSCRIPTLOADER_CID, false, NULL, mozJSSubScriptLoaderConstructor },
|
||||||
XPCIDISPATCH_CIDS
|
|
||||||
|
|
||||||
#define XPCONNECT_CONTRACTS \
|
#define XPCONNECT_CONTRACTS \
|
||||||
{ XPC_ID_CONTRACTID, &kNS_JS_ID_CID }, \
|
{ XPC_ID_CONTRACTID, &kNS_JS_ID_CID }, \
|
||||||
@ -112,8 +96,7 @@ NS_DEFINE_NAMED_CID(NS_IDISPATCH_SUPPORT_CID);
|
|||||||
{ NS_SCRIPTABLE_INTERFACES_CONTRACTID, &kSCRIPTABLE_INTERFACES_CID }, \
|
{ NS_SCRIPTABLE_INTERFACES_CONTRACTID, &kSCRIPTABLE_INTERFACES_CID }, \
|
||||||
{ XPC_JSCONTEXT_STACK_ITERATOR_CONTRACTID, &kNS_XPC_JSCONTEXT_STACK_ITERATOR_CID }, \
|
{ XPC_JSCONTEXT_STACK_ITERATOR_CONTRACTID, &kNS_XPC_JSCONTEXT_STACK_ITERATOR_CID }, \
|
||||||
{ MOZJSCOMPONENTLOADER_CONTRACTID, &kMOZJSCOMPONENTLOADER_CID }, \
|
{ MOZJSCOMPONENTLOADER_CONTRACTID, &kMOZJSCOMPONENTLOADER_CID }, \
|
||||||
{ MOZJSSUBSCRIPTLOADER_CONTRACTID, &kMOZ_JSSUBSCRIPTLOADER_CID }, \
|
{ MOZJSSUBSCRIPTLOADER_CONTRACTID, &kMOZ_JSSUBSCRIPTLOADER_CID },
|
||||||
XPCIDISPATCH_CONTRACTS
|
|
||||||
|
|
||||||
#define XPCONNECT_CATEGORIES \
|
#define XPCONNECT_CATEGORIES \
|
||||||
{ "module-loader", "js", MOZJSCOMPONENTLOADER_CONTRACTID },
|
{ "module-loader", "js", MOZJSCOMPONENTLOADER_CONTRACTID },
|
||||||
|
@ -130,13 +130,6 @@
|
|||||||
|
|
||||||
#include "nsIThreadInternal.h"
|
#include "nsIThreadInternal.h"
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// This goop was added because of EXCEPINFO in ThrowCOMError
|
|
||||||
// This include is here, because it needs to occur before the undefines below
|
|
||||||
#include <atlbase.h>
|
|
||||||
#include "oaidl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
// Nasty MS defines
|
// Nasty MS defines
|
||||||
#ifdef GetClassInfo
|
#ifdef GetClassInfo
|
||||||
@ -585,10 +578,6 @@ public:
|
|||||||
return gReportAllJSExceptions > 0;
|
return gReportAllJSExceptions > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
public:
|
|
||||||
static PRBool IsIDispatchEnabled();
|
|
||||||
#endif
|
|
||||||
protected:
|
protected:
|
||||||
nsXPConnect();
|
nsXPConnect();
|
||||||
|
|
||||||
@ -1112,15 +1101,6 @@ public:
|
|||||||
XPCReadableJSStringWrapper *NewStringWrapper(const PRUnichar *str, PRUint32 len);
|
XPCReadableJSStringWrapper *NewStringWrapper(const PRUnichar *str, PRUint32 len);
|
||||||
void DeleteString(nsAString *string);
|
void DeleteString(nsAString *string);
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
/**
|
|
||||||
* Sets the IDispatch information for the context
|
|
||||||
* This has to be void* because of icky Microsoft macros that
|
|
||||||
* would be introduced if we included the DispatchInterface header
|
|
||||||
*/
|
|
||||||
void SetIDispatchInfo(XPCNativeInterface* iface, void * member);
|
|
||||||
void* GetIDispatchMember() const { return mIDispatchMember; }
|
|
||||||
#endif
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// no copy ctor or assignment allowed
|
// no copy ctor or assignment allowed
|
||||||
@ -1209,9 +1189,6 @@ private:
|
|||||||
jsval* mRetVal;
|
jsval* mRetVal;
|
||||||
|
|
||||||
JSBool mReturnValueWasSet;
|
JSBool mReturnValueWasSet;
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
void* mIDispatchMember;
|
|
||||||
#endif
|
|
||||||
PRUint16 mMethodIndex;
|
PRUint16 mMethodIndex;
|
||||||
|
|
||||||
#define XPCCCX_STRING_CACHE_SIZE 2
|
#define XPCCCX_STRING_CACHE_SIZE 2
|
||||||
@ -2362,16 +2339,6 @@ public:
|
|||||||
void Unmark() {mJSObject = (JSObject*)(((jsword)mJSObject) & ~1);}
|
void Unmark() {mJSObject = (JSObject*)(((jsword)mJSObject) & ~1);}
|
||||||
JSBool IsMarked() const {return (JSBool)(((jsword)mJSObject) & 1);}
|
JSBool IsMarked() const {return (JSBool)(((jsword)mJSObject) & 1);}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
enum JSObject_flags
|
|
||||||
{
|
|
||||||
IDISPATCH_BIT = 2,
|
|
||||||
JSOBJECT_MASK = 3
|
|
||||||
};
|
|
||||||
void SetIDispatch(JSContext* cx);
|
|
||||||
JSBool IsIDispatch() const;
|
|
||||||
XPCDispInterface* GetIDispatchInfo() const;
|
|
||||||
#endif
|
|
||||||
private:
|
private:
|
||||||
XPCWrappedNativeTearOff(const XPCWrappedNativeTearOff& r); // not implemented
|
XPCWrappedNativeTearOff(const XPCWrappedNativeTearOff& r); // not implemented
|
||||||
XPCWrappedNativeTearOff& operator= (const XPCWrappedNativeTearOff& r); // not implemented
|
XPCWrappedNativeTearOff& operator= (const XPCWrappedNativeTearOff& r); // not implemented
|
||||||
@ -3363,11 +3330,6 @@ public:
|
|||||||
static void Throw(nsresult rv, XPCCallContext& ccx);
|
static void Throw(nsresult rv, XPCCallContext& ccx);
|
||||||
static void ThrowBadResult(nsresult rv, nsresult result, XPCCallContext& ccx);
|
static void ThrowBadResult(nsresult rv, nsresult result, XPCCallContext& ccx);
|
||||||
static void ThrowBadParam(nsresult rv, uintN paramNum, XPCCallContext& ccx);
|
static void ThrowBadParam(nsresult rv, uintN paramNum, XPCCallContext& ccx);
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
static void ThrowCOMError(JSContext* cx, unsigned long COMErrorCode,
|
|
||||||
nsresult rv = NS_ERROR_XPC_COM_ERROR,
|
|
||||||
const EXCEPINFO * exception = nsnull);
|
|
||||||
#endif
|
|
||||||
static JSBool SetVerbosity(JSBool state)
|
static JSBool SetVerbosity(JSBool state)
|
||||||
{JSBool old = sVerbose; sVerbose = state; return old;}
|
{JSBool old = sVerbose; sVerbose = state; return old;}
|
||||||
|
|
||||||
@ -4504,11 +4466,6 @@ ParticipatesInCycleCollection(JSContext *cx, js::gc::Cell *cell)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// IDispatch specific classes
|
|
||||||
#include "XPCDispPrivate.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
// Inlines use the above - include last.
|
// Inlines use the above - include last.
|
||||||
|
|
||||||
|
@ -179,25 +179,8 @@ XPCThrower::Verbosify(XPCCallContext& ccx,
|
|||||||
if(ccx.HasInterfaceAndMember())
|
if(ccx.HasInterfaceAndMember())
|
||||||
{
|
{
|
||||||
XPCNativeInterface* iface = ccx.GetInterface();
|
XPCNativeInterface* iface = ccx.GetInterface();
|
||||||
jsid id = JSID_VOID;
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
NS_ASSERTION(ccx.GetIDispatchMember() == nsnull ||
|
|
||||||
ccx.GetMember() == nsnull,
|
|
||||||
"Both IDispatch member and regular XPCOM member "
|
|
||||||
"were set in XPCCallContext");
|
|
||||||
if(ccx.GetIDispatchMember())
|
|
||||||
{
|
{
|
||||||
XPCDispInterface::Member * member =
|
jsid id = ccx.GetMember()->GetName();
|
||||||
reinterpret_cast<XPCDispInterface::Member*>(ccx.GetIDispatchMember());
|
|
||||||
if(member && JSID_IS_STRING(member->GetName()))
|
|
||||||
{
|
|
||||||
id = member->GetName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
id = ccx.GetMember()->GetName();
|
|
||||||
}
|
}
|
||||||
JSAutoByteString bytes;
|
JSAutoByteString bytes;
|
||||||
const char *name = JSID_IS_VOID(id) ? "Unknown" : bytes.encode(ccx, JSID_TO_STRING(id));
|
const char *name = JSID_IS_VOID(id) ? "Unknown" : bytes.encode(ccx, JSID_TO_STRING(id));
|
||||||
@ -339,60 +322,3 @@ XPCThrower::ThrowExceptionObject(JSContext* cx, nsIException* e)
|
|||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// static
|
|
||||||
void
|
|
||||||
XPCThrower::ThrowCOMError(JSContext* cx, unsigned long COMErrorCode,
|
|
||||||
nsresult rv, const EXCEPINFO * exception)
|
|
||||||
{
|
|
||||||
nsCAutoString msg;
|
|
||||||
IErrorInfo * pError;
|
|
||||||
const char * format;
|
|
||||||
if(!nsXPCException::NameAndFormatForNSResult(rv, nsnull, &format))
|
|
||||||
format = "";
|
|
||||||
msg = format;
|
|
||||||
if(exception)
|
|
||||||
{
|
|
||||||
msg += static_cast<const char *>
|
|
||||||
(_bstr_t(exception->bstrSource, false));
|
|
||||||
msg += " : ";
|
|
||||||
msg.AppendInt(static_cast<PRUint32>(COMErrorCode));
|
|
||||||
msg += " - ";
|
|
||||||
msg += static_cast<const char *>
|
|
||||||
(_bstr_t(exception->bstrDescription, false));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Get the current COM error object
|
|
||||||
unsigned long result = GetErrorInfo(0, &pError);
|
|
||||||
if(SUCCEEDED(result) && pError)
|
|
||||||
{
|
|
||||||
// Build an error message from the COM error object
|
|
||||||
BSTR bstrSource = NULL;
|
|
||||||
if(SUCCEEDED(pError->GetSource(&bstrSource)) && bstrSource)
|
|
||||||
{
|
|
||||||
_bstr_t src(bstrSource, false);
|
|
||||||
msg += static_cast<const char *>(src);
|
|
||||||
msg += " : ";
|
|
||||||
}
|
|
||||||
msg.AppendInt(static_cast<PRUint32>(COMErrorCode), 16);
|
|
||||||
BSTR bstrDesc = NULL;
|
|
||||||
if(SUCCEEDED(pError->GetDescription(&bstrDesc)) && bstrDesc)
|
|
||||||
{
|
|
||||||
msg += " - ";
|
|
||||||
_bstr_t desc(bstrDesc, false);
|
|
||||||
msg += static_cast<const char *>(desc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// No error object, so just report the result
|
|
||||||
msg += "COM Error Result = ";
|
|
||||||
msg.AppendInt(static_cast<PRUint32>(COMErrorCode), 16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XPCThrower::BuildAndThrowException(cx, rv, msg.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -661,13 +661,6 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// If IDispatch is enabled and we're QI'ing to IDispatch
|
|
||||||
if(nsXPConnect::IsIDispatchEnabled() && aIID.Equals(NSID_IDISPATCH))
|
|
||||||
{
|
|
||||||
return XPCIDispatchExtension::IDispatchQIWrappedJS(self, aInstancePtr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if(aIID.Equals(NS_GET_IID(nsIPropertyBag)))
|
if(aIID.Equals(NS_GET_IID(nsIPropertyBag)))
|
||||||
{
|
{
|
||||||
// We only want to expose one implementation from our aggregate.
|
// We only want to expose one implementation from our aggregate.
|
||||||
|
@ -356,20 +356,7 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx,
|
|||||||
NS_ASSERTION(!Scope->GetRuntime()->GetThreadRunningGC(),
|
NS_ASSERTION(!Scope->GetRuntime()->GetThreadRunningGC(),
|
||||||
"XPCWrappedNative::GetNewOrUsed called during GC");
|
"XPCWrappedNative::GetNewOrUsed called during GC");
|
||||||
|
|
||||||
nsISupports *identity;
|
nsISupports *identity = helper.GetCanonical();
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// XXX This is done for the benefit of some warped COM implementations
|
|
||||||
// where QI(IID_IUnknown, a.b) == QI(IID_IUnknown, a). If someone passes
|
|
||||||
// in a pointer that hasn't been QI'd to IDispatch properly this could
|
|
||||||
// create multiple wrappers for the same object, creating a fair bit of
|
|
||||||
// confusion.
|
|
||||||
PRBool isIDispatch = Interface &&
|
|
||||||
Interface->GetIID()->Equals(NSID_IDISPATCH);
|
|
||||||
if(isIDispatch)
|
|
||||||
identity = helper.Object();
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
identity = helper.GetCanonical();
|
|
||||||
|
|
||||||
if(!identity)
|
if(!identity)
|
||||||
{
|
{
|
||||||
@ -435,18 +422,6 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx,
|
|||||||
|
|
||||||
nsIClassInfo *info = helper.GetClassInfo();
|
nsIClassInfo *info = helper.GetClassInfo();
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// If this is an IDispatch wrapper and it didn't give us a class info
|
|
||||||
// we'll provide a default one
|
|
||||||
nsCOMPtr<nsIClassInfo> dispatchInfo;
|
|
||||||
if(isIDispatch && !info)
|
|
||||||
{
|
|
||||||
dispatchInfo = dont_AddRef(static_cast<nsIClassInfo*>
|
|
||||||
(XPCIDispatchClassInfo::GetSingleton()));
|
|
||||||
info = dispatchInfo;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XPCNativeScriptableCreateInfo sciProto;
|
XPCNativeScriptableCreateInfo sciProto;
|
||||||
XPCNativeScriptableCreateInfo sci;
|
XPCNativeScriptableCreateInfo sci;
|
||||||
|
|
||||||
@ -845,14 +820,7 @@ XPCWrappedNative::GetUsedOnly(XPCCallContext& ccx,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsISupports> identity;
|
nsCOMPtr<nsISupports> identity = do_QueryInterface(Object);
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// XXX See GetNewOrUsed for more info on this
|
|
||||||
if(Interface->GetIID()->Equals(NSID_IDISPATCH))
|
|
||||||
identity = Object;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
identity = do_QueryInterface(Object);
|
|
||||||
|
|
||||||
if(!identity)
|
if(!identity)
|
||||||
{
|
{
|
||||||
@ -1466,10 +1434,6 @@ XPCWrappedNative::SystemIsBeingShutDown(JSContext* cx)
|
|||||||
if(to->GetJSObject())
|
if(to->GetJSObject())
|
||||||
{
|
{
|
||||||
JS_SetPrivate(cx, to->GetJSObject(), nsnull);
|
JS_SetPrivate(cx, to->GetJSObject(), nsnull);
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
if(to->IsIDispatch())
|
|
||||||
delete to->GetIDispatchInfo();
|
|
||||||
#endif
|
|
||||||
to->SetJSObject(nsnull);
|
to->SetJSObject(nsnull);
|
||||||
}
|
}
|
||||||
// We leak the tearoff mNative
|
// We leak the tearoff mNative
|
||||||
@ -2174,13 +2138,6 @@ XPCWrappedNative::InitTearOff(XPCCallContext& ccx,
|
|||||||
|
|
||||||
aTearOff->SetInterface(aInterface);
|
aTearOff->SetInterface(aInterface);
|
||||||
aTearOff->SetNative(obj);
|
aTearOff->SetNative(obj);
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// Are we building a tearoff for IDispatch?
|
|
||||||
if(iid->Equals(NSID_IDISPATCH))
|
|
||||||
{
|
|
||||||
aTearOff->SetIDispatch(ccx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if(needJSObject && !InitTearOffJSObject(ccx, aTearOff))
|
if(needJSObject && !InitTearOffJSObject(ccx, aTearOff))
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
@ -406,14 +406,6 @@ DefinePropertyIfFound(XPCCallContext& ccx,
|
|||||||
nsnull, propFlags);
|
nsnull, propFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
// Check to see if there's an IDispatch tearoff
|
|
||||||
if(wrapperToReflectInterfaceNames &&
|
|
||||||
XPCIDispatchExtension::DefineProperty(ccx, obj,
|
|
||||||
id, wrapperToReflectInterfaceNames, propFlags, resolved))
|
|
||||||
return JS_TRUE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(resolved)
|
if(resolved)
|
||||||
*resolved = JS_FALSE;
|
*resolved = JS_FALSE;
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
@ -634,13 +626,6 @@ XPC_WN_Shared_Enumerate(JSContext *cx, JSObject *obj)
|
|||||||
for(PRUint16 i = 0; i < interface_count; i++)
|
for(PRUint16 i = 0; i < interface_count; i++)
|
||||||
{
|
{
|
||||||
XPCNativeInterface* iface = interfaceArray[i];
|
XPCNativeInterface* iface = interfaceArray[i];
|
||||||
#ifdef XPC_IDISPATCH_SUPPORT
|
|
||||||
if(iface->GetIID()->Equals(NSID_IDISPATCH))
|
|
||||||
{
|
|
||||||
XPCIDispatchExtension::Enumerate(ccx, obj, wrapper);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
PRUint16 member_count = iface->GetMemberCount();
|
PRUint16 member_count = iface->GetMemberCount();
|
||||||
for(PRUint16 k = 0; k < member_count; k++)
|
for(PRUint16 k = 0; k < member_count; k++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user