Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::PersistentHandleVisitor< T > Class Template Reference
Inheritance diagram for dart::PersistentHandleVisitor< T >:
dart::HandleVisitor

Public Member Functions

 PersistentHandleVisitor (Thread *thread, JSONArray *handles)
 
void Append (PersistentHandle *persistent_handle)
 
void Append (FinalizablePersistentHandle *weak_persistent_handle)
 
- Public Member Functions inherited from dart::HandleVisitor
 HandleVisitor (Thread *thread)
 
virtual ~HandleVisitor ()
 
Threadthread () const
 

Protected Member Functions

void VisitHandle (uword addr) override
 

Protected Attributes

JSONArrayhandles_
 

Detailed Description

template<typename T>
class dart::PersistentHandleVisitor< T >

Definition at line 4896 of file service.cc.

Constructor & Destructor Documentation

◆ PersistentHandleVisitor()

template<typename T >
dart::PersistentHandleVisitor< T >::PersistentHandleVisitor ( Thread thread,
JSONArray handles 
)
inline

Definition at line 4898 of file service.cc.

4899 : HandleVisitor(thread), handles_(handles) {
4900 ASSERT(handles_ != nullptr);
4901 }
HandleVisitor(Thread *thread)
Thread * thread() const
#define ASSERT(E)

Member Function Documentation

◆ Append() [1/2]

template<typename T >
void dart::PersistentHandleVisitor< T >::Append ( FinalizablePersistentHandle weak_persistent_handle)
inline

Definition at line 4910 of file service.cc.

4910 {
4911 if (!weak_persistent_handle->ptr()->IsHeapObject()) {
4912 return; // Free handle.
4913 }
4914
4915 JSONObject obj(handles_);
4916 obj.AddProperty("type", "_WeakPersistentHandle");
4917 const Object& object = Object::Handle(weak_persistent_handle->ptr());
4918 obj.AddProperty("object", object);
4919 obj.AddPropertyF(
4920 "peer", "0x%" Px "",
4921 reinterpret_cast<uintptr_t>(weak_persistent_handle->peer()));
4922 obj.AddPropertyF(
4923 "callbackAddress", "0x%" Px "",
4924 reinterpret_cast<uintptr_t>(weak_persistent_handle->callback()));
4925 // Attempt to include a native symbol name.
4927 reinterpret_cast<uword>(weak_persistent_handle->callback()), nullptr);
4928 obj.AddProperty("callbackSymbolName", (name == nullptr) ? "" : name);
4929 if (name != nullptr) {
4931 }
4932 obj.AddPropertyF("externalSize", "%" Pd "",
4933 weak_persistent_handle->external_size());
4934 }
static void FreeSymbolName(char *name)
static char * LookupSymbolName(uword pc, uword *start)
static Object & Handle()
Definition object.h:407
const char *const name
uintptr_t uword
Definition globals.h:501
#define Px
Definition globals.h:410
#define Pd
Definition globals.h:408

◆ Append() [2/2]

template<typename T >
void dart::PersistentHandleVisitor< T >::Append ( PersistentHandle persistent_handle)
inline

Definition at line 4903 of file service.cc.

4903 {
4904 JSONObject obj(handles_);
4905 obj.AddProperty("type", "_PersistentHandle");
4906 const Object& object = Object::Handle(persistent_handle->ptr());
4907 obj.AddProperty("object", object);
4908 }

◆ VisitHandle()

template<typename T >
void dart::PersistentHandleVisitor< T >::VisitHandle ( uword  addr)
inlineoverrideprotectedvirtual

Implements dart::HandleVisitor.

Definition at line 4937 of file service.cc.

4937 {
4938 T* handle = reinterpret_cast<T*>(addr);
4939 Append(handle);
4940 }
void Append(PersistentHandle *persistent_handle)
Definition service.cc:4903
#define T

Member Data Documentation

◆ handles_

template<typename T >
JSONArray* dart::PersistentHandleVisitor< T >::handles_
protected

Definition at line 4942 of file service.cc.


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