tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsINamedPipeService.idl (2305B)


      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/. */
      5 
      6 #include "nsISupports.idl"
      7 #include "nsrootidl.idl"
      8 
      9 /**
     10 * nsINamedPipeDataObserver
     11 *
     12 * This is the callback interface for nsINamedPipeService.
     13 * The functions are called by the internal thread in the nsINamedPipeService.
     14 */
     15 [uuid(de4f460b-94fd-442c-9002-1637beb2185a)]
     16 interface nsINamedPipeDataObserver : nsISupports
     17 {
     18    /**
     19     * onDataAvailable
     20     *
     21     * @param aBytesTransferred
     22     *        Transfered bytes during last transmission.
     23     * @param aOverlapped
     24     *        Corresponding overlapped structure used by the async I/O
     25     */
     26    void onDataAvailable(in unsigned long aBytesTransferred,
     27                         in voidPtr aOverlapped);
     28 
     29    /**
     30     * onError
     31     *
     32     * @param aError
     33     *        Error code of the error.
     34     * @param aOverlapped
     35     *        Corresponding overlapped structure used by the async I/O
     36     */
     37    void onError(in unsigned long aError,
     38                 in voidPtr aOverlapped);
     39 };
     40 
     41 /**
     42 * nsINamedPipeService
     43 */
     44 [uuid(1bf19133-5625-4ac8-836a-80b1c215f72b)]
     45 interface nsINamedPipeService : nsISupports
     46 {
     47    /**
     48     * addDataObserver
     49     *
     50     * @param aHandle
     51     *        The handle that is going to be monitored for read/write operations.
     52     *        Only handles that are opened with overlapped IO are supported.
     53     * @param aObserver
     54     *        The observer of the handle, the service strong-refs of the observer.
     55     */
     56    void addDataObserver(in voidPtr aHandle,
     57                         in nsINamedPipeDataObserver aObserver);
     58 
     59    /**
     60     * removeDataObserver
     61     *
     62     * @param aHandle
     63              The handle associated to the observer, and will be closed by the
     64              service.
     65     * @param aObserver
     66     *        The observer to be removed.
     67     */
     68    void removeDataObserver(in voidPtr aHandle,
     69                            in nsINamedPipeDataObserver aObserver);
     70 
     71    /**
     72     * isOnCurrentThread
     73     *
     74     * @return the caller runs within the internal thread.
     75     */
     76    boolean isOnCurrentThread();
     77 };