diff options
author | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 22:46:44 +0000 |
---|---|---|
committer | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 22:46:44 +0000 |
commit | 996bdbda28035f7f68955525625c998290706281 (patch) | |
tree | dfc61c5633359f02e40421e0240aeac25753b642 /ppapi/c | |
parent | a965ca65e8170b3d685b7ca9185929fe3915b7f9 (diff) | |
download | chromium_src-996bdbda28035f7f68955525625c998290706281.zip chromium_src-996bdbda28035f7f68955525625c998290706281.tar.gz chromium_src-996bdbda28035f7f68955525625c998290706281.tar.bz2 |
1;2cReplace PP_ERROR_WOULDBLOCK with PP_OK_COMPLETIONPENDING. Improve error code comments. Update all code that uses this error code. Keep the old code for now flagging it as deprecated. Update copyrights.
BUG=none
TEST=bots
Review URL: http://codereview.chromium.org/6814033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/ppb_transport_dev.h | 8 | ||||
-rw-r--r-- | ppapi/c/pp_completion_callback.h | 3 | ||||
-rw-r--r-- | ppapi/c/pp_errors.h | 17 |
3 files changed, 16 insertions, 12 deletions
diff --git a/ppapi/c/dev/ppb_transport_dev.h b/ppapi/c/dev/ppb_transport_dev.h index 72ebb67..fad88f9 100644 --- a/ppapi/c/dev/ppb_transport_dev.h +++ b/ppapi/c/dev/ppb_transport_dev.h @@ -34,13 +34,13 @@ struct PPB_Transport_Dev { // RTT // Establishes a connection to the remote peer. Returns - // PP_ERROR_WOULDBLOCK and notifies on |cb| when connectivity is + // PP_OK_COMPLETIONPENDING and notifies on |cb| when connectivity is // established (or timeout occurs). int32_t (*Connect)(PP_Resource transport, struct PP_CompletionCallback cb); // Obtains another ICE candidate address to be provided to the - // remote peer. Returns PP_ERROR_WOULDBLOCK if there are no more + // remote peer. Returns PP_OK_COMPLETIONPENDING if there are no more // addresses to be sent. After the callback is called // GetNextAddress() must be called again to get the address. int32_t (*GetNextAddress)(PP_Resource transport, @@ -51,14 +51,14 @@ struct PPB_Transport_Dev { int32_t (*ReceiveRemoteAddress)(PP_Resource transport, struct PP_Var address); - // Like recv(), receives data. Returns PP_ERROR_WOULDBLOCK if there + // Like recv(), receives data. Returns PP_OK_COMPLETIONPENDING if there // is currently no data to receive. In that case, the |data| pointer // should remain valid until the callback is called. int32_t (*Recv)(PP_Resource transport, void* data, uint32_t len, struct PP_CompletionCallback cb); - // Like send(), sends data. Returns PP_ERROR_WOULDBLOCK if the + // Like send(), sends data. Returns PP_OK_COMPLETIONPENDING if the // socket is currently flow-controlled. In that case, the |data| // pointer should remain valid until the callback is called. int32_t (*Send)(PP_Resource transport, diff --git a/ppapi/c/pp_completion_callback.h b/ppapi/c/pp_completion_callback.h index 927b185..96edf6f 100644 --- a/ppapi/c/pp_completion_callback.h +++ b/ppapi/c/pp_completion_callback.h @@ -37,7 +37,7 @@ typedef void (*PP_CompletionCallback_Func)(void* user_data, int32_t result); /** * Any method that takes a PP_CompletionCallback has the option of completing * asynchronously if the operation would block. Such a method should return - * PP_ERROR_WOULDBLOCK to indicate that the method will complete + * PP_OK_COMPLETIONPENDING to indicate that the method will complete * asynchronously and will always be invoked from the main thread of PPAPI * execution. If the completion callback is NULL, then the operation will * block if necessary to complete its work. PP_BlockUntilComplete() provides a @@ -126,4 +126,3 @@ PP_INLINE struct PP_CompletionCallback PP_BlockUntilComplete() { */ #endif /* PPAPI_C_PP_COMPLETION_CALLBACK_H_ */ - diff --git a/ppapi/c/pp_errors.h b/ppapi/c/pp_errors.h index 36911b2..da2f5b4 100644 --- a/ppapi/c/pp_errors.h +++ b/ppapi/c/pp_errors.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium Authors. All rights reserved. +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -7,7 +7,7 @@ /** * @file - * This file defines an enumeration of all Native Client errors. + * This file defines an enumeration of all PPAPI error codes. */ /** @@ -16,19 +16,25 @@ * @{ */ -/** This enumeration contains enumerators of all Native Client errors. +/** This enumeration contains enumerators of all PPAPI error codes. * Errors are negative valued. */ enum { + /** + * This value is returned by a function on successful synchronous completion + * or is passed as a result to a PP_CompletionCallback_Func on successful + * asynchronous completion. + */ PP_OK = 0, /** * This value is returned by a function that accepts a PP_CompletionCallback - * and cannot complete synchronously. This error indicates that the given + * and cannot complete synchronously. This code indicates that the given * callback will be asynchronously notified of the final result once it is * available. */ - PP_ERROR_WOULDBLOCK = -1, + PP_OK_COMPLETIONPENDING = -1, + PP_ERROR_WOULDBLOCK = -1, /* DEPRECATED: DO NOT USE */ /** This value indicates failure for unspecified reasons. */ PP_ERROR_FAILED = -2, @@ -96,4 +102,3 @@ enum { */ #endif /* PPAPI_C_PP_ERRORS_H_ */ - |