зеркало из https://github.com/mozilla/gecko-dev.git
Added input stream consumer in nsIStreamListener->OnDataAvailable(). not part of the build.
This commit is contained in:
Родитель
869b48e340
Коммит
e7549fdd24
|
@ -88,6 +88,7 @@
|
||||||
|
|
||||||
#include "nsirequest.h"
|
#include "nsirequest.h"
|
||||||
#include "Tests.h"
|
#include "Tests.h"
|
||||||
|
#include "prmem.h"
|
||||||
|
|
||||||
CBrowserImpl::CBrowserImpl()
|
CBrowserImpl::CBrowserImpl()
|
||||||
{
|
{
|
||||||
|
@ -469,10 +470,22 @@ NS_IMETHODIMP CBrowserImpl::OnDataAvailable(nsIRequest *request,
|
||||||
PRUint32 offset, PRUint32 count)
|
PRUint32 offset, PRUint32 count)
|
||||||
{
|
{
|
||||||
nsCString stringMsg;
|
nsCString stringMsg;
|
||||||
|
PRUint32 readLen;
|
||||||
|
|
||||||
QAOutput("##### inside nsIStreamListener::OnDataAvailable(). #####");
|
QAOutput("##### inside nsIStreamListener::OnDataAvailable(). #####");
|
||||||
|
|
||||||
RequestName(request, stringMsg, 1);
|
RequestName(request, stringMsg, 1);
|
||||||
|
readLen = count;
|
||||||
|
// from prmem.h: PR_Malloc()
|
||||||
|
char *buf = (char *)PR_Malloc(count);
|
||||||
|
if (!input)
|
||||||
|
QAOutput("We didn't get the nsIInputStream object.", 1);
|
||||||
|
else {
|
||||||
|
// consumer of input stream
|
||||||
|
rv = input->Read(buf, count, &readLen);
|
||||||
|
RvTestResult(rv, "nsIInputStream->Read() consumer", 1);
|
||||||
|
}
|
||||||
|
|
||||||
FormatAndPrintOutput("OnDataAvailable() offset = ", offset, 1);
|
FormatAndPrintOutput("OnDataAvailable() offset = ", offset, 1);
|
||||||
FormatAndPrintOutput("OnDataAvailable() count = ", count, 1);
|
FormatAndPrintOutput("OnDataAvailable() count = ", count, 1);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче