netwerk/base/nsIRequestObserver.idl
author Razvan Maries <rmaries@mozilla.com>
Tue, 11 Aug 2020 07:57:38 +0300
changeset 544211 3fa98e681edd27957e97152d541e0be28122d781
parent 461559 c48f47f793c0f0d9b4acf2caf9324b8bd7a5a683
permissions -rw-r--r--
Backed out changeset 558dce220fdd (bug 1654388) for perma failures on test_usage_prefs.html. CLOSED TREE

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

interface nsIRequest;

/**
 * nsIRequestObserver
 */
[scriptable, uuid(fd91e2e0-1481-11d3-9333-00104ba0fd40)]
interface nsIRequestObserver : nsISupports
{
    /**
     * Called to signify the beginning of an asynchronous request.
     *
     * @param aRequest request being observed
     *
     * An exception thrown from onStartRequest has the side-effect of
     * causing the request to be canceled.
     */
    void onStartRequest(in nsIRequest aRequest);

    /**
     * Called to signify the end of an asynchronous request.  This
     * call is always preceded by a call to onStartRequest.
     *
     * @param aRequest request being observed
     * @param aStatusCode reason for stopping (NS_OK if completed successfully)
     *
     * An exception thrown from onStopRequest is generally ignored.
     */
    void onStopRequest(in nsIRequest aRequest,
                       in nsresult aStatusCode);
};