Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
dart::ApiNativeScope Class Reference

#include <dart_api_state.h>

Public Member Functions

 ApiNativeScope ()
 
 ~ApiNativeScope ()
 
Zonezone ()
 

Static Public Member Functions

static ApiNativeScopeCurrent ()
 

Detailed Description

Definition at line 644 of file dart_api_state.h.

Constructor & Destructor Documentation

◆ ApiNativeScope()

dart::ApiNativeScope::ApiNativeScope ( )
inline

Definition at line 646 of file dart_api_state.h.

646 {
647 // Currently no support for nesting native scopes.
648 ASSERT(Current() == nullptr);
649 OSThread::SetThreadLocal(Api::api_native_key_,
650 reinterpret_cast<uword>(this));
651 }
static ApiNativeScope * Current()
static void SetThreadLocal(ThreadLocalKey key, uword value)
#define ASSERT(E)
uintptr_t uword
Definition: globals.h:501

◆ ~ApiNativeScope()

dart::ApiNativeScope::~ApiNativeScope ( )
inline

Definition at line 653 of file dart_api_state.h.

653 {
654 ASSERT(Current() == this);
655 OSThread::SetThreadLocal(Api::api_native_key_, 0);
656 }

Member Function Documentation

◆ Current()

static ApiNativeScope * dart::ApiNativeScope::Current ( )
inlinestatic

Definition at line 658 of file dart_api_state.h.

658 {
659 return reinterpret_cast<ApiNativeScope*>(
660 OSThread::GetThreadLocal(Api::api_native_key_));
661 }
static uword GetThreadLocal(ThreadLocalKey key)
Definition: os_thread.h:222

◆ zone()

Zone * dart::ApiNativeScope::zone ( )
inline

Definition at line 663 of file dart_api_state.h.

663 {
664 Zone* result = zone_.GetZone();
665 ASSERT(result->handles()->CountScopedHandles() == 0);
666 ASSERT(result->handles()->CountZoneHandles() == 0);
667 return result;
668 }
Zone * GetZone()
GAsyncResult * result

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