Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
dart::Message Class Reference

#include <message.h>

Public Types

enum  Priority { kNormalPriority = 0 , kOOBPriority = 1 , kFirstPriority = 0 , kNumPriorities = 2 }
 
enum  OOBMsgTag { kIllegalOOB = 0 , kServiceOOBMsg = 1 , kIsolateLibOOBMsg = 2 , kDelayedIsolateLibOOBMsg = 3 }
 

Public Member Functions

 Message (Dart_Port dest_port, uint8_t *snapshot, intptr_t snapshot_length, MessageFinalizableData *finalizable_data, Priority priority)
 
 Message (Dart_Port dest_port, ObjectPtr raw_obj, Priority priority)
 
 Message (Dart_Port dest_port, PersistentHandle *handle, Priority priority)
 
 Message (PersistentHandle *handle, Priority priority)
 
 ~Message ()
 
Dart_Port dest_port () const
 
uint8_t * snapshot () const
 
intptr_t snapshot_length () const
 
MessageFinalizableDatafinalizable_data ()
 
intptr_t Size () const
 
ObjectPtr raw_obj () const
 
PersistentHandlepersistent_handle () const
 
Priority priority () const
 
bool IsOOB () const
 
bool IsSnapshot () const
 
bool IsRaw () const
 
bool IsPersistentHandle () const
 
bool IsFinalizerInvocationRequest () const
 
void DropFinalizers ()
 
intptr_t Id () const
 

Static Public Member Functions

template<typename... Args>
static std::unique_ptr< MessageNew (Args &&... args)
 
static const char * PriorityAsString (Priority priority)
 

Static Public Attributes

static const Dart_Port kIllegalPort = 0
 

Friends

class MessageQueue
 

Detailed Description

Definition at line 25 of file message.h.

Member Enumeration Documentation

◆ OOBMsgTag

Enumerator
kIllegalOOB 
kServiceOOBMsg 
kIsolateLibOOBMsg 
kDelayedIsolateLibOOBMsg 

Definition at line 39 of file message.h.

39 {
40 kIllegalOOB = 0,
44 } OOBMsgTag;
@ kServiceOOBMsg
Definition: message.h:41
@ kDelayedIsolateLibOOBMsg
Definition: message.h:43
@ kIsolateLibOOBMsg
Definition: message.h:42

◆ Priority

Enumerator
kNormalPriority 
kOOBPriority 
kFirstPriority 
kNumPriorities 

Definition at line 27 of file message.h.

27 {
28 kNormalPriority = 0, // Deliver message when idle.
29 kOOBPriority = 1, // Deliver message asap.
30
31 // Iteration.
34 } Priority;
@ kNormalPriority
Definition: message.h:28
@ kNumPriorities
Definition: message.h:33
@ kFirstPriority
Definition: message.h:32
@ kOOBPriority
Definition: message.h:29

Constructor & Destructor Documentation

◆ Message() [1/4]

Message::Message ( Dart_Port  dest_port,
uint8_t *  snapshot,
intptr_t  snapshot_length,
MessageFinalizableData finalizable_data,
Priority  priority 
)

Definition at line 19 of file message.cc.

24 : dest_port_(dest_port),
25 payload_(snapshot),
26 snapshot_length_(snapshot_length),
27 finalizable_data_(finalizable_data),
28 priority_(priority) {
30}
bool IsSnapshot() const
Definition: message.h:108
Priority priority() const
Definition: message.h:102
MessageFinalizableData * finalizable_data()
Definition: message.h:84
intptr_t snapshot_length() const
Definition: message.h:82
Dart_Port dest_port() const
Definition: message.h:76
uint8_t * snapshot() const
Definition: message.h:78
#define ASSERT(E)

◆ Message() [2/4]

Message::Message ( Dart_Port  dest_port,
ObjectPtr  raw_obj,
Priority  priority 
)

Definition at line 32 of file message.cc.

33 : dest_port_(dest_port), payload_(raw_obj), priority_(priority) {
34 ASSERT(!raw_obj->IsHeapObject() || raw_obj->untag()->InVMIsolateHeap());
35 ASSERT(IsRaw());
36}
ObjectPtr raw_obj() const
Definition: message.h:94
bool IsRaw() const
Definition: message.h:112
UntaggedObject * untag() const
bool InVMIsolateHeap() const
Definition: raw_object.cc:20

◆ Message() [3/4]

Message::Message ( Dart_Port  dest_port,
PersistentHandle handle,
Priority  priority 
)

Definition at line 38 of file message.cc.

41 : dest_port_(dest_port),
42 payload_(handle),
43 snapshot_length_(kPersistentHandleSnapshotLen),
44 priority_(priority) {
46}
bool IsPersistentHandle() const
Definition: message.h:115

◆ Message() [4/4]

Message::Message ( PersistentHandle handle,
Priority  priority 
)

Definition at line 48 of file message.cc.

