本文整理汇总了C++中NS_IF_ADDREF函数的典型用法代码示例。如果您正苦于以下问题:C++ NS_IF_ADDREF函数的具体用法?C++ NS_IF_ADDREF怎么用?C++ NS_IF_ADDREF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NS_IF_ADDREF函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: NS_IF_ADDREF
void
nsHttpTransaction::GetSecurityCallbacks(nsIInterfaceRequestor **cb)
{
NS_IF_ADDREF(*cb = mCallbacks);
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:5,代码来源:nsHttpTransaction.cpp
示例2: NS_IF_ADDREF
NS_IMETHODIMP
nsBaseChannel::GetSecurityInfo(nsISupports **aSecurityInfo)
{
NS_IF_ADDREF(*aSecurityInfo = mSecurityInfo);
return NS_OK;
}
开发者ID:bkotzz,项目名称:gecko-dev,代码行数:6,代码来源:nsBaseChannel.cpp
示例3: NS_IF_ADDREF
/* readonly attribute nsIPerformanceStats process; */
NS_IMETHODIMP nsPerformanceSnapshot::GetProcessData(nsIPerformanceStats * *aProcess)
{
NS_IF_ADDREF(*aProcess = mProcessData);
return NS_OK;
}
开发者ID:nafis-sadik,项目名称:gecko-dev,代码行数:6,代码来源:nsPerformanceStats.cpp
示例4: NS_IF_ADDREF
NS_IMETHODIMP nsExtProtocolChannel::GetLoadInfo(nsILoadInfo **aLoadInfo)
{
NS_IF_ADDREF(*aLoadInfo = mLoadInfo);
return NS_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:5,代码来源:nsExternalProtocolHandler.cpp
示例5: getter_AddRefs
nsresult nsMsgQuickSearchDBView::GetFirstMessageHdrToDisplayInThread(nsIMsgThread *threadHdr, nsIMsgDBHdr **result)
{
uint32_t numChildren;
nsresult rv = NS_OK;
uint8_t minLevel = 0xff;
threadHdr->GetNumChildren(&numChildren);
nsMsgKey threadRootKey;
nsCOMPtr<nsIMsgDBHdr> rootParent;
int32_t rootIndex;
threadHdr->GetRootHdr(&rootIndex, getter_AddRefs(rootParent));
if (rootParent)
rootParent->GetMessageKey(&threadRootKey);
else
threadHdr->GetThreadKey(&threadRootKey);
if ((int32_t) numChildren < 0)
numChildren = 0;
nsCOMPtr <nsIMsgDBHdr> retHdr;
// iterate over thread, finding mgsHdr in view with the lowest level.
for (uint32_t childIndex = 0; childIndex < numChildren; childIndex++)
{
nsCOMPtr <nsIMsgDBHdr> child;
rv = threadHdr->GetChildHdrAt(childIndex, getter_AddRefs(child));
if (NS_SUCCEEDED(rv) && child)
{
nsMsgKey msgKey;
child->GetMessageKey(&msgKey);
// this works because we've already sorted m_keys by id.
nsMsgViewIndex keyIndex = m_origKeys.BinaryIndexOf(msgKey);
if (keyIndex != nsMsgViewIndex_None)
{
// this is the root, so it's the best we're going to do.
if (msgKey == threadRootKey)
{
retHdr = child;
break;
}
uint8_t level = 0;
nsMsgKey parentId;
child->GetThreadParent(&parentId);
nsCOMPtr <nsIMsgDBHdr> parent;
// count number of ancestors - that's our level
while (parentId != nsMsgKey_None)
{
rv = m_db->GetMsgHdrForKey(parentId, getter_AddRefs(parent));
if (parent)
{
nsMsgKey saveParentId = parentId;
parent->GetThreadParent(&parentId);
// message is it's own parent - bad, let's break out of here.
// Or we've got some circular ancestry.
if (parentId == saveParentId || level > numChildren)
break;
level++;
}
else // if we can't find the parent, don't loop forever.
break;
}
if (level < minLevel)
{
minLevel = level;
retHdr = child;
}
}
}
}
NS_IF_ADDREF(*result = retHdr);
return NS_OK;
}
开发者ID:hsinyi,项目名称:releases-comm-central,代码行数:72,代码来源:nsMsgQuickSearchDBView.cpp
示例6: NS_ENSURE_ARG_POINTER
nsresult nsEudoraEditor::GetEmbeddedObjects(nsIArray ** aNodeList)
{
NS_ENSURE_ARG_POINTER(aNodeList);
// Check to see if we were already called
if (m_EmbeddedObjectList != nullptr)
{
*aNodeList = m_EmbeddedObjectList;
return NS_OK;
}
// Create array in m_EmbeddedObjectList
nsresult rv;
m_EmbeddedObjectList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// Return m_EmbeddedObjectList in aNodeList and increment ref count - caller
// assumes that we incremented the ref count.
NS_IF_ADDREF(*aNodeList = m_EmbeddedObjectList);
// Create the embedded folder spec
nsCOMPtr<nsIFile> embeddedFolderSpec;
// Create the embedded image spec
nsCOMPtr<nsIFile> embeddedImageSpec;
// Fill in the details for the embedded folder spec - "Embedded" folder
// inside of the mail folder. We don't bother to check to see if the embedded
// folder exists, because it seems to me that would only save time in the
// unexpected case where it doesn't exist. Keep in mind that we will be checking
// for the existence of any embedded images anyway - if the folder doesn't
// exist that check will fail.
rv = m_pMailImportLocation->Clone(getter_AddRefs(embeddedFolderSpec));
NS_ENSURE_SUCCESS(rv, rv);
embeddedFolderSpec->AppendNative(NS_LITERAL_CSTRING("Embedded"));
// Look for the start of the last closing tag so that we only search for
// valid "Embedded Content" lines. (In practice this is not super important,
// but there were some proof of concept exploits at one point where "Embedded
// Content" lines were faked in the body of messages).
int32_t startLastClosingTag = m_body.RFind("</");
if (startLastClosingTag == kNotFound)
startLastClosingTag = 0;
bool foundEmbeddedContentLines = false;
// Search for various translations of "Embedded Content" - as of this writing only
// one that I know of, but then again I didn't realize that Eudora translators had
// ever translated "Attachment Converted" as suggested by other Eudora importing code.
for (int32_t i = 0; *sEudoraEmbeddedContentLines[i] != '\0'; i++)
{
// Search for "Embedded Content: " lines starting after last closing tag (if any)
int32_t startEmbeddedContentLine = startLastClosingTag;
int32_t lenEmbeddedContentTag = strlen(sEudoraEmbeddedContentLines[i]);
while ((startEmbeddedContentLine = m_body.Find(sEudoraEmbeddedContentLines[i],
true,
startEmbeddedContentLine+1)) != kNotFound)
{
// Found this translation of "Embedded Content" - remember that so that we don't
// bother looking for any other translations.
foundEmbeddedContentLines = true;
// Extract the file name from the embedded content line
int32_t startFileName = startEmbeddedContentLine + lenEmbeddedContentTag;
int32_t endFileName = m_body.Find(":", false, startFileName);
// Create the file spec for the embedded image
embeddedFolderSpec->Clone(getter_AddRefs(embeddedImageSpec));
embeddedImageSpec->Append(Substring(m_body, startFileName, endFileName - startFileName));
// Verify that the embedded image spec exists and is a file
bool isFile = false;
bool exists = false;
if (NS_FAILED(embeddedImageSpec->Exists(&exists)) || NS_FAILED(embeddedImageSpec->IsFile(&isFile)))
continue;
if (!exists || !isFile)
continue;
// Extract CID hash from the embedded content line
int32_t cidHashValue;
int32_t startCIDHash = m_body.Find(",", false, endFileName);
if (startCIDHash != kNotFound)
{
startCIDHash++;
int32_t endCIDHash = m_body.Find(",", false, startCIDHash);
if (endCIDHash != kNotFound)
{
nsString cidHash;
cidHash.Assign(Substring(m_body, startCIDHash, endCIDHash - startCIDHash));
if (!cidHash.IsEmpty())
{
// Convert CID hash string to numeric value
nsresult aErrorCode;
cidHashValue = cidHash.ToInteger(&aErrorCode, 16);
}
}
}
// Get the URL for the embedded image
//.........这里部分代码省略.........
开发者ID:MoonchildProductions,项目名称:FossaMail,代码行数:101,代码来源:nsEudoraEditor.cpp
示例7: NS_IF_ADDREF
/* attribute nsILocalHandlerApp app; */
NS_IMETHODIMP JumpListShortcut::GetApp(nsILocalHandlerApp **aApp)
{
NS_IF_ADDREF(*aApp = mHandlerApp);
return NS_OK;
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:7,代码来源:JumpListItem.cpp
示例8: defined
nsresult
nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal)
{
// Copied from nsAppFileLocationProvider (more or less)
nsresult rv;
nsCOMPtr<nsIFile> localDir;
#if defined(XP_MACOSX)
FSRef fsRef;
OSType folderType;
if (aLocal) {
folderType = kCachedDataFolderType;
} else {
#ifdef MOZ_THUNDERBIRD
folderType = kDomainLibraryFolderType;
#else
folderType = kApplicationSupportFolderType;
#endif
}
OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef);
NS_ENSURE_FALSE(err, NS_ERROR_FAILURE);
rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(localDir));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILocalFileMac> dirFileMac = do_QueryInterface(localDir);
NS_ENSURE_TRUE(dirFileMac, NS_ERROR_UNEXPECTED);
rv = dirFileMac->InitWithFSRef(&fsRef);
NS_ENSURE_SUCCESS(rv, rv);
localDir = do_QueryInterface(dirFileMac, &rv);
#elif defined(XP_WIN)
nsString path;
if (aLocal) {
rv = GetShellFolderPath(CSIDL_LOCAL_APPDATA, path);
if (NS_FAILED(rv))
rv = GetRegWindowsAppDataFolder(aLocal, path);
}
if (!aLocal || NS_FAILED(rv)) {
rv = GetShellFolderPath(CSIDL_APPDATA, path);
if (NS_FAILED(rv)) {
if (!aLocal)
rv = GetRegWindowsAppDataFolder(aLocal, path);
}
}
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
#elif defined(MOZ_WIDGET_GONK)
rv = NS_NewNativeLocalFile(NS_LITERAL_CSTRING("/data/b2g"), true,
getter_AddRefs(localDir));
#elif defined(XP_UNIX)
const char* homeDir = getenv("HOME");
if (!homeDir || !*homeDir)
return NS_ERROR_FAILURE;
#ifdef ANDROID /* We want (ProfD == ProfLD) on Android. */
aLocal = false;
#endif
if (aLocal) {
// If $XDG_CACHE_HOME is defined use it, otherwise use $HOME/.cache.
const char* cacheHome = getenv("XDG_CACHE_HOME");
if (cacheHome && *cacheHome) {
rv = NS_NewNativeLocalFile(nsDependentCString(cacheHome), true,
getter_AddRefs(localDir));
} else {
rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
getter_AddRefs(localDir));
if (NS_SUCCEEDED(rv))
rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache"));
}
} else {
rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
getter_AddRefs(localDir));
}
#else
#error "Don't know how to get product dir on your platform"
#endif
NS_IF_ADDREF(*aFile = localDir);
return rv;
}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:84,代码来源:nsXREDirProvider.cpp
示例9: NS_IF_ADDREF
NS_IMETHODIMP nsTreeSelection::GetTree(nsITreeBoxObject * *aTree)
{
NS_IF_ADDREF(mTree);
*aTree = mTree;
return NS_OK;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:6,代码来源:nsTreeSelection.cpp
示例10: do_QueryInterface
//.........这里部分代码省略.........
if (!nsContentUtils::GetNodeTextContent(queryContent, false, sqlQuery, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult rv = mStorageConnection->CreateStatement(NS_ConvertUTF16toUTF8(sqlQuery),
getter_AddRefs(statement));
if (NS_FAILED(rv)) {
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_STORAGE_BAD_QUERY);
return rv;
}
uint32_t parameterCount = 0;
for (nsIContent* child = queryContent->GetFirstChild();
child;
child = child->GetNextSibling()) {
if (child->NodeInfo()->Equals(nsGkAtoms::param, kNameSpaceID_XUL)) {
nsAutoString value;
if (!nsContentUtils::GetNodeTextContent(child, false, value, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
uint32_t index = parameterCount;
nsAutoString name, indexValue;
if (child->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name)) {
rv = statement->GetParameterIndex(NS_ConvertUTF16toUTF8(name),
&index);
if (NS_FAILED(rv)) {
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_STORAGE_UNKNOWN_QUERY_PARAMETER);
return rv;
}
parameterCount++;
}
else if (child->GetAttr(kNameSpaceID_None, nsGkAtoms::index, indexValue)) {
PR_sscanf(NS_ConvertUTF16toUTF8(indexValue).get(),"%d",&index);
if (index > 0)
index--;
}
else {
parameterCount++;
}
static nsIContent::AttrValuesArray sTypeValues[] =
{ &nsGkAtoms::int32, &nsGkAtoms::integer, &nsGkAtoms::int64,
&nsGkAtoms::null, &nsGkAtoms::double_, &nsGkAtoms::string, nullptr };
int32_t typeError = 1;
int32_t typeValue = child->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
sTypeValues, eCaseMatters);
rv = NS_ERROR_ILLEGAL_VALUE;
int32_t valInt32 = 0;
int64_t valInt64 = 0;
double valFloat = 0;
switch (typeValue) {
case 0:
case 1:
typeError = PR_sscanf(NS_ConvertUTF16toUTF8(value).get(),"%d",&valInt32);
if (typeError > 0)
rv = statement->BindInt32ByIndex(index, valInt32);
break;
case 2:
typeError = PR_sscanf(NS_ConvertUTF16toUTF8(value).get(),"%lld",&valInt64);
if (typeError > 0)
rv = statement->BindInt64ByIndex(index, valInt64);
break;
case 3:
rv = statement->BindNullByIndex(index);
break;
case 4:
typeError = PR_sscanf(NS_ConvertUTF16toUTF8(value).get(),"%lf",&valFloat);
if (typeError > 0)
rv = statement->BindDoubleByIndex(index, valFloat);
break;
case 5:
case nsIContent::ATTR_MISSING:
rv = statement->BindStringByIndex(index, value);
break;
default:
typeError = 0;
}
if (typeError <= 0) {
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_STORAGE_WRONG_TYPE_QUERY_PARAMETER);
return rv;
}
if (NS_FAILED(rv)) {
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_STORAGE_QUERY_PARAMETER_NOT_BOUND);
return rv;
}
}
}
*aReturn = statement;
NS_IF_ADDREF(*aReturn);
return NS_OK;
}
开发者ID:Jar-win,项目名称:Waterfox,代码行数:101,代码来源:nsXULTemplateQueryProcessorStorage.cpp
示例11: do_CreateInstance
NS_IMETHODIMP
nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
{
if (!mProfiles) {
nsresult rv;
mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
nsCOMPtr<nsILocalFile> file;
#ifdef XP_WIN
fileLocator->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
// Opera profile lives under %APP_DATA%\Opera\<operaver>\profile
file->Append(OPERA_PREFERENCES_FOLDER_NAME);
nsCOMPtr<nsISimpleEnumerator> e;
rv = file->GetDirectoryEntries(getter_AddRefs(e));
if (NS_FAILED(rv))
return rv;
PRBool hasMore;
e->HasMoreElements(&hasMore);
while (hasMore) {
nsCOMPtr<nsILocalFile> curr;
e->GetNext(getter_AddRefs(curr));
PRBool isDirectory = PR_FALSE;
curr->IsDirectory(&isDirectory);
if (isDirectory) {
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
nsAutoString leafName;
curr->GetLeafName(leafName);
string->SetData(leafName);
mProfiles->AppendElement(string);
}
e->HasMoreElements(&hasMore);
}
#elif defined (XP_MACOSX)
fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
file->Append(NS_LITERAL_STRING("Preferences"));
file->Append(OPERA_PREFERENCES_FOLDER_NAME);
PRBool exists;
file->Exists(&exists);
if (exists) {
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
mProfiles->AppendElement(string);
}
#elif defined (XP_UNIX)
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
file->Append(OPERA_PREFERENCES_FOLDER_NAME);
PRBool exists;
file->Exists(&exists);
if (exists) {
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
mProfiles->AppendElement(string);
}
#endif
}
*aResult = mProfiles;
NS_IF_ADDREF(*aResult);
return NS_OK;
}
开发者ID:Egyptghost1,项目名称:DOMinator,代码行数:74,代码来源:nsOperaProfileMigrator.cpp
示例12: NS_IF_ADDREF
NS_IMETHODIMP
InterceptedChannelContent::GetChannel(nsIChannel** aChannel)
{
NS_IF_ADDREF(*aChannel = mChannel);
return NS_OK;
}
开发者ID:tefn3849,项目名称:gecko-dev,代码行数:6,代码来源:InterceptedChannel.cpp
示例13: main
//.........这里部分代码省略.........
}
#endif
#ifdef _BUILD_STATIC_BIN
// Combine the static components and the app components.
PRUint32 combinedCount = kStaticModuleCount + kModulesCount;
static nsStaticModuleInfo *sCombined = new nsStaticModuleInfo[combinedCount];
NS_ENSURE_TRUE(sCombined, NS_ERROR_OUT_OF_MEMORY);
memcpy(sCombined, kPStaticModules,
sizeof(nsStaticModuleInfo) * kStaticModuleCount);
memcpy(sCombined + kStaticModuleCount, &kStaticModules,
sizeof(nsStaticModuleInfo) * kModulesCount);
// Spin up the XPCOM infrastructure.
NS_InitXPCOM3(&serviceManager, nsnull, dirProvider, sCombined, combinedCount);
#else
// Spin up the XPCOM infrastructure.
NS_InitXPCOM3(&serviceManager, nsnull, dirProvider, &kStaticModules, kModulesCount);
#endif
// Exit immediately if we're only interested in XPCOM auto-registration.
int exitCode = 1;
if (argc > 1 && !strcmp(argv[1], "-reg")) {
exitCode = 0;
gJaxerLog.Log(eDEBUG, "Jaxer -reg call.");
} else {
// Give FCGX a chance to adopt stdin/stdout.
do {
/* Initialize appData */
nsCOMPtr<nsIFile> processDir;
rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR, getter_AddRefs(processDir));
if (NS_FAILED(rv)) {
fprintf(stderr, "Get current process directory failed: rv=0x%x", rv);
break;
}
nsCOMPtr<nsILocalFile> xreDirectory(do_QueryInterface(processDir));
appData.xreDirectory = xreDirectory;
NS_IF_ADDREF(appData.xreDirectory);
#ifdef MOZ_CRASHREPORTER
rv = CrashReporter::SetExceptionHandler(appData.xreDirectory, appData.crashReporterURL);
if (NS_SUCCEEDED(rv)) {
// pass some basic info from the app data
if (appData.vendor)
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Vendor"),
nsDependentCString(appData.vendor));
if (appData.name)
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductName"),
nsDependentCString(appData.name));
if (appData.version)
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Version"),
nsDependentCString(appData.version));
if (appData.buildID)
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BuildID"),
nsDependentCString(appData.buildID));
}
nsCOMPtr<nsIFile> dumpD;
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(dumpD));
if (NS_FAILED(rv)) {
fprintf(stderr, "Jaxer: Cannot get OS tmp dir. rv=0x%x", rv);
break;
}
nsAutoString pathStr;
rv = dumpD->GetPath(pathStr);
if(NS_SUCCEEDED(rv)) {
CrashReporter::SetMinidumpPath(pathStr);
}
#endif
// call Jaxer main
exitCode = jaxerMain(argc, argv);
} while(PR_FALSE);
}
#ifdef MOZ_CRASHREPORTER
CrashReporter::UnsetExceptionHandler();
#endif
NS_IF_RELEASE(appData.xreDirectory);
appDirectoryProvider.DoShutdown();
dirProvider = nsnull;
NS_ShutdownXPCOM(serviceManager);
#ifdef _BUILD_STATIC_BIN
delete[] sCombined;
#endif
#ifdef _WIN32
if (bLoadMySQL && hMySQL)
FreeLibrary(hMySQL);
#endif
return exitCode;
}
开发者ID:aptana,项目名称:Jaxer,代码行数:101,代码来源:Jaxer.cpp
示例14: PORT_NewArena
//.........这里部分代码省略.........
break;
case 1024:
case 512:
params = decode_ec_params("secp256r1");
break;
}
}
/* XXX The signature algorithm ought to choose the hashing
* algorithm based on key size once ECDSA variations based
* on SHA256 SHA384 and SHA512 are standardized.
*/
algTag = SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST;
break;
default:
goto loser;
}
/* Make sure token is initialized. */
rv = setPassword(slot, m_ctx);
if (NS_FAILED(rv))
goto loser;
sec_rv = PK11_Authenticate(slot, PR_TRUE, m_ctx);
if (sec_rv != SECSuccess) {
goto loser;
}
rv = getNSSDialogs((void**)&dialogs,
NS_GET_IID(nsIGeneratingKeypairInfoDialogs),
NS_GENERATINGKEYPAIRINFODIALOGS_CONTRACTID);
if (NS_SUCCEEDED(rv)) {
KeygenRunnable = new nsKeygenThread();
NS_IF_ADDREF(KeygenRunnable);
}
if (NS_FAILED(rv) || !KeygenRunnable) {
rv = NS_OK;
privateKey = PK11_GenerateKeyPair(slot, keyGenMechanism, params,
&publicKey, PR_TRUE, PR_TRUE, m_ctx);
} else {
KeygenRunnable->SetParams( slot, keyGenMechanism, params, PR_TRUE, PR_TRUE, m_ctx );
runnable = do_QueryInterface(KeygenRunnable);
if (runnable) {
{
nsPSMUITracker tracker;
if (tracker.isUIForbidden()) {
rv = NS_ERROR_NOT_AVAILABLE;
}
else {
rv = dialogs->DisplayGeneratingKeypairInfo(m_ctx, runnable);
// We call join on the thread,
// so we can be sure that no simultaneous access to the passed parameters will happen.
KeygenRunnable->Join();
}
}
NS_RELEASE(dialogs);
if (NS_SUCCEEDED(rv)) {
rv = KeygenRunnable->GetParams(&privateKey, &publicKey);
}
}
}
开发者ID:s-austin,项目名称:DOMinator,代码行数:66,代码来源:nsKeygenHandler.cpp
示例15: NS_IF_ADDREF
NS_IMETHODIMP
nsProxyInfo::GetFailoverProxy(nsIProxyInfo **result)
{
NS_IF_ADDREF(*result = mNext);
return NS_OK;
}
开发者ID:LyeSS,项目名称:mozilla-central,代码行数:6,代码来源:nsProxyInfo.cpp
示例16: NS_IF_ADDREF
NS_IMETHODIMP
HTMLOptionsCollection::GetSelect(nsIDOMHTMLSelectElement** aReturn)
{
NS_IF_ADDREF(*aReturn = mSelect);
return NS_OK;
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:6,代码来源:HTMLOptionsCollection.cpp
示例17: NS_IF_ADDREF
/* attribute mozIPersonalDictionary personalDictionary; */
NS_IMETHODIMP mozHunspell::GetPersonalDictionary(mozIPersonalDictionary * *aPersonalDictionary)
{
*aPersonalDictionary = mPersonalDictionary;
NS_IF_ADDREF(*aPersonalDictionary);
return NS_OK;
}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:7,代码来源:mozHunspell.cpp
示例18: NS_IF_RELEASE
void
nsHttpTransaction::SetConnection(nsAHttpConnection *conn)
{
NS_IF_RELEASE(mConnection);
NS_IF_ADDREF(mConnection = conn);
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:6,代码来源:nsHttpTransaction.cpp
注:本文中的NS_IF_ADDREF函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论