Flutter Engine
The Flutter Engine
native_message_handler.h
Go to the documentation of this file.
1// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
6#define RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
7
8#include <memory>
9
10#include "include/dart_api.h"
12#include "vm/message_handler.h"
13
14namespace dart {
15
16// A NativeMessageHandler accepts messages and dispatches them to
17// native C handlers.
19 public:
22
23 const char* name() const { return name_; }
24 Dart_NativeMessageHandler func() const { return func_; }
25
26 MessageStatus HandleMessage(std::unique_ptr<Message> message);
27
28#if defined(DEBUG)
29 // Check that it is safe to access this handler.
30 void CheckAccess() const;
31#endif
32
33 private:
34 char* name_;
36};
37
38} // namespace dart
39
40#endif // RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
NativeMessageHandler(const char *name, Dart_NativeMessageHandler func)
Dart_NativeMessageHandler func() const
MessageStatus HandleMessage(std::unique_ptr< Message > message)
void(* Dart_NativeMessageHandler)(Dart_Port dest_port_id, Dart_CObject *message)
Win32Message message
Definition: dart_vm.cc:33