本文整理汇总了C++中nsIID::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ nsIID::ToString方法的具体用法?C++ nsIID::ToString怎么用?C++ nsIID::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsIID
的用法示例。
在下文中一共展示了nsIID::ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
nsresult
JavaToXPTCStubMap::Find(jint aJavaObjectHashCode, const nsIID& aIID,
nsJavaXPTCStub** aResult)
{
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (!aResult)
return NS_ERROR_FAILURE;
nsAutoLock lock(gJavaXPCOMLock);
*aResult = nsnull;
Entry* e = static_cast<Entry*>
(PL_DHashTableOperate(mHashTable,
NS_INT32_TO_PTR(aJavaObjectHashCode),
PL_DHASH_LOOKUP));
if (PL_DHASH_ENTRY_IS_FREE(e))
return NS_OK;
nsresult rv = e->xptcstub->QueryInterface(aIID, (void**) aResult);
#ifdef DEBUG_JAVAXPCOM
if (NS_SUCCEEDED(rv)) {
char* iid_str = aIID.ToString();
LOG(("< JavaToXPTCStubMap (Java=%08x | XPCOM=%08x | IID=%s)\n",
(PRUint32) aJavaObjectHashCode, (PRUint32) *aResult, iid_str));
PR_Free(iid_str);
}
#endif
// NS_NOINTERFACE is not an error condition
if (rv == NS_NOINTERFACE)
rv = NS_OK;
return rv;
}
示例2: TestISupportsIID
/* void testISupports2 ([iid_is (iid)] in ITestErlXPCOMComponent obj, in nsIIDRef iid); */
NS_IMETHODIMP TestErlXPCOMComponent::TestISupportsIID(ITestErlXPCOMComponent *obj, const nsIID & iid)
{
char *iidstr = iid.ToString();
std::cout << "Hola desde TestErlXPCOMComponent::TestISupports2("<< iidstr <<")\n";
PR_Free(iidstr);
return NS_OK;
}
示例3: while
nsresult
NativeToJavaProxyMap::Remove(JNIEnv* env, nsISupports* aNativeObject,
const nsIID& aIID)
{
// This is only called from finalizeProxy(), which already holds the lock.
// nsAutoLock lock(gJavaXPCOMLock);
Entry* e = static_cast<Entry*>(PL_DHashTableOperate(mHashTable,
aNativeObject,
PL_DHASH_LOOKUP));
if (PL_DHASH_ENTRY_IS_FREE(e)) {
NS_WARNING("XPCOM object not found in hash table");
return NS_ERROR_FAILURE;
}
ProxyList* item = e->list;
ProxyList* last = e->list;
while (item != nsnull) {
if (item->iid.Equals(aIID)) {
#ifdef DEBUG_JAVAXPCOM
char* iid_str = aIID.ToString();
LOG(("- NativeToJavaProxyMap (Java=%08x | XPCOM=%08x | IID=%s)\n",
(PRUint32) env->CallStaticIntMethod(systemClass, hashCodeMID,
item->javaObject),
(PRUint32) aNativeObject, iid_str));
NS_Free(iid_str);
#endif
env->CallVoidMethod(item->javaObject, clearReferentMID);
env->DeleteGlobalRef(item->javaObject);
if (item == e->list) {
e->list = item->next;
if (e->list == nsnull)
PL_DHashTableOperate(mHashTable, aNativeObject, PL_DHASH_REMOVE);
} else {
last->next = item->next;
}
delete item;
return NS_OK;
}
last = item;
item = item->next;
}
NS_WARNING("Java proxy matching given IID not found");
return NS_ERROR_FAILURE;
}