Files
sdk/runtime/vm/native_message_handler.h
T
Vyacheslav Egorov 43a0500e37 VM: [Kernel] Fix bootstraping when Kernel isolate is used.
We must bootstrap from Kernel instead of Source when running with --dfe

BUG=
R=asiva@google.com, kustermann@google.com

Review-Url: https://codereview.chromium.org/2651633002 .
2017-01-30 20:52:59 +01:00

46 lines
1.3 KiB
C++

// Copyright (c) 2012, 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 RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
#define RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
#include "include/dart_api.h"
#include "include/dart_native_api.h"
#include "vm/message_handler.h"
namespace dart {
// A NativeMessageHandler accepts messages and dispatches them to
// native C handlers.
class NativeMessageHandler : public MessageHandler {
public:
NativeMessageHandler(const char* name,
Dart_NativeMessageHandler func,
void* peer);
~NativeMessageHandler();
const char* name() const { return name_; }
Dart_NativeMessageHandler func() const { return func_; }
void* peer() const { return peer_; }
MessageStatus HandleMessage(Message* message);
#if defined(DEBUG)
// Check that it is safe to access this handler.
void CheckAccess();
#endif
// Delete this handlers when its last live port is closed.
virtual bool OwnedByPortMap() const { return true; }
private:
char* name_;
Dart_NativeMessageHandler func_;
void* peer_;
};
} // namespace dart
#endif // RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_