Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::ApiState Class Reference

#include <dart_api_state.h>

Public Member Functions

 ApiState ()
 
void MergeOtherApiState (ApiState *api_state)
 
void VisitObjectPointersUnlocked (ObjectPointerVisitor *visitor)
 
void VisitWeakHandlesUnlocked (HandleVisitor *visitor)
 
PersistentHandleAllocatePersistentHandle ()
 
void FreePersistentHandle (PersistentHandle *ref)
 
FinalizablePersistentHandleAllocateWeakPersistentHandle ()
 
void ClearWeakPersistentHandle (FinalizablePersistentHandle *weak_ref)
 
void FreeWeakPersistentHandle (FinalizablePersistentHandle *weak_ref)
 
bool IsValidPersistentHandle (Dart_PersistentHandle object)
 
bool IsActivePersistentHandle (Dart_PersistentHandle object)
 
bool IsValidWeakPersistentHandle (Dart_WeakPersistentHandle object)
 
bool IsValidFinalizableHandle (Dart_FinalizableHandle object)
 
bool IsActiveWeakPersistentHandle (Dart_WeakPersistentHandle object)
 
int CountPersistentHandles ()
 
void RunWithLockedPersistentHandles (std::function< void(PersistentHandles &)> fun)
 
void RunWithLockedWeakPersistentHandles (std::function< void(FinalizablePersistentHandles &)> fun)
 
WeakTableacquired_table ()
 

Detailed Description

Definition at line 695 of file dart_api_state.h.

Constructor & Destructor Documentation

◆ ApiState()

dart::ApiState::ApiState ( )
inline

Definition at line 697 of file dart_api_state.h.

697: persistent_handles_(), weak_persistent_handles_() {}

Member Function Documentation

◆ acquired_table()

WeakTable * dart::ApiState::acquired_table ( )
inline

Definition at line 778 of file dart_api_state.h.

778{ return &acquired_table_; }

◆ AllocatePersistentHandle()

PersistentHandle * dart::ApiState::AllocatePersistentHandle ( )
inline

Definition at line 712 of file dart_api_state.h.

712 {
713 MutexLocker ml(&mutex_);
714 return persistent_handles_.AllocateHandle();
715 }
PersistentHandle * AllocateHandle()

◆ AllocateWeakPersistentHandle()

FinalizablePersistentHandle * dart::ApiState::AllocateWeakPersistentHandle ( )
inline

Definition at line 721 of file dart_api_state.h.

721 {
722 MutexLocker ml(&mutex_);
723 return weak_persistent_handles_.AllocateHandle();
724 }
FinalizablePersistentHandle * AllocateHandle()

◆ ClearWeakPersistentHandle()

void dart::ApiState::ClearWeakPersistentHandle ( FinalizablePersistentHandle weak_ref)
inline

Definition at line 725 of file dart_api_state.h.

725 {
726 MutexLocker ml(&mutex_);
727 weak_persistent_handles_.ClearHandle(weak_ref);
728 }
void ClearHandle(FinalizablePersistentHandle *handle)

◆ CountPersistentHandles()

int dart::ApiState::CountPersistentHandles ( )
inline

Definition at line 761 of file dart_api_state.h.

761 {
762 MutexLocker ml(&mutex_);
763 return persistent_handles_.CountHandles();
764 }

◆ FreePersistentHandle()

void dart::ApiState::FreePersistentHandle ( PersistentHandle ref)
inline

Definition at line 716 of file dart_api_state.h.

716 {
717 MutexLocker ml(&mutex_);
718 persistent_handles_.FreeHandle(ref);
719 }
void FreeHandle(PersistentHandle *handle)

◆ FreeWeakPersistentHandle()

void dart::ApiState::FreeWeakPersistentHandle ( FinalizablePersistentHandle weak_ref)
inline

Definition at line 729 of file dart_api_state.h.

