Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Unified Diff: runtime/vm/debugger.h

Issue 12221022: Initial prototype of vmstats support, based on Dart VM Stats draft design doc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698