| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 * for details. All rights reserved. Use of this source code is governed by a | 3 * for details. All rights reserved. Use of this source code is governed by a |
| 4 * BSD-style license that can be found in the LICENSE file. | 4 * BSD-style license that can be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef INCLUDE_DART_API_H_ | 7 #ifndef INCLUDE_DART_API_H_ |
| 8 #define INCLUDE_DART_API_H_ | 8 #define INCLUDE_DART_API_H_ |
| 9 | 9 |
| 10 /** \mainpage Dart Embedding API Reference | 10 /** \mainpage Dart Embedding API Reference |
| (...skipping 2752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2763 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort(); | 2763 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort(); |
| 2764 | 2764 |
| 2765 | 2765 |
| 2766 /** | 2766 /** |
| 2767 * A service request callback function. | 2767 * A service request callback function. |
| 2768 * | 2768 * |
| 2769 * These callbacks, registered by the embedder, are called when the VM receives | 2769 * These callbacks, registered by the embedder, are called when the VM receives |
| 2770 * a service request it can't handle and the service request command name | 2770 * a service request it can't handle and the service request command name |
| 2771 * matches one of the embedder registered handlers. | 2771 * matches one of the embedder registered handlers. |
| 2772 * | 2772 * |
| 2773 * \param name The service request command name. Always the first entry | 2773 * \param method The rpc method name. |
| 2774 * in the arguments array. Will match the name the callback was | 2774 * \param param_keys Service requests can have key-value pair parameters. The |
| 2775 * registered with. | |
| 2776 * \param arguments The service request command arguments. Incoming service | |
| 2777 * request paths are split like file system paths and flattened into an array | |
| 2778 * (e.g. /foo/bar becomes the array ["foo", "bar"]. | |
| 2779 * \param num_arguments The length of the arguments array. | |
| 2780 * \param option_keys Service requests can have options key-value pairs. The | |
| 2781 * keys and values are flattened and stored in arrays. | 2775 * keys and values are flattened and stored in arrays. |
| 2782 * \param option_values The values associated with the keys. | 2776 * \param param_values The values associated with the keys. |
| 2783 * \param num_options The length of the option_keys and option_values array. | 2777 * \param num_params The length of the param_keys and param_values arrays. |
| 2784 * \param user_data The user_data pointer registered with this handler. | 2778 * \param user_data The user_data pointer registered with this handler. |
| 2785 * | 2779 * |
| 2786 * \return Returns a C string containing a valid JSON object. The returned | 2780 * \return Returns a C string containing a valid JSON object. The returned |
| 2787 * pointer will be freed by the VM by calling free. | 2781 * pointer will be freed by the VM by calling free. |
| 2788 */ | 2782 */ |
| 2789 typedef const char* (*Dart_ServiceRequestCallback)( | 2783 typedef const char* (*Dart_ServiceRequestCallback)( |
| 2790 const char* name, | 2784 const char* method, |
| 2791 const char** arguments, | 2785 const char** param_keys, |
| 2792 intptr_t num_arguments, | 2786 const char** param_values, |
| 2793 const char** option_keys, | 2787 intptr_t num_params, |
| 2794 const char** option_values, | |
| 2795 intptr_t num_options, | |
| 2796 void* user_data); | 2788 void* user_data); |
| 2797 | 2789 |
| 2798 /** | 2790 /** |
| 2799 * Register a Dart_ServiceRequestCallback to be called to handle requests | 2791 * Register a Dart_ServiceRequestCallback to be called to handle requests |
| 2800 * with name on a specific isolate. The callback will be invoked with the | 2792 * with name on a specific isolate. The callback will be invoked with the |
| 2801 * current isolate set to the request target. | 2793 * current isolate set to the request target. |
| 2802 * | 2794 * |
| 2803 * \param name The name of the command that this callback is responsible for. | 2795 * \param name The name of the command that this callback is responsible for. |
| 2804 * \param callback The callback to invoke. | 2796 * \param callback The callback to invoke. |
| 2805 * \param user_data The user data passed to the callback. | 2797 * \param user_data The user data passed to the callback. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2823 * NOTE: If multiple callbacks with the same name are registered, only the | 2815 * NOTE: If multiple callbacks with the same name are registered, only the |
| 2824 * last callback registered will be remembered. | 2816 * last callback registered will be remembered. |
| 2825 */ | 2817 */ |
| 2826 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 2818 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 2827 const char* name, | 2819 const char* name, |
| 2828 Dart_ServiceRequestCallback callback, | 2820 Dart_ServiceRequestCallback callback, |
| 2829 void* user_data); | 2821 void* user_data); |
| 2830 | 2822 |
| 2831 | 2823 |
| 2832 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2824 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
| OLD | NEW |