gecko-dev/netwerk/base/public/nsIStreamObserver.idl

52 lines
1.8 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
interface nsIEventQueue;
interface nsIChannel;
[scriptable, uuid(fd91e2e0-1481-11d3-9333-00104ba0fd40)]
interface nsIStreamObserver : nsISupports
{
void onStartRequest(in nsIChannel channel,
in nsISupports ctxt);
void onStopRequest(in nsIChannel channel,
in nsISupports ctxt,
in nsresult status,
in wstring errorMsg);
};
%{C++
// An asynchronous stream observer is used to ship data over to another thread specified
// by the thread's event queue. The receiver stream observer is then used to receive
// the notifications on the other thread.
extern NS_NET nsresult
NS_NewAsyncStreamObserver(nsIStreamObserver* *result,
nsIEventQueue* eventQueue,
nsIStreamObserver* receiver);
// Generic status codes for OnStopRequest:
#define NS_BINDING_SUCCEEDED NS_OK
#define NS_BINDING_FAILED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 1)
#define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
%}