Bug 885804: Blob changes r=jlebar

This commit is contained in:
David Zbarsky 2013-07-08 11:48:40 -04:00
parent 2f6d14bd46
commit 5719801b21
2 changed files with 32 additions and 13 deletions

View File

@ -1367,17 +1367,30 @@ Blob<Child>::RecvPBlobStreamConstructor(StreamType* aActor)
return aActor->Send__delete__(aActor, params);
}
template <ActorFlavorEnum ActorFlavor>
typename Blob<ActorFlavor>::StreamType*
Blob<ActorFlavor>::AllocPBlobStream()
BlobTraits<Parent>::StreamType*
BlobTraits<Parent>::BaseType::AllocPBlobStreamParent()
{
MOZ_ASSERT(NS_IsMainThread());
return new InputStreamActor<ActorFlavor>();
return new InputStreamActor<Parent>();
}
BlobTraits<Child>::StreamType*
BlobTraits<Child>::BaseType::AllocPBlobStreamChild()
{
MOZ_ASSERT(NS_IsMainThread());
return new InputStreamActor<Child>();
}
template <ActorFlavorEnum ActorFlavor>
bool
Blob<ActorFlavor>::DeallocPBlobStream(StreamType* aActor)
BlobTraits<Parent>::BaseType::DeallocPBlobStreamParent(BlobTraits<Parent>::StreamType* aActor)
{
MOZ_ASSERT(NS_IsMainThread());
delete aActor;
return true;
}
bool
BlobTraits<Child>::BaseType::DeallocPBlobStreamChild(BlobTraits<Child>::StreamType* aActor)
{
MOZ_ASSERT(NS_IsMainThread());
delete aActor;

View File

@ -84,6 +84,12 @@ struct BlobTraits<Parent>
}
protected:
virtual StreamType*
AllocPBlobStreamParent() MOZ_OVERRIDE;
virtual bool
DeallocPBlobStreamParent(StreamType* aActor) MOZ_OVERRIDE;
BaseType();
virtual ~BaseType();
@ -133,6 +139,12 @@ struct BlobTraits<Child>
}
protected:
virtual StreamType*
AllocPBlobStreamChild() MOZ_OVERRIDE;
virtual bool
DeallocPBlobStreamChild(StreamType* aActor) MOZ_OVERRIDE;
BaseType()
{ }
@ -217,12 +229,6 @@ private:
virtual bool
RecvPBlobStreamConstructor(StreamType* aActor) MOZ_OVERRIDE;
virtual StreamType*
AllocPBlobStream() MOZ_OVERRIDE;
virtual bool
DeallocPBlobStream(StreamType* aActor) MOZ_OVERRIDE;
};
} // namespace ipc
@ -233,4 +239,4 @@ typedef mozilla::dom::ipc::Blob<mozilla::dom::ipc::Parent> BlobParent;
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_ipc_Blob_h
#endif // mozilla_dom_ipc_Blob_h