OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/plugins/ppapi/common.h" |
| 6 |
| 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/ppb_core.h" |
| 9 #include "webkit/plugins/ppapi/plugin_module.h" |
| 10 |
| 11 namespace webkit { |
| 12 namespace ppapi { |
| 13 |
| 14 int32_t MayForceCallback(PP_CompletionCallback callback, int32_t result) { |
| 15 if (result == PP_OK_COMPLETIONPENDING) |
| 16 return result; |
| 17 |
| 18 if (callback.func == NULL || |
| 19 (callback.flags & PP_COMPLETIONCALLBACK_FLAG_OPTIONAL) != 0) |
| 20 return result; |
| 21 |
| 22 PluginModule::GetCore()->CallOnMainThread(0, callback, result); |
| 23 return PP_OK_COMPLETIONPENDING; |
| 24 } |
| 25 |
| 26 } // namespace ppapi |
| 27 } // namespace webkit |
OLD | NEW |