Lines Matching refs:rv
67 nsresult rv = os->Write(p, bufLen, &n);
68 if (NS_FAILED(rv)) return rv;
81 nsresult rv;
86 rv = mIn->Read(buf, 100, &count);
87 if (NS_FAILED(rv)) {
107 return rv;
131 nsresult rv;
137 rv = NS_NewThread(&thread, receiver, 0, PR_JOINABLE_THREAD);
138 if (NS_FAILED(rv)) return rv;
146 rv = WriteAll(out, buf, len, &writeCount);
155 if (NS_FAILED(rv)) return rv;
158 rv = out->Close();
159 if (NS_FAILED(rv)) return rv;
182 nsresult rv;
189 rv = mIn->Read(buf, 100, &count);
190 if (NS_FAILED(rv)) {
204 return rv;
244 nsresult rv;
250 rv = NS_NewThread(&thread, receiver, 0, PR_JOINABLE_THREAD);
251 if (NS_FAILED(rv)) return rv;
260 rv = WriteAll(out, buf, len, &writeCount);
261 if (NS_FAILED(rv)) return rv;
274 rv = out->Close();
275 if (NS_FAILED(rv)) return rv;
327 nsresult rv;
335 rv = NS_NewPipe(&in, &out, 18, 36, PR_TRUE, PR_TRUE);
336 if (NS_FAILED(rv)) return rv;
338 nsCOMPtr<nsIObservableInputStream> observableIn(do_QueryInterface(in, &rv));
339 if (NS_FAILED(rv)) return rv;
340 nsCOMPtr<nsIObservableInputStream> observableOut(do_QueryInterface(out, &rv));
341 if (NS_FAILED(rv)) return rv;
343 rv = observableIn->SetObserver(obs);
344 if (NS_FAILED(rv)) return rv;
345 rv = observableOut->SetObserver(obs);
346 if (NS_FAILED(rv)) return rv;
351 rv = out->Write(buf, 20, &cnt);
352 if (NS_FAILED(rv)) return rv;
356 rv = out->Write(buf + 20, 20, &cnt);
357 if (NS_FAILED(rv)) return rv;
360 rv = in->Available(&cnt);
361 if (NS_FAILED(rv)) return rv;
367 rv = in->Read(buf2, 40, &cnt);
368 if (NS_FAILED(rv)) return rv;
373 rv = in->Available(&cnt);
374 if (NS_FAILED(rv)) return rv;
379 rv = in->Read(buf2, 2, &cnt);
380 if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK) return rv;
381 NS_ASSERTION(cnt == 0 && rv == NS_BASE_STREAM_WOULD_BLOCK, "Read failed");
384 rv = out->Write(buf, 20, &cnt);
385 if (NS_FAILED(rv)) return rv;
388 rv = in->Available(&cnt);
389 if (NS_FAILED(rv)) return rv;
394 rv = in->Read(buf2, 20, &cnt);
395 if (NS_FAILED(rv)) return rv;
414 nsresult rv;
418 rv = mOut->WriteFrom(mIn, ~0U, &count);
419 if (NS_FAILED(rv)) {
434 return rv;
457 nsresult rv;
462 rv = NS_NewPipe(&in1, &out1, 20, 1999);
463 if (NS_FAILED(rv)) return rv;
467 rv = NS_NewPipe(&in2, &out2, 200, 401);
468 if (NS_FAILED(rv)) return rv;
475 rv = NS_NewThread(&thread, pump, 0, PR_JOINABLE_THREAD);
476 if (NS_FAILED(rv)) return rv;
483 rv = NS_NewThread(&receiverThread, receiver, 0, PR_JOINABLE_THREAD);
484 if (NS_FAILED(rv)) return rv;
493 rv = WriteAll(out1, buf, len, &writeCount);
494 if (NS_FAILED(rv)) return rv;
504 rv = out1->Close();
505 if (NS_FAILED(rv)) return rv;
522 nsresult rv;
531 rv = NS_NewPipe(&in, &out, segSize, bufSize);
532 NS_ASSERTION(NS_SUCCEEDED(rv), "NS_NewPipe failed");
533 rv = TestPipe(in, out);
536 NS_ASSERTION(NS_SUCCEEDED(rv), "TestPipe failed");
539 rv = NS_NewPipe(&in, &out, segSize, bufSize);
540 NS_ASSERTION(NS_SUCCEEDED(rv), "NS_NewPipe failed");
541 rv = TestShortWrites(in, out);
544 NS_ASSERTION(NS_SUCCEEDED(rv), "TestPipe failed");
552 nsresult rv;
558 rv = NS_NewPipe(&in, &out, segSize, bufSize);
559 NS_ASSERTION(NS_SUCCEEDED(rv), "NS_NewPipe failed");
567 rv = out->Write("-", 1, &amt);
568 NS_ASSERTION(NS_SUCCEEDED(rv) && amt == 1, "Write failed");
570 rv = out->Write(delim, delimLen, &amt);
571 NS_ASSERTION(NS_SUCCEEDED(rv), "Write failed");
574 rv = out->Write("+", 1, &amt);
575 NS_ASSERTION(NS_SUCCEEDED(rv) && amt == 1, "Write failed");
582 rv = in->Search(delim, PR_FALSE, &found, &offset);
583 NS_ASSERTION(NS_SUCCEEDED(rv), "Search failed");
587 rv = in->Read(bufferContents, bufDataSize, &amt);
588 NS_ASSERTION(NS_SUCCEEDED(rv) && amt == bufDataSize, "Read failed");
607 nsresult rv;
610 rv = NS_InitXPCOM2(&servMgr, NULL, NULL);
611 if (NS_FAILED(rv)) return rv;
621 rv = NS_NewPipe(&in, &out, 4096 * 4);
622 if (NS_FAILED(rv)) {
627 rv = TestPipe(in, out);
630 if (NS_FAILED(rv)) {
641 rv = TestChainedPipes();
642 NS_ASSERTION(NS_SUCCEEDED(rv), "TestChainedPipes failed");
646 rv = NS_ShutdownXPCOM( NULL );
647 NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");