| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 | 5 |
| 6 /** | 6 /** |
| 7 * This file contains the <code>PPB_Flash_MessageLoop</code> interface. | 7 * This file contains the <code>PPB_Flash_MessageLoop</code> interface. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 label Chrome { | 10 label Chrome { |
| 11 M18 = 0.1 | 11 M18 = 0.1 |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * The <code>PPB_Flash_MessageLoop</code> interface supports Pepper Flash to run | 15 * The <code>PPB_Flash_MessageLoop</code> interface supports Pepper Flash to run |
| 16 * nested message loops. | 16 * nested run loops. |
| 17 */ | 17 */ |
| 18 interface PPB_Flash_MessageLoop { | 18 interface PPB_Flash_MessageLoop { |
| 19 /** | 19 /** |
| 20 * Allocates a Flash message loop resource. | 20 * Allocates a Flash message loop resource. |
| 21 * | 21 * |
| 22 * @param[in] instance A <code>PP_Instance</code> identifying one instance | 22 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 23 * of a module. | 23 * of a module. |
| 24 * | 24 * |
| 25 * @return A <code>PP_Resource</code> that can be used to run a nested message | 25 * @return A <code>PP_Resource</code> that can be used to run a nested message |
| 26 * loop if successful; 0 if failed. | 26 * loop if successful; 0 if failed. |
| 27 */ | 27 */ |
| 28 PP_Resource Create([in] PP_Instance instance); | 28 PP_Resource Create([in] PP_Instance instance); |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * Determines if a given resource is a Flash message loop. | 31 * Determines if a given resource is a Flash message loop. |
| 32 * | 32 * |
| 33 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic | 33 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic |
| 34 * resource. | 34 * resource. |
| 35 * | 35 * |
| 36 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given | 36 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given |
| 37 * resource is a Flash message loop, otherwise <code>PP_FALSE</code>. | 37 * resource is a Flash message loop, otherwise <code>PP_FALSE</code>. |
| 38 */ | 38 */ |
| 39 PP_Bool IsFlashMessageLoop([in] PP_Resource resource); | 39 PP_Bool IsFlashMessageLoop([in] PP_Resource resource); |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * Runs a nested message loop. The plugin will be reentered from this call. | 42 * Runs a nested run loop. The plugin will be reentered from this call. |
| 43 * This function is used in places where Flash would normally enter a nested | 43 * This function is used in places where Flash would normally enter a nested |
| 44 * message loop (e.g., when displaying context menus), but Pepper provides | 44 * message loop (e.g., when displaying context menus), but Pepper provides |
| 45 * only an asynchronous call. After performing that asynchronous call, call | 45 * only an asynchronous call. After performing that asynchronous call, call |
| 46 * <code>Run()</code>. In the callback, call <code>Quit()</code>. | 46 * <code>Run()</code>. In the callback, call <code>Quit()</code>. |
| 47 * | 47 * |
| 48 * For a given message loop resource, only the first call to | 48 * For a given message loop resource, only the first call to |
| 49 * <code>Run()</code> will start a nested message loop. The subsequent calls | 49 * <code>Run()</code> will start a nested run loop. The subsequent calls |
| 50 * will return <code>PP_ERROR_FAILED</code> immediately. | 50 * will return <code>PP_ERROR_FAILED</code> immediately. |
| 51 * | 51 * |
| 52 * @param[in] flash_message_loop The Flash message loop. | 52 * @param[in] flash_message_loop The Flash message loop. |
| 53 * | 53 * |
| 54 * @return <code>PP_ERROR_ABORTED</code> if the message loop quits because the | 54 * @return <code>PP_ERROR_ABORTED</code> if the message loop quits because the |
| 55 * resource is destroyed; <code>PP_OK</code> if the message loop quits because | 55 * resource is destroyed; <code>PP_OK</code> if the message loop quits because |
| 56 * of other reasons (e.g., <code>Quit()</code> is called); | 56 * of other reasons (e.g., <code>Quit()</code> is called); |
| 57 * <code>PP_ERROR_FAILED</code> if this is not the first call to | 57 * <code>PP_ERROR_FAILED</code> if this is not the first call to |
| 58 * <code>Run()</code>. | 58 * <code>Run()</code>. |
| 59 */ | 59 */ |
| 60 int32_t Run([in] PP_Resource flash_message_loop); | 60 int32_t Run([in] PP_Resource flash_message_loop); |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Signals to quit the outermost nested message loop. Use this to exit and | 63 * Signals to quit the outermost nested run loop. Use this to exit and |
| 64 * return back to the caller after you call <code>Run()</code>. | 64 * return back to the caller after you call <code>Run()</code>. |
| 65 * | 65 * |
| 66 * If <code>Quit()</code> is not called to balance the call to | 66 * If <code>Quit()</code> is not called to balance the call to |
| 67 * <code>Run()</code>, the outermost nested message loop will be quitted | 67 * <code>Run()</code>, the outermost nested run loop will be quitted |
| 68 * implicitly when the resource is destroyed. | 68 * implicitly when the resource is destroyed. |
| 69 * | 69 * |
| 70 * @param[in] flash_message_loop The Flash message loop. | 70 * @param[in] flash_message_loop The Flash message loop. |
| 71 */ | 71 */ |
| 72 void Quit([in] PP_Resource flash_message_loop); | 72 void Quit([in] PP_Resource flash_message_loop); |
| 73 }; | 73 }; |
| OLD | NEW |