mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1093357 P2 Implement an NS_InputStreamIsCloneable() method. r=froydnj
This commit is contained in:
parent
6bdc03723f
commit
9204ca9694
@ -857,6 +857,17 @@ NS_FillArray(FallibleTArray<char>& aDest, nsIInputStream* aInput,
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
NS_InputStreamIsCloneable(nsIInputStream* aSource)
|
||||
{
|
||||
if (!aSource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsICloneableInputStream> cloneable = do_QueryInterface(aSource);
|
||||
return cloneable && cloneable->GetCloneable();
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_CloneInputStream(nsIInputStream* aSource, nsIInputStream** aCloneOut,
|
||||
nsIInputStream** aReplacementOut)
|
||||
|
@ -264,6 +264,12 @@ extern NS_METHOD
|
||||
NS_FillArray(FallibleTArray<char>& aDest, nsIInputStream* aInput,
|
||||
uint32_t aKeep, uint32_t* aNewBytes);
|
||||
|
||||
/**
|
||||
* Return true if the given stream can be directly cloned.
|
||||
*/
|
||||
extern bool
|
||||
NS_InputStreamIsCloneable(nsIInputStream* aSource);
|
||||
|
||||
/**
|
||||
* Clone the provided source stream in the most efficient way possible. This
|
||||
* first attempts to QI to nsICloneableInputStream to use Clone(). If that is
|
||||
|
Loading…
Reference in New Issue
Block a user