Index: runtime/vm/debugger.h |
=================================================================== |
--- runtime/vm/debugger.h (revision 18152) |
+++ runtime/vm/debugger.h (working copy) |
@@ -5,6 +5,9 @@ |
#ifndef VM_DEBUGGER_H_ |
#define VM_DEBUGGER_H_ |
+#include <cstring> |
+#include <map> |
siva
2013/02/09 01:00:57
We have generally tried to avoid usage of map insi
Tom Ball
2013/02/14 23:45:16
STL references removed.
|
+ |
#include "include/dart_debugger_api.h" |
#include "vm/object.h" |
@@ -380,6 +383,38 @@ |
}; |
+// Singleton service managing VM status gathering and status plug-in |
+// registration. |
+class VmStatusService { |
+ public: |
+ static Dart_Handle RegisterPlugin( |
+ const char* status_type, Dart_VmStatusCallback callback); |
+ |
+ // Returns VM status for a specified request. The caller is responsible |
+ // for releasing the heap memory after use. |
+ static char* Dart_GetVmStatus(const char* request); |
+ |
+ static void InitOnce(); |
+ |
+ private: |
+ VmStatusService() {} |
+ |
+ static VmStatusService* instance_; |
+ |
+ struct strcmp { |
+ bool operator()(char const *a, char const *b) { |
+ return std::strcmp(a, b) < 0; |
+ } |
+ }; |
+ |
+ typedef std::map<const char*, Dart_VmStatusCallback, strcmp> ServiceMap; |
+ |
+ ServiceMap service_map_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VmStatusService); |
+}; |
+ |
+ |
} // namespace dart |
#endif // VM_DEBUGGER_H_ |