зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1203680 P2 Implement an NS_InputStreamIsCloneable() method. r=froydnj
This commit is contained in:
Родитель
bc6fd423a1
Коммит
02126738d3
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче