mobile/android/base/util/EventCallback.java

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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