Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_COMMON_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_COMMON_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_COMMON_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_COMMON_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_completion_callback.h" | |
| 9 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| 10 | 11 |
| 11 namespace webkit { | 12 namespace webkit { |
| 12 namespace ppapi { | 13 namespace ppapi { |
| 13 | 14 |
| 14 inline PP_Bool BoolToPPBool(bool value) { | 15 inline PP_Bool BoolToPPBool(bool value) { |
| 15 return value ? PP_TRUE : PP_FALSE; | 16 return value ? PP_TRUE : PP_FALSE; |
| 16 } | 17 } |
| 17 | 18 |
| 18 inline bool PPBoolToBool(PP_Bool value) { | 19 inline bool PPBoolToBool(PP_Bool value) { |
| 19 return (PP_TRUE == value); | 20 return (PP_TRUE == value); |
| 20 } | 21 } |
| 21 | 22 |
| 23 // Skips callback invocation and returns |result| if callback function is NULL | |
| 24 // or PP_COMPLETIONCALLBACK_FLAG_OPTIONAL is set. Otherwise, schedules the | |
| 25 // callback with |result| as an argument and returns PP_OK_COMPLETIONPENDING. | |
| 26 int32_t MayForceCallback(PP_CompletionCallback callback, int32_t result); | |
|
piman
2011/06/07 17:32:14
Can you re-use the one in ppapi/thunk instead of d
polina
2011/06/09 23:53:51
Done.
| |
| 27 | |
| 22 } // namespace ppapi | 28 } // namespace ppapi |
| 23 } // namespace webkit | 29 } // namespace webkit |
| 24 | 30 |
| 25 #endif // WEBKIT_PLUGINS_PPAPI_COMMON_H_ | 31 #endif // WEBKIT_PLUGINS_PPAPI_COMMON_H_ |
| 26 | |
| OLD | NEW |