[email protected] | 25651387 | 2012-01-05 15:41:52 | [diff] [blame] | 1 | /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 2 | * Use of this source code is governed by a BSD-style license that can be |
| 3 | * found in the LICENSE file. |
| 4 | */ |
| 5 | |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 6 | /** |
| 7 | * This file defines an enumeration of all PPAPI error codes. |
| 8 | */ |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 9 | |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 10 | /** |
| 11 | * This enumeration contains enumerators of all PPAPI error codes. |
[email protected] | e655a951 | 2011-09-16 20:10:55 | [diff] [blame] | 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. |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 16 | */ |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 17 | [unnamed] enum PP_Error { |
| 18 | /** |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 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, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 24 | /** |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 25 | * This value is returned by a function that accepts a PP_CompletionCallback |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 26 | * and cannot complete synchronously. This code indicates that the given |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 27 | * callback will be asynchronously notified of the final result once it is |
| 28 | * available. |
| 29 | */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 30 | PP_OK_COMPLETIONPENDING = -1, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 31 | |
[email protected] | e655a951 | 2011-09-16 20:10:55 | [diff] [blame] | 32 | /**This value indicates failure for unspecified reasons. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 33 | PP_ERROR_FAILED = -2, |
[email protected] | e655a951 | 2011-09-16 20:10:55 | [diff] [blame] | 34 | |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 35 | /** |
| 36 | * This value indicates failure due to an asynchronous operation being |
[email protected] | e655a951 | 2011-09-16 20:10:55 | [diff] [blame] | 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. |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 46 | */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 47 | PP_ERROR_ABORTED = -3, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 48 | |
| 49 | /** This value indicates failure due to an invalid argument. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 50 | PP_ERROR_BADARGUMENT = -4, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 51 | |
| 52 | /** This value indicates failure due to an invalid PP_Resource. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 53 | PP_ERROR_BADRESOURCE = -5, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 54 | |
| 55 | /** This value indicates failure due to an unavailable PPAPI interface. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 56 | PP_ERROR_NOINTERFACE = -6, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 57 | |
| 58 | /** This value indicates failure due to insufficient privileges. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 59 | PP_ERROR_NOACCESS = -7, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 60 | |
| 61 | /** This value indicates failure due to insufficient memory. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 62 | PP_ERROR_NOMEMORY = -8, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 63 | |
| 64 | /** This value indicates failure due to insufficient storage space. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 65 | PP_ERROR_NOSPACE = -9, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 66 | |
| 67 | /** This value indicates failure due to insufficient storage quota. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 68 | PP_ERROR_NOQUOTA = -10, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * This value indicates failure due to an action already being in |
| 72 | * progress. |
| 73 | */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 74 | PP_ERROR_INPROGRESS = -11, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 75 | /** This value indicates failure due to a file that does not exist. */ |
| 76 | |
| 77 | /** |
| 78 | * The requested command is not supported by the browser. |
| 79 | */ |
| 80 | PP_ERROR_NOTSUPPORTED = -12, |
| 81 | |
[email protected] | e655a951 | 2011-09-16 20:10:55 | [diff] [blame] | 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 | * The goal is to provide blocking calls from background threads, but PPAPI |
| 89 | * calls on background threads are not currently supported. Until this |
| 90 | * support is complete, you must either do asynchronous operations on the |
| 91 | * main thread, or provide an adaptor for a blocking background thread to |
| 92 | * execute the operaitions on the main thread. |
| 93 | */ |
| 94 | PP_ERROR_BLOCKS_MAIN_THREAD = -13, |
| 95 | |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 96 | PP_ERROR_FILENOTFOUND = -20, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 97 | /** This value indicates failure due to a file that already exists. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 98 | PP_ERROR_FILEEXISTS = -21, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 99 | /** This value indicates failure due to a file that is too big. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 100 | PP_ERROR_FILETOOBIG = -22, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 101 | /** |
| 102 | * This value indicates failure due to a file having been modified |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 103 | * unexpectedly. |
| 104 | */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 105 | PP_ERROR_FILECHANGED = -23, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 106 | /** This value indicates failure due to a time limit being exceeded. */ |
[email protected] | 996bdbd | 2011-04-11 22:46:44 | [diff] [blame] | 107 | PP_ERROR_TIMEDOUT = -30, |
[email protected] | 745b0d4 | 2011-07-16 23:53:22 | [diff] [blame] | 108 | /** |
| 109 | * This value indicates that the user cancelled rather than providing |
| 110 | * expected input. |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 111 | */ |
[email protected] | 66d45b99 | 2011-09-06 22:27:03 | [diff] [blame] | 112 | PP_ERROR_USERCANCEL = -40, |
| 113 | /** |
| 114 | * This value indicates that the graphics context was lost due to a |
| 115 | * power management event. |
| 116 | */ |
[email protected] | 231a96b7 | 2012-01-20 04:17:40 | [diff] [blame] | 117 | PP_ERROR_CONTEXT_LOST = -50, |
| 118 | /** |
| 119 | * Indicates an attempt to make a PPAPI call on a thread without previously |
| 120 | * registering a message loop via PPB_MessageLoop.AttachToCurrentThread. |
| 121 | * Without this registration step, no PPAPI calls are supported. |
| 122 | */ |
| 123 | PP_ERROR_NO_MESSAGE_LOOP = -51, |
| 124 | /** |
| 125 | * Indicates that the requested operation is not permitted on the current |
| 126 | * thread. |
| 127 | */ |
| 128 | PP_ERROR_WRONG_THREAD = -52 |
[email protected] | 2272ed3 | 2011-03-30 17:37:54 | [diff] [blame] | 129 | }; |
| 130 | |