| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BIN_VMSTATS_H_ | |
| 6 #define BIN_VMSTATS_H_ | |
| 7 | |
| 8 #include "include/dart_api.h" | |
| 9 | |
| 10 | |
| 11 namespace dart { | |
| 12 namespace bin { | |
| 13 | |
| 14 /** | |
| 15 * A VM status callback. Status plug-ins implement and register this | |
| 16 * function using Dart_RegisterStatusPlugin. When Dart_GetVMStatus is | |
| 17 * called, each callback is invoked to provide the requested information, | |
| 18 * and the first one to do so "wins". | |
| 19 * | |
| 20 * Note: status requests execute outside of an isolate (which is why | |
| 21 * handles aren't used). | |
| 22 * | |
| 23 * \param request an optional string that defines REST-like parameters | |
| 24 * to define what information is requested. | |
| 25 * | |
| 26 * \return Returns a valid JSON string, allocated from C heap. The caller | |
| 27 * is responsible for releasing this string. NULL is returned if the | |
| 28 * callback didn't handle that request. | |
| 29 */ | |
| 30 typedef char* (*Dart_VmStatusCallback)(const char* request); | |
| 31 | |
| 32 | |
| 33 /** | |
| 34 * Register a VM status plug-in. The specified status type must not already | |
| 35 * have a registered plug-in. | |
| 36 * | |
| 37 * \return 0 if the plug-in was registered, or -1 if there is an error. | |
| 38 */ | |
| 39 DART_EXPORT int Dart_RegisterVmStatusPlugin(Dart_VmStatusCallback callback); | |
| 40 | |
| 41 } // namespace bin | |
| 42 } // namespace dart | |
| 43 | |
| 44 #endif // BIN_VMSTATS_H_ | |
| OLD | NEW |