Flutter Engine
tonic::DartIsolateScope Class Reference

#include <dart_isolate_scope.h>

Public Member Functions

 DartIsolateScope (Dart_Isolate isolate)
 
 ~DartIsolateScope ()
 

Detailed Description

Definition at line 14 of file dart_isolate_scope.h.

Constructor & Destructor Documentation

◆ DartIsolateScope()

tonic::DartIsolateScope::DartIsolateScope ( Dart_Isolate  isolate)
explicit

Definition at line 9 of file dart_isolate_scope.cc.

9  {
10  isolate_ = isolate;
11  previous_ = Dart_CurrentIsolate();
12  if (previous_ == isolate_)
13  return;
14  if (previous_)
15  Dart_ExitIsolate();
16  Dart_EnterIsolate(isolate_);
17 }

◆ ~DartIsolateScope()

tonic::DartIsolateScope::~DartIsolateScope ( )

Definition at line 19 of file dart_isolate_scope.cc.

References TONIC_DCHECK.

19  {
20  Dart_Isolate current = Dart_CurrentIsolate();
21  TONIC_DCHECK(!current || current == isolate_);
22  if (previous_ == isolate_)
23  return;
24  if (current)
25  Dart_ExitIsolate();
26  if (previous_)
27  Dart_EnterIsolate(previous_);
28 }
#define TONIC_DCHECK
Definition: macros.h:32

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