forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dart_isolate_group_data.cc
67 lines (53 loc) · 2.13 KB
/
dart_isolate_group_data.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/runtime/dart_isolate_group_data.h"
#include "flutter/runtime/dart_snapshot.h"
namespace flutter {
DartIsolateGroupData::DartIsolateGroupData(
const Settings& settings,
fml::RefPtr<const DartSnapshot> isolate_snapshot,
std::string advisory_script_uri,
std::string advisory_script_entrypoint,
const ChildIsolatePreparer& child_isolate_preparer,
const fml::closure& isolate_create_callback,
const fml::closure& isolate_shutdown_callback)
: settings_(settings),
isolate_snapshot_(isolate_snapshot),
advisory_script_uri_(advisory_script_uri),
advisory_script_entrypoint_(advisory_script_entrypoint),
child_isolate_preparer_(child_isolate_preparer),
isolate_create_callback_(isolate_create_callback),
isolate_shutdown_callback_(isolate_shutdown_callback) {
FML_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot.";
}
DartIsolateGroupData::~DartIsolateGroupData() = default;
const Settings& DartIsolateGroupData::GetSettings() const {
return settings_;
}
fml::RefPtr<const DartSnapshot> DartIsolateGroupData::GetIsolateSnapshot()
const {
return isolate_snapshot_;
}
const std::string& DartIsolateGroupData::GetAdvisoryScriptURI() const {
return advisory_script_uri_;
}
const std::string& DartIsolateGroupData::GetAdvisoryScriptEntrypoint() const {
return advisory_script_entrypoint_;
}
ChildIsolatePreparer DartIsolateGroupData::GetChildIsolatePreparer() const {
std::scoped_lock lock(child_isolate_preparer_mutex_);
return child_isolate_preparer_;
}
const fml::closure& DartIsolateGroupData::GetIsolateCreateCallback() const {
return isolate_create_callback_;
}
const fml::closure& DartIsolateGroupData::GetIsolateShutdownCallback() const {
return isolate_shutdown_callback_;
}
void DartIsolateGroupData::SetChildIsolatePreparer(
const ChildIsolatePreparer& value) {
std::scoped_lock lock(child_isolate_preparer_mutex_);
child_isolate_preparer_ = value;
}
} // namespace flutter