toolkit/components/places/mozIColorAnalyzer.idl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsISupports.idl"
     7 interface nsIURI;
     9 [function, scriptable, uuid(e4089e21-71b6-40af-b546-33c21b90e874)]
    10 interface mozIRepresentativeColorCallback : nsISupports
    11 {
    12   /**
    13    * Will be called when color analysis finishes.
    14    *
    15    * @param success
    16    *        True if analysis was successful, false otherwise.
    17    *        Analysis can fail if the image is transparent, imageURI doesn't
    18    *        resolve to a valid image, or the image is too big.
    19    *
    20    * @param color
    21    *        The representative color as an integer in RGB form.
    22    *        e.g. 0xFF0102 == rgb(255,1,2)
    23    *        If success is false, color is not provided.
    24    */
    25   void onComplete(in boolean success, [optional] in unsigned long color);
    26 };
    28 [scriptable, uuid(d056186c-28a0-494e-aacc-9e433772b143)]
    29 interface mozIColorAnalyzer : nsISupports
    30 {
    31   /**
    32    * Given an image URI, find the most representative color for that image
    33    * based on the frequency of each color.  Preference is given to colors that
    34    * are more interesting.  Avoids the background color if it can be
    35    * discerned.  Ignores sufficiently transparent colors.
    36    *
    37    * This is intended to be used on favicon images.  Larger images take longer
    38    * to process, especially those with a larger number of unique colors.  If
    39    * imageURI points to an image that has more than 128^2 pixels, this method
    40    * will fail before analyzing it for performance reasons.
    41    *
    42    * @param imageURI
    43    *        A URI pointing to the image - ideally a data: URI, but any scheme
    44    *        that will load when setting the src attribute of a DOM img element
    45    *        should work.
    46    * @param callback
    47    *        Function to call when the representative color is found or an
    48    *        error occurs.
    49    */
    50   void findRepresentativeColor(in nsIURI imageURI,
    51                                in mozIRepresentativeColorCallback callback);
    52 };

mercurial