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