Home | History | Annotate | Download | only in api
      1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  */
      5 
      6 /**
      7  * This file defines an enumeration of all PPAPI error codes.
      8  */
      9 
     10 /**
     11  * This enumeration contains enumerators of all PPAPI error codes.
     12  *
     13  * Errors are negative valued. Callers should treat all negative values as a
     14  * failure, even if it's not in the list, since the possible errors are likely
     15  * to expand and change over time.
     16  */
     17 [unnamed] enum PP_Error {
     18   /**
     19    * This value is returned by a function on successful synchronous completion
     20    * or is passed as a result to a PP_CompletionCallback_Func on successful
     21    * asynchronous completion.
     22    */
     23   PP_OK                   = 0,
     24   /**
     25    * This value is returned by a function that accepts a PP_CompletionCallback
     26    * and cannot complete synchronously. This code indicates that the given
     27    * callback will be asynchronously notified of the final result once it is
     28    * available.
     29    */
     30   PP_OK_COMPLETIONPENDING = -1,
     31 
     32   /**This value indicates failure for unspecified reasons. */
     33   PP_ERROR_FAILED         = -2,
     34 
     35   /**
     36    * This value indicates failure due to an asynchronous operation being
     37    * interrupted. The most common cause of this error code is destroying a
     38    * resource that still has a callback pending. All callbacks are guaranteed
     39    * to execute, so any callbacks pending on a destroyed resource will be
     40    * issued with PP_ERROR_ABORTED.
     41    *
     42    * If you get an aborted notification that you aren't expecting, check to
     43    * make sure that the resource you're using is still in scope. A common
     44    * mistake is to create a resource on the stack, which will destroy the
     45    * resource as soon as the function returns.
     46    */
     47   PP_ERROR_ABORTED        = -3,
     48 
     49   /** This value indicates failure due to an invalid argument. */
     50   PP_ERROR_BADARGUMENT    = -4,
     51 
     52   /** This value indicates failure due to an invalid PP_Resource. */
     53   PP_ERROR_BADRESOURCE    = -5,
     54 
     55   /** This value indicates failure due to an unavailable PPAPI interface. */
     56   PP_ERROR_NOINTERFACE    = -6,
     57 
     58   /** This value indicates failure due to insufficient privileges. */
     59   PP_ERROR_NOACCESS       = -7,
     60 
     61   /** This value indicates failure due to insufficient memory. */
     62   PP_ERROR_NOMEMORY       = -8,
     63 
     64   /** This value indicates failure due to insufficient storage space. */
     65   PP_ERROR_NOSPACE        = -9,
     66 
     67   /** This value indicates failure due to insufficient storage quota. */
     68   PP_ERROR_NOQUOTA        = -10,
     69 
     70   /**
     71    * This value indicates failure due to an action already being in
     72    * progress.
     73    */
     74   PP_ERROR_INPROGRESS     = -11,
     75 
     76   /**
     77    * The requested command is not supported by the browser.
     78    */
     79   PP_ERROR_NOTSUPPORTED = -12,
     80 
     81   /**
     82    * Returned if you try to use a null completion callback to "block until
     83    * complete" on the main thread. Blocking the main thread is not permitted
     84    * to keep the browser responsive (otherwise, you may not be able to handle
     85    * input events, and there are reentrancy and deadlock issues).
     86    */
     87   PP_ERROR_BLOCKS_MAIN_THREAD = -13,
     88   /**
     89    * This value indicates that the plugin sent bad input data to a resource,
     90    * leaving it in an invalid state. The resource can't be used after returning
     91    * this error and should be released.
     92    */
     93   PP_ERROR_MALFORMED_INPUT = -14,
     94   /**
     95    * This value indicates that a resource has failed.  The resource can't be
     96    * used after returning this error and should be released.
     97    */
     98   PP_ERROR_RESOURCE_FAILED = -15,
     99 
    100   /** This value indicates failure due to a file that does not exist. */
    101   PP_ERROR_FILENOTFOUND   = -20,
    102   /** This value indicates failure due to a file that already exists. */
    103   PP_ERROR_FILEEXISTS     = -21,
    104   /** This value indicates failure due to a file that is too big. */
    105   PP_ERROR_FILETOOBIG     = -22,
    106   /**
    107    * This value indicates failure due to a file having been modified
    108    * unexpectedly.
    109    */
    110   PP_ERROR_FILECHANGED    = -23,
    111   /** This value indicates that the pathname does not reference a file. */
    112   PP_ERROR_NOTAFILE       = -24,
    113   /** This value indicates failure due to a time limit being exceeded. */
    114   PP_ERROR_TIMEDOUT       = -30,
    115   /**
    116    * This value indicates that the user cancelled rather than providing
    117    * expected input.
    118    */
    119   PP_ERROR_USERCANCEL     = -40,
    120   /**
    121    * This value indicates failure due to lack of a user gesture such as a
    122    * mouse click or key input event. Examples of actions requiring a user
    123    * gesture are showing the file chooser dialog and going into fullscreen
    124    * mode.
    125    */
    126   PP_ERROR_NO_USER_GESTURE = -41,
    127   /**
    128    * This value indicates that the graphics context was lost due to a
    129    * power management event.
    130    */
    131   PP_ERROR_CONTEXT_LOST   = -50,
    132   /**
    133    * Indicates an attempt to make a PPAPI call on a thread without previously
    134    * registering a message loop via PPB_MessageLoop.AttachToCurrentThread.
    135    * Without this registration step, no PPAPI calls are supported.
    136    */
    137   PP_ERROR_NO_MESSAGE_LOOP = -51,
    138   /**
    139    * Indicates that the requested operation is not permitted on the current
    140    * thread.
    141    */
    142   PP_ERROR_WRONG_THREAD   = -52,
    143 
    144   /**
    145    * This value indicates that the connection was closed. For TCP sockets, it
    146    * corresponds to a TCP FIN.
    147    */
    148   PP_ERROR_CONNECTION_CLOSED = -100,
    149   /**
    150    * This value indicates that the connection was reset. For TCP sockets, it
    151    * corresponds to a TCP RST.
    152    */
    153   PP_ERROR_CONNECTION_RESET = -101,
    154   /**
    155    * This value indicates that the connection attempt was refused.
    156    */
    157   PP_ERROR_CONNECTION_REFUSED = -102,
    158   /**
    159    * This value indicates that the connection was aborted. For TCP sockets, it
    160    * means the connection timed out as a result of not receiving an ACK for data
    161    * sent. This can include a FIN packet that did not get ACK'd.
    162    */
    163   PP_ERROR_CONNECTION_ABORTED = -103,
    164   /**
    165    * This value indicates that the connection attempt failed.
    166    */
    167   PP_ERROR_CONNECTION_FAILED = -104,
    168   /**
    169    * This value indicates that the connection attempt timed out.
    170    */
    171   PP_ERROR_CONNECTION_TIMEDOUT = -105,
    172   /**
    173    * This value indicates that the IP address or port number is invalid.
    174    */
    175   PP_ERROR_ADDRESS_INVALID = -106,
    176   /**
    177    * This value indicates that the IP address is unreachable. This usually means
    178    * that there is no route to the specified host or network.
    179    */
    180   PP_ERROR_ADDRESS_UNREACHABLE = -107,
    181   /**
    182    * This value is returned when attempting to bind an address that is already
    183    * in use.
    184    */
    185   PP_ERROR_ADDRESS_IN_USE = -108,
    186   /**
    187    * This value indicates that the message was too large for the transport.
    188    */
    189   PP_ERROR_MESSAGE_TOO_BIG = -109,
    190   /**
    191    * This value indicates that the host name could not be resolved.
    192    */
    193   PP_ERROR_NAME_NOT_RESOLVED = -110
    194 };
    195 
    196