| Index: runtime/vm/service.h
|
| diff --git a/runtime/vm/service.h b/runtime/vm/service.h
|
| index a635dc30d08c7e37cdc9bb0bba341da412552605..a0b3a2e2cca8b125f4489e2ee47346b2bc50e0df 100644
|
| --- a/runtime/vm/service.h
|
| +++ b/runtime/vm/service.h
|
| @@ -8,6 +8,7 @@
|
| #include "include/dart_api.h"
|
|
|
| #include "vm/allocation.h"
|
| +#include "vm/object_id_ring.h"
|
| #include "vm/os_thread.h"
|
|
|
| namespace dart {
|
| @@ -15,6 +16,7 @@ namespace dart {
|
| class Array;
|
| class EmbedderServiceHandler;
|
| class GCEvent;
|
| +class GrowableObjectArray;
|
| class Instance;
|
| class Isolate;
|
| class JSONStream;
|
| @@ -23,6 +25,55 @@ class RawInstance;
|
| class ServiceEvent;
|
| class String;
|
|
|
| +class ServiceIdZone {
|
| + public:
|
| + ServiceIdZone();
|
| + virtual ~ServiceIdZone();
|
| +
|
| + // Returned string will be zone allocated.
|
| + virtual char* GetServiceId(const Object& obj) = 0;
|
| +
|
| + private:
|
| +};
|
| +
|
| +
|
| +class RingServiceIdZone : public ServiceIdZone {
|
| + public:
|
| + // Use the isolate's object id ring.
|
| + explicit RingServiceIdZone(ObjectIdRing::IdPolicy policy);
|
| + virtual ~RingServiceIdZone();
|
| +
|
| + // Returned string will be zone allocated.
|
| + virtual char* GetServiceId(const Object& obj);
|
| +
|
| + private:
|
| + ObjectIdRing::IdPolicy policy_;
|
| +};
|
| +
|
| +
|
| +// Growable array of objects. Ids are derived from the format string passed in
|
| +// and the index into the storage array. Ids are always reused to avoid growing
|
| +// the array.
|
| +class GrowableServiceIdZone : public ServiceIdZone {
|
| + public:
|
| + // |format_str| must contain one and only one format specifier (%" Pd "). It
|
| + // will be replaced with the index into the array. |storage| can not be null.
|
| + GrowableServiceIdZone(const char* format_str,
|
| + const GrowableObjectArray& storage);
|
| + virtual ~GrowableServiceIdZone();
|
| +
|
| + // Returned string will be zone allocated.
|
| + virtual char* GetServiceId(const Object& obj);
|
| +
|
| + private:
|
| + intptr_t FindIndex(const Object& obj);
|
| + intptr_t Append(const Object& obj);
|
| +
|
| + const char* format_str_;
|
| + const GrowableObjectArray& array_;
|
| +};
|
| +
|
| +
|
| class Service : public AllStatic {
|
| public:
|
| // Handles a message which is not directed to an isolate.
|
|
|