49 : dest_port_(ILLEGAL_PORT),
50 payload_(handle),
51 snapshot_length_(kFinalizerSnapshotLen),
52 priority_(priority) {
54}
bool IsFinalizerInvocationRequest() const
Definition: message.h:119
#define ILLEGAL_PORT
Definition: dart_api.h:1535

◆ ~Message()

Message::~Message ( )

Definition at line 56 of file message.cc.

56 {
57 if (IsSnapshot()) {
58 free(payload_.snapshot_);
59 }
60 delete finalizable_data_;
62 auto isolate_group = IsolateGroup::Current();
63 isolate_group->api_state()->FreePersistentHandle(
64 payload_.persistent_handle_);
65 }
66}
static IsolateGroup * Current()
Definition: isolate.h:539

Member Function Documentation

◆ dest_port()

Dart_Port dart::Message::dest_port ( ) const
inline

Definition at line 76 of file message.h.

76{ return dest_port_; }

◆ DropFinalizers()

void dart::Message::DropFinalizers ( )
inline

Definition at line 123 of file message.h.

123 {
124 if (finalizable_data_ != nullptr) {
125 finalizable_data_->DropFinalizers();
126 }
127 }

◆ finalizable_data()

MessageFinalizableData * dart::Message::finalizable_data ( )
inline

Definition at line 84 of file message.h.

84{ return finalizable_data_; }

◆ Id()

intptr_t Message::Id ( ) const

Definition at line 68 of file message.cc.

68 {
69 // Messages are allocated on the C heap. Use the raw address as the id.
70 return reinterpret_cast<intptr_t>(this);
71}

◆ IsFinalizerInvocationRequest()

bool dart::Message::IsFinalizerInvocationRequest ( ) const
inline

Definition at line 119 of file message.h.

119 {
120 return snapshot_length_ == kFinalizerSnapshotLen;
121 }

◆ IsOOB()

bool dart::Message::IsOOB ( ) const
inline

Definition at line 107 of file message.h.

107{ return priority_ == Message::kOOBPriority; }

◆ IsPersistentHandle()

bool dart::Message::IsPersistentHandle ( ) const
inline

Definition at line 115 of file message.h.

115 {
116 return snapshot_length_ == kPersistentHandleSnapshotLen;
117 }

◆ IsRaw()

bool dart::Message::IsRaw ( ) const
inline

Definition at line 112 of file message.h.

112{ return snapshot_length_ == 0; }

◆ IsSnapshot()

bool dart::Message::IsSnapshot ( ) const
inline

Definition at line 108 of file message.h.

108 {
110 }

◆ New()

template<typename... Args>
static std::unique_ptr< Message > dart::Message::New ( Args &&...  args)
inlinestatic

Definition at line 72 of file message.h.

72 {
73 return std::unique_ptr<Message>(new Message(std::forward<Args>(args)...));
74 }
Message(Dart_Port dest_port, uint8_t *snapshot, intptr_t snapshot_length, MessageFinalizableData *finalizable_data, Priority priority)
Definition: message.cc:19
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ persistent_handle()

PersistentHandle * dart::Message::persistent_handle ( ) const
inline

Definition at line 98 of file message.h.

98 {
100 return payload_.persistent_handle_;
101 }

◆ priority()

Priority dart::Message::priority ( ) const
inline

Definition at line 102 of file message.h.

102{ return priority_; }

◆ PriorityAsString()

const char * Message::PriorityAsString ( Priority  priority)
static

Definition at line 73 of file message.cc.

73 {
74 switch (priority) {
75 case kNormalPriority:
76 return "Normal";
77 break;
78 case kOOBPriority:
79 return "OOB";
80 break;
81 default:
83 return nullptr;
84 }
85}
#define UNIMPLEMENTED

◆ raw_obj()

ObjectPtr dart::Message::raw_obj ( ) const
inline

Definition at line 94 of file message.h.

94 {
95 ASSERT(IsRaw());
96 return payload_.raw_obj_;
97 }

◆ Size()

intptr_t dart::Message::Size ( ) const
inline

Definition at line 86 of file message.h.

86 {
87 intptr_t size = snapshot_length_;
88 if (finalizable_data_ != nullptr) {
89 size += finalizable_data_->external_size();
90 }
91 return size;
92 }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ snapshot()

uint8_t * dart::Message::snapshot ( ) const
inline

Definition at line 78 of file message.h.

78 {
80 return payload_.snapshot_;
81 }

◆ snapshot_length()

intptr_t dart::Message::snapshot_length ( ) const
inline

Definition at line 82 of file message.h.

82{ return snapshot_length_; }

Friends And Related Function Documentation

◆ MessageQueue

friend class MessageQueue
friend

Definition at line 137 of file message.h.

Member Data Documentation

◆ kIllegalPort

const Dart_Port Message::kIllegalPort = 0
static

Definition at line 47 of file message.h.


The documentation for this class was generated from the following files: