1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
7 #include
"nsrootidl.idl"
10 * nsINamedPipeDataObserver
12 * This is the callback interface for nsINamedPipeService.
13 * The functions are called by the internal thread in the nsINamedPipeService.
15 [scriptable
, uuid(de4f460b
-94fd
-442c
-9002-1637beb2185a
)]
16 interface nsINamedPipeDataObserver
: nsISupports
21 * @param aBytesTransferred
22 * Transfered bytes during last transmission.
24 * Corresponding overlapped structure used by the async I/O
26 void onDataAvailable
(in unsigned long aBytesTransferred
,
27 in voidPtr aOverlapped
);
33 * Error code of the error.
35 * Corresponding overlapped structure used by the async I/O
37 void onError
(in unsigned long aError
,
38 in voidPtr aOverlapped
);
44 [scriptable
, uuid(1bf19133
-5625-4ac8
-836a
-80b1c215f72b
)]
45 interface nsINamedPipeService
: nsISupports
51 * The handle that is going to be monitored for read/write operations.
52 * Only handles that are opened with overlapped IO are supported.
54 * The observer of the handle, the service strong-refs of the observer.
56 void addDataObserver
(in voidPtr aHandle
,
57 in nsINamedPipeDataObserver aObserver
);
63 The handle associated to the observer, and will be closed by the
66 * The observer to be removed.
68 void removeDataObserver
(in voidPtr aHandle
,
69 in nsINamedPipeDataObserver aObserver
);
74 * @return the caller runs within the internal thread.
76 boolean isOnCurrentThread
();