Files
sdk/runtime/vm/service.h
T
turnidge@google.com 9c5c7040dc Add a VM page to the observatory.
Make the VM a ServiceObject.  Some refactoring in the ServiceObject
implementation.

IsolateList is no longer a ServiceObject.  It should eventually become more like our caches.

Support the /vm request in the vm.  Remove isolate list request.

Improvements to Isolate::PrintToJSONStream: always provide a
reasonable name.  Use the same code to produce isolate refs and
non-refs.

Improve isolate status message when the isolate is paused at
start/exit.  Add a resume link to the isolate view.

Add a navbar to the error page so that dartium users are less likely
to get stuck.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//206213004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34204 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-20 21:00:10 +00:00

65 lines
2.0 KiB
C++

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef VM_SERVICE_H_
#define VM_SERVICE_H_
#include "include/dart_api.h"
#include "vm/allocation.h"
namespace dart {
class EmbedderServiceHandler;
class Instance;
class Isolate;
class JSONStream;
class RawInstance;
class Service : public AllStatic {
public:
// Handles a message which is not directed to an isolate.
static void HandleRootMessage(const Instance& message);
// Handles a message which is directed to a particular isolate.
static void HandleIsolateMessage(Isolate* isolate, const Instance& message);
static Isolate* GetServiceIsolate(void* callback_data);
static bool SendIsolateStartupMessage();
static bool SendIsolateShutdownMessage();
static bool IsRunning();
static void RegisterIsolateEmbedderCallback(
const char* name,
Dart_ServiceRequestCallback callback,
void* user_data);
static void RegisterRootEmbedderCallback(
const char* name,
Dart_ServiceRequestCallback callback,
void* user_data);
static bool IsServiceIsolate(Isolate* isolate) {
return isolate == service_isolate_;
}
private:
static void EmbedderHandleMessage(EmbedderServiceHandler* handler,
JSONStream* js);
static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name);
static EmbedderServiceHandler* isolate_service_handler_head_;
static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name);
static EmbedderServiceHandler* root_service_handler_head_;
static Isolate* service_isolate_;
static Dart_LibraryTagHandler default_handler_;
static Dart_Port port_;
static Dart_Handle GetSource(const char* name);
static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library,
Dart_Handle url);
};
} // namespace dart
#endif // VM_SERVICE_H_