mobile/android/base/util/EventCallback.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 package org.mozilla.gecko.util;
     3 /**
     4  * Callback interface for Gecko requests.
     5  *
     6  * For each instance of EventCallback, exactly one of sendResponse, sendError, or sendCancel
     7  * must be called to prevent observer leaks. If more than one send* method is called, or if a
     8  * single send method is called multiple times, an {@link IllegalStateException} will be thrown.
     9  */
    10 public interface EventCallback {
    11     /**
    12      * Sends a success response with the given data.
    13      *
    14      * @param response The response data to send to Gecko. Can be any of the types accepted by
    15      *                 JSONObject#put(String, Object).
    16      */
    17     public void sendSuccess(Object response);
    19     /**
    20      * Sends an error response with the given data.
    21      *
    22      * @param response The response data to send to Gecko. Can be any of the types accepted by
    23      *                 JSONObject#put(String, Object).
    24      */
    25     public void sendError(Object response);
    27     /**
    28      * Cancels the request, preventing any Gecko-side callbacks from being executed.
    29      */
    30     public void sendCancel();
    31 }

mercurial