本文整理汇总了C++中IPC::ReadParam方法的典型用法代码示例。如果您正苦于以下问题:C++ IPC::ReadParam方法的具体用法?C++ IPC::ReadParam怎么用?C++ IPC::ReadParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPC
的用法示例。
在下文中一共展示了IPC::ReadParam方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
bool
nsFileInputStream::Read(const IPC::Message *aMsg, void **aIter)
{
using IPC::ReadParam;
nsCString path;
bool followLinks;
PRInt32 flags;
if (!ReadParam(aMsg, aIter, &path) ||
!ReadParam(aMsg, aIter, &followLinks) ||
!ReadParam(aMsg, aIter, &flags))
return false;
nsCOMPtr<nsIFile> file;
nsresult rv = NS_NewNativeLocalFile(path, followLinks, getter_AddRefs(file));
if (NS_FAILED(rv))
return false;
// IO flags = -1 means readonly, and
// permissions are unimportant since we're reading
rv = Init(file, -1, -1, flags);
if (NS_FAILED(rv))
return false;
return true;
}
示例2: stream
PRBool
nsMIMEInputStream::Read(const IPC::Message *aMsg, void **aIter)
{
using IPC::ReadParam;
if (!ReadParam(aMsg, aIter, &mHeaders) ||
!ReadParam(aMsg, aIter, &mContentLength) ||
!ReadParam(aMsg, aIter, &mStartedReading))
return PR_FALSE;
// nsMIMEInputStream::Init() already appended mHeaderStream & mCLStream
mHeaderStream->ShareData(mHeaders.get(),
mStartedReading? mHeaders.Length() : 0);
mCLStream->ShareData(mContentLength.get(),
mStartedReading? mContentLength.Length() : 0);
IPC::InputStream inputStream;
if (!ReadParam(aMsg, aIter, &inputStream))
return PR_FALSE;
nsCOMPtr<nsIInputStream> stream(inputStream);
mData = stream;
if (stream) {
nsresult rv = mStream->AppendStream(mData);
if (NS_FAILED(rv))
return PR_FALSE;
}
if (!ReadParam(aMsg, aIter, &mAddContentLength))
return PR_FALSE;
return PR_TRUE;
}
示例3: stream
bool
nsBufferedInputStream::Read(const IPC::Message *aMsg, void **aIter)
{
using IPC::ReadParam;
PRUint32 bufferSize;
IPC::InputStream inputStream;
if (!ReadParam(aMsg, aIter, &bufferSize) ||
!ReadParam(aMsg, aIter, &inputStream))
return false;
nsCOMPtr<nsIInputStream> stream(inputStream);
nsresult rv = Init(stream, bufferSize);
if (NS_FAILED(rv))
return false;
return true;
}
示例4: stream
PRBool
nsBufferedInputStream::Read(const IPC::Message *aMsg, void **aIter)
{
#ifdef MOZ_IPC
using IPC::ReadParam;
PRUint32 bufferSize;
IPC::InputStream inputStream;
if (!ReadParam(aMsg, aIter, &bufferSize) ||
!ReadParam(aMsg, aIter, &inputStream))
return PR_FALSE;
nsCOMPtr<nsIInputStream> stream(inputStream);
nsresult rv = Init(stream, bufferSize);
if (NS_FAILED(rv))
return PR_FALSE;
return PR_TRUE;
#else
return PR_FALSE;
#endif
}