Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::TransferableTypedDataMessageSerializationCluster Class Reference
Inheritance diagram for dart::TransferableTypedDataMessageSerializationCluster:
dart::MessageSerializationCluster dart::ZoneAllocated

Public Member Functions

 TransferableTypedDataMessageSerializationCluster ()
 
 ~TransferableTypedDataMessageSerializationCluster ()
 
void Trace (MessageSerializer *s, Object *object)
 
void WriteNodes (MessageSerializer *s)
 
- Public Member Functions inherited from dart::MessageSerializationCluster
 MessageSerializationCluster (const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)
 
virtual ~MessageSerializationCluster ()
 
virtual void Trace (MessageSerializer *s, Object *object)=0
 
virtual void WriteNodes (MessageSerializer *s)=0
 
virtual void WriteEdges (MessageSerializer *s)
 
virtual void TraceApi (ApiMessageSerializer *s, Dart_CObject *object)
 
virtual void WriteNodesApi (ApiMessageSerializer *s)
 
virtual void WriteEdgesApi (ApiMessageSerializer *s)
 
const char * name () const
 
MessagePhase phase () const
 
intptr_t cid () const
 
bool is_canonical () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::MessageSerializationCluster
 DISALLOW_COPY_AND_ASSIGN (MessageSerializationCluster)
 
- Protected Attributes inherited from dart::MessageSerializationCluster
const char *const name_
 
const MessagePhase phase_
 
const intptr_t cid_
 
const bool is_canonical_
 

Detailed Description

Definition at line 1799 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ TransferableTypedDataMessageSerializationCluster()

dart::TransferableTypedDataMessageSerializationCluster::TransferableTypedDataMessageSerializationCluster ( )
inline

Definition at line 1802 of file message_snapshot.cc.

1803 : MessageSerializationCluster("TransferableTypedData",
1805 kTransferableTypedDataCid) {}
MessageSerializationCluster(const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)

◆ ~TransferableTypedDataMessageSerializationCluster()

dart::TransferableTypedDataMessageSerializationCluster::~TransferableTypedDataMessageSerializationCluster ( )
inline

Definition at line 1806 of file message_snapshot.cc.

1806{}

Member Function Documentation

◆ Trace()

void dart::TransferableTypedDataMessageSerializationCluster::Trace ( MessageSerializer s,
Object object 
)
inlinevirtual

Implements dart::MessageSerializationCluster.

Definition at line 1808 of file message_snapshot.cc.

1808 {
1809 TransferableTypedData* transferable =
1810 static_cast<TransferableTypedData*>(object);
1811 objects_.Add(transferable);
1812
1813 void* peer = s->thread()->heap()->GetPeer(transferable->ptr());
1814 // Assume that object's Peer is only used to track transferability state.
1815 ASSERT(peer != nullptr);
1816 TransferableTypedDataPeer* tpeer =
1817 reinterpret_cast<TransferableTypedDataPeer*>(peer);
1818 if (tpeer->data() == nullptr) {
1819 s->IllegalObject(*object,
1820 "TransferableTypedData has been transferred already");
1821 }
1822 }
#define ASSERT(E)
struct MyStruct s

◆ WriteNodes()

void dart::TransferableTypedDataMessageSerializationCluster::WriteNodes ( MessageSerializer s)
inlinevirtual

Implements dart::MessageSerializationCluster.

Definition at line 1824 of file message_snapshot.cc.

1824 {
1825 const intptr_t count = objects_.length();
1826 s->WriteUnsigned(count);
1827 for (intptr_t i = 0; i < count; i++) {
1828 TransferableTypedData* transferable = objects_[i];
1829 s->AssignRef(transferable);
1830
1831 void* peer = s->thread()->heap()->GetPeer(transferable->ptr());
1832 // Assume that object's Peer is only used to track transferability state.
1833 ASSERT(peer != nullptr);
1834 TransferableTypedDataPeer* tpeer =
1835 reinterpret_cast<TransferableTypedDataPeer*>(peer);
1836 intptr_t length = tpeer->length(); // In bytes.
1837 void* data = tpeer->data();
1838 ASSERT(data != nullptr);
1839 s->WriteUnsigned(length);
1840 s->finalizable_data()->Put(
1841 length, data, tpeer,
1842 // Finalizer does nothing - in case of failure to serialize,
1843 // [data] remains wrapped in sender's [TransferableTypedData].
1844 [](void* data, void* peer) {},
1845 // This is invoked on successful serialization of the message
1846 [](void* data, void* peer) {
1847 TransferableTypedDataPeer* ttpeer =
1848 reinterpret_cast<TransferableTypedDataPeer*>(peer);
1849 ttpeer->handle()->EnsureFreedExternal(IsolateGroup::Current());
1850 ttpeer->ClearData();
1851 });
1852 }
1853 }
int count
Definition: FontMgrTest.cpp:50
static IsolateGroup * Current()
Definition: isolate.h:539
size_t length
static int8_t data[kExtLength]

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