5#include "flutter/runtime/dart_vm_data.h"
15 if (!vm_snapshot || !vm_snapshot->IsValid()) {
21 <<
"VM snapshot invalid and could not be inferred from settings.";
26 if (!isolate_snapshot || !isolate_snapshot->IsValid()) {
30 if (!isolate_snapshot) {
31 FML_LOG(
ERROR) <<
"Isolate snapshot invalid and could not be inferred "
40 return std::shared_ptr<const DartVMData>(
new DartVMData(
42 std::move(vm_snapshot),
43 std::move(isolate_snapshot),
44 std::move(service_isolate_snapshot)
53 vm_snapshot_(
std::move(vm_snapshot)),
54 isolate_snapshot_(
std::move(isolate_snapshot)),
55 service_isolate_snapshot_(
std::move(service_isolate_snapshot)) {}
68 return isolate_snapshot_;
74 return service_isolate_snapshot_ ? service_isolate_snapshot_
79 if (service_isolate_snapshot_) {
86 return isolate_snapshot_->IsNullSafetyEnabled(
nullptr);
A read-only Dart heap snapshot, or, read-executable mapping of AOT compiled Dart code.
static fml::RefPtr< DartSnapshot > VMServiceIsolateSnapshotFromSettings(const Settings &settings)
Create an isolate snapshot specialized for launching the service isolate. Returns nullptr if no such ...
static fml::RefPtr< const DartSnapshot > VMSnapshotFromSettings(const Settings &settings)
From the fields present in the given settings object, infer the core snapshot.
static fml::RefPtr< const DartSnapshot > IsolateSnapshotFromSettings(const Settings &settings)
From the fields present in the given settings object, infer the isolate snapshot.
Provides thread-safe access to data that is necessary to bootstrap a new Dart VM instance....
fml::RefPtr< const DartSnapshot > GetIsolateSnapshot() const
Get the isolate snapshot necessary to launch isolates in the Dart VM. The Dart VM instance in which t...
const DartSnapshot & GetVMSnapshot() const
Gets the VM snapshot. This can be in the call to bootstrap the Dart VM via Dart_Initialize.
~DartVMData()
Collect the DartVMData instance.
bool GetServiceIsolateSnapshotNullSafety() const
Returns whether the service isolate snapshot requires null safety in the Dart_IsolateFlags used to cr...
const Settings & GetSettings() const
The settings object from which the Dart snapshots were inferred.
fml::RefPtr< const DartSnapshot > GetServiceIsolateSnapshot() const
Get the isolate snapshot used to launch the service isolate in the Dart VM.
static std::shared_ptr< const DartVMData > Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot, fml::RefPtr< const DartSnapshot > isolate_snapshot)
Creates a new instance of DartVMData. Both the VM and isolate snapshot members are optional and may b...
#define FML_LOG(severity)