Flutter iOS Embedder
isolate_scope.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 namespace flutter {
8 
10  Dart_Isolate isolate = Dart_CurrentIsolate();
11  return Isolate(isolate);
12 }
13 
15  isolate_ = isolate.isolate_;
16  previous_ = Dart_CurrentIsolate();
17  if (previous_ == isolate_) {
18  return;
19  }
20  if (previous_) {
21  Dart_ExitIsolate();
22  }
23  Dart_EnterIsolate(isolate_);
24 };
25 
27  Dart_Isolate current = Dart_CurrentIsolate();
28  FML_DCHECK(!current || current == isolate_);
29  if (previous_ == isolate_) {
30  return;
31  }
32  if (current) {
33  Dart_ExitIsolate();
34  }
35  if (previous_) {
36  Dart_EnterIsolate(previous_);
37  }
38 }
39 
40 } // namespace flutter
static Isolate Current()
Definition: isolate_scope.cc:9
IsolateScope(const Isolate &isolate)