729 {
730 MutexLocker ml(&mutex_);
731 weak_persistent_handles_.FreeHandle(weak_ref);
732 }
void FreeHandle(FinalizablePersistentHandle *handle)

◆ IsActivePersistentHandle()

bool dart::ApiState::IsActivePersistentHandle ( Dart_PersistentHandle  object)
inline

Definition at line 739 of file dart_api_state.h.

739 {
740 MutexLocker ml(&mutex_);
741 return persistent_handles_.IsValidHandle(object) &&
742 !persistent_handles_.IsFreeHandle(object);
743 }
bool IsValidHandle(Dart_PersistentHandle object) const
bool IsFreeHandle(Dart_PersistentHandle object) const

◆ IsActiveWeakPersistentHandle()

bool dart::ApiState::IsActiveWeakPersistentHandle ( Dart_WeakPersistentHandle  object)
inline

Definition at line 755 of file dart_api_state.h.

755 {
756 MutexLocker ml(&mutex_);
757 return weak_persistent_handles_.IsValidHandle(object) &&
758 !weak_persistent_handles_.IsFreeHandle(object);
759 }
bool IsFreeHandle(Dart_WeakPersistentHandle object) const
bool IsValidHandle(Dart_WeakPersistentHandle object) const

◆ IsValidFinalizableHandle()

bool dart::ApiState::IsValidFinalizableHandle ( Dart_FinalizableHandle  object)
inline

Definition at line 750 of file dart_api_state.h.

750 {
751 MutexLocker ml(&mutex_);
752 return weak_persistent_handles_.IsValidHandle(object);
753 }

◆ IsValidPersistentHandle()

bool dart::ApiState::IsValidPersistentHandle ( Dart_PersistentHandle  object)
inline

Definition at line 734 of file dart_api_state.h.

734 {
735 MutexLocker ml(&mutex_);
736 return persistent_handles_.IsValidHandle(object);
737 }

◆ IsValidWeakPersistentHandle()

bool dart::ApiState::IsValidWeakPersistentHandle ( Dart_WeakPersistentHandle  object)
inline

Definition at line 745 of file dart_api_state.h.

745 {
746 MutexLocker ml(&mutex_);
747 return weak_persistent_handles_.IsValidHandle(object);
748 }

◆ MergeOtherApiState()

void dart::ApiState::MergeOtherApiState ( ApiState api_state)

◆ RunWithLockedPersistentHandles()

void dart::ApiState::RunWithLockedPersistentHandles ( std::function< void(PersistentHandles &)>  fun)
inline

Definition at line 766 of file dart_api_state.h.

767 {
768 MutexLocker ml(&mutex_);
769 fun(persistent_handles_);
770 }

◆ RunWithLockedWeakPersistentHandles()

void dart::ApiState::RunWithLockedWeakPersistentHandles ( std::function< void(FinalizablePersistentHandles &)>  fun)
inline

Definition at line 772 of file dart_api_state.h.

773 {
774 MutexLocker ml(&mutex_);
775 fun(weak_persistent_handles_);
776 }

◆ VisitObjectPointersUnlocked()

void dart::ApiState::VisitObjectPointersUnlocked ( ObjectPointerVisitor visitor)
inline

Definition at line 701 of file dart_api_state.h.

701 {
702 persistent_handles_.VisitObjectPointers(visitor);
703 if (visitor->visit_weak_persistent_handles()) {
704 weak_persistent_handles_.VisitObjectPointers(visitor);
705 }
706 }
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void VisitObjectPointers(ObjectPointerVisitor *visitor)

◆ VisitWeakHandlesUnlocked()

void dart::ApiState::VisitWeakHandlesUnlocked ( HandleVisitor visitor)
inline

Definition at line 708 of file dart_api_state.h.

708 {
709 weak_persistent_handles_.VisitHandles(visitor);
710 }
void VisitHandles(HandleVisitor *visitor)

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