本文整理汇总了C++中FileSystemFileResponse类的典型用法代码示例。如果您正苦于以下问题:C++ FileSystemFileResponse类的具体用法?C++ FileSystemFileResponse怎么用?C++ FileSystemFileResponse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FileSystemFileResponse类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MOZ_ASSERT
void
GetFileOrDirectoryTask::SetSuccessRequestResult(const FileSystemResponseValue& aValue)
{
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
switch (aValue.type()) {
case FileSystemResponseValue::TFileSystemFileResponse: {
FileSystemFileResponse r = aValue;
BlobChild* actor = static_cast<BlobChild*>(r.blobChild());
nsCOMPtr<nsIDOMBlob> blob = actor->GetBlob();
mTargetFile = do_QueryInterface(blob);
mIsDirectory = false;
break;
}
case FileSystemResponseValue::TFileSystemDirectoryResponse: {
FileSystemDirectoryResponse r = aValue;
mTargetRealPath = r.realPath();
mIsDirectory = true;
break;
}
default: {
NS_RUNTIMEABORT("not reached");
break;
}
}
}
示例2: MOZ_ASSERT
void
GetFileOrDirectoryTaskChild::SetSuccessRequestResult(const FileSystemResponseValue& aValue,
ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
switch (aValue.type()) {
case FileSystemResponseValue::TFileSystemFileResponse: {
FileSystemFileResponse r = aValue;
aRv = NS_NewLocalFile(r.realPath(), true, getter_AddRefs(mTargetPath));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
mIsDirectory = false;
break;
}
case FileSystemResponseValue::TFileSystemDirectoryResponse: {
FileSystemDirectoryResponse r = aValue;
aRv = NS_NewLocalFile(r.realPath(), true, getter_AddRefs(mTargetPath));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
mIsDirectory = true;
break;
}
default: {
MOZ_CRASH("not reached");
break;
}
}
}
示例3: MOZ_ASSERT
void
CreateFileTask::SetSuccessRequestResult(const FileSystemResponseValue& aValue)
{
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
FileSystemFileResponse r = aValue;
BlobChild* actor = static_cast<BlobChild*>(r.blobChild());
mTargetBlobImpl = actor->GetBlobImpl();
}
示例4: MOZ_ASSERT
FileSystemResponseValue
GetFileOrDirectoryTask::GetSuccessRequestResult() const
{
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
if (mIsDirectory) {
return FileSystemDirectoryResponse(mTargetRealPath);
}
ContentParent* cp = static_cast<ContentParent*>(mRequestParent->Manager());
BlobParent* actor = cp->GetOrCreateActorForBlob(mTargetFile);
if (!actor) {
return FileSystemErrorResponse(NS_ERROR_DOM_FILESYSTEM_UNKNOWN_ERR);
}
FileSystemFileResponse response;
response.blobParent() = actor;
return response;
}