Chromium Code Reviews| 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 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2205 * for the native function. | 2205 * for the native function. |
| 2206 * | 2206 * |
| 2207 * See Dart_SetNativeResolver. | 2207 * See Dart_SetNativeResolver. |
| 2208 */ | 2208 */ |
| 2209 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, | 2209 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, |
| 2210 int num_of_arguments, | 2210 int num_of_arguments, |
| 2211 bool* auto_setup_scope); | 2211 bool* auto_setup_scope); |
| 2212 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or | 2212 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or |
| 2213 * NativeResolver. */ | 2213 * NativeResolver. */ |
| 2214 | 2214 |
| 2215 /** | |
| 2216 * Native entry reverse resolution callback. | |
|
siva
2014/04/08 16:27:54
Native entry symbol lookup callback.
Cutch
2014/04/09 17:40:59
Done.
| |
| 2217 * | |
| 2218 * For libraries and scripts which have native functions, the embedder | |
| 2219 * can provide a native entry reverse resolver. This callback is used to map | |
|
siva
2014/04/08 16:27:54
can provide a callback for mapping a native entry
Cutch
2014/04/09 17:40:59
Done.
| |
| 2220 * a native function entry PC to the native function name. If no native entry | |
| 2221 * can be found, the callback should return NULL. | |
| 2222 * | |
| 2223 * The parameters to the native reverse resolver function are: | |
| 2224 * \param nf A Dart_NativeFunction. | |
| 2225 * | |
| 2226 * \return A const C string containing the name of the native function or NULL. | |
| 2227 * | |
| 2228 * See Dart_SetNativeResolver. | |
| 2229 */ | |
| 2230 typedef const char* (*Dart_NativeEntryReverseResolver)(Dart_NativeFunction nf); | |
|
siva
2014/04/08 16:27:54
Should the return value be a const char* or a uint
Cutch
2014/04/09 17:40:59
UTF8.
| |
| 2231 | |
| 2232 | |
| 2215 /* | 2233 /* |
| 2216 * =========== | 2234 * =========== |
| 2217 * Environment | 2235 * Environment |
| 2218 * =========== | 2236 * =========== |
| 2219 */ | 2237 */ |
| 2220 | 2238 |
| 2221 /** | 2239 /** |
| 2222 * An environment lookup callback function. | 2240 * An environment lookup callback function. |
| 2223 * | 2241 * |
| 2224 * \param name The name of the value to lookup in the environment. | 2242 * \param name The name of the value to lookup in the environment. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 2241 /** | 2259 /** |
| 2242 * Sets the callback used to resolve native functions for a library. | 2260 * Sets the callback used to resolve native functions for a library. |
| 2243 * | 2261 * |
| 2244 * \param library A library. | 2262 * \param library A library. |
| 2245 * \param resolver A native entry resolver. | 2263 * \param resolver A native entry resolver. |
| 2246 * | 2264 * |
| 2247 * \return A valid handle if the native resolver was set successfully. | 2265 * \return A valid handle if the native resolver was set successfully. |
| 2248 */ | 2266 */ |
| 2249 DART_EXPORT Dart_Handle Dart_SetNativeResolver( | 2267 DART_EXPORT Dart_Handle Dart_SetNativeResolver( |
| 2250 Dart_Handle library, | 2268 Dart_Handle library, |
| 2251 Dart_NativeEntryResolver resolver); | 2269 Dart_NativeEntryResolver resolver, |
| 2270 Dart_NativeEntryReverseResolver reverse_resolver); | |
|
siva
2014/04/08 16:27:54
Dart_NativeEntrySymbol
Cutch
2014/04/09 17:40:59
Done.
| |
| 2252 /* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */ | 2271 /* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */ |
| 2253 | 2272 |
| 2254 | 2273 |
| 2255 /* | 2274 /* |
| 2256 * ===================== | 2275 * ===================== |
| 2257 * Scripts and Libraries | 2276 * Scripts and Libraries |
| 2258 * ===================== | 2277 * ===================== |
| 2259 */ | 2278 */ |
| 2260 /* TODO(turnidge): Finish documenting this section. */ | 2279 /* TODO(turnidge): Finish documenting this section. */ |
| 2261 | 2280 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2541 * NOTE: If multiple callbacks with the same name are registered, only the | 2560 * NOTE: If multiple callbacks with the same name are registered, only the |
| 2542 * last callback registered will be remembered. | 2561 * last callback registered will be remembered. |
| 2543 */ | 2562 */ |
| 2544 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 2563 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 2545 const char* name, | 2564 const char* name, |
| 2546 Dart_ServiceRequestCallback callback, | 2565 Dart_ServiceRequestCallback callback, |
| 2547 void* user_data); | 2566 void* user_data); |
| 2548 | 2567 |
| 2549 | 2568 |
| 2550 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2569 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
| OLD | NEW |