mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[fuchsia] Plumbing for sharing between AOT snapshots. (flutter/engine#5351)
This commit is contained in:
parent
3a8f6b63a0
commit
e94cb4f2f9
@ -35,6 +35,7 @@ namespace blink {
|
||||
fml::WeakPtr<DartIsolate> DartIsolate::CreateRootIsolate(
|
||||
const DartVM* vm,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot,
|
||||
TaskRunners task_runners,
|
||||
std::unique_ptr<Window> window,
|
||||
fml::WeakPtr<GrContext> resource_context,
|
||||
@ -54,6 +55,7 @@ fml::WeakPtr<DartIsolate> DartIsolate::CreateRootIsolate(
|
||||
auto root_embedder_data = std::make_unique<DartIsolate>(
|
||||
vm, // VM
|
||||
std::move(isolate_snapshot), // isolate snapshot
|
||||
std::move(shared_snapshot), // shared snapshot
|
||||
task_runners, // task runners
|
||||
std::move(resource_context), // resource context
|
||||
std::move(unref_queue), // skia unref queue
|
||||
@ -94,6 +96,7 @@ fml::WeakPtr<DartIsolate> DartIsolate::CreateRootIsolate(
|
||||
|
||||
DartIsolate::DartIsolate(const DartVM* vm,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot,
|
||||
TaskRunners task_runners,
|
||||
fml::WeakPtr<GrContext> resource_context,
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> unref_queue,
|
||||
@ -110,6 +113,7 @@ DartIsolate::DartIsolate(const DartVM* vm,
|
||||
vm->GetSettings().log_tag),
|
||||
vm_(vm),
|
||||
isolate_snapshot_(std::move(isolate_snapshot)),
|
||||
shared_snapshot_(std::move(shared_snapshot)),
|
||||
child_isolate_preparer_(std::move(child_isolate_preparer)),
|
||||
weak_factory_(std::make_unique<fml::WeakPtrFactory<DartIsolate>>(this)) {
|
||||
FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot.";
|
||||
@ -285,8 +289,8 @@ static bool LoadScriptSnapshot(std::shared_ptr<const fml::Mapping> mapping,
|
||||
|
||||
static bool LoadKernelSnapshot(std::shared_ptr<const fml::Mapping> mapping,
|
||||
bool last_piece) {
|
||||
Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(),
|
||||
mapping->GetSize());
|
||||
Dart_Handle library =
|
||||
Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize());
|
||||
if (tonic::LogIfError(library)) {
|
||||
return false;
|
||||
}
|
||||
@ -533,6 +537,7 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(
|
||||
DartIsolate::CreateRootIsolate(
|
||||
vm.get(), // vm
|
||||
vm->GetIsolateSnapshot(), // isolate snapshot
|
||||
vm->GetSharedSnapshot(), // shared snapshot
|
||||
null_task_runners, // task runners
|
||||
nullptr, // window
|
||||
{}, // resource context
|
||||
@ -657,6 +662,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(
|
||||
embedder_isolate = std::make_unique<DartIsolate>(
|
||||
vm, // vm
|
||||
raw_embedder_isolate->GetIsolateSnapshot(), // isolate_snapshot
|
||||
raw_embedder_isolate->GetSharedSnapshot(), // shared_snapshot
|
||||
null_task_runners, // task_runners
|
||||
fml::WeakPtr<GrContext>{}, // resource_context
|
||||
nullptr, // unref_queue
|
||||
@ -678,18 +684,20 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(
|
||||
embedder_isolate.get(), //
|
||||
error //
|
||||
)
|
||||
: Dart_CreateIsolate(advisory_script_uri, //
|
||||
advisory_script_entrypoint, //
|
||||
embedder_isolate->GetIsolateSnapshot()
|
||||
->GetData()
|
||||
->GetSnapshotPointer(), //
|
||||
embedder_isolate->GetIsolateSnapshot()
|
||||
->GetInstructionsIfPresent(), //
|
||||
nullptr, //
|
||||
nullptr, //
|
||||
flags, //
|
||||
embedder_isolate.get(), //
|
||||
error //
|
||||
: Dart_CreateIsolate(
|
||||
advisory_script_uri, //
|
||||
advisory_script_entrypoint, //
|
||||
embedder_isolate->GetIsolateSnapshot()
|
||||
->GetData()
|
||||
->GetSnapshotPointer(), //
|
||||
embedder_isolate->GetIsolateSnapshot()
|
||||
->GetInstructionsIfPresent(), //
|
||||
embedder_isolate->GetSharedSnapshot()->GetDataIfPresent(), //
|
||||
embedder_isolate->GetSharedSnapshot()
|
||||
->GetInstructionsIfPresent(), //
|
||||
flags, //
|
||||
embedder_isolate.get(), //
|
||||
error //
|
||||
);
|
||||
|
||||
if (isolate == nullptr) {
|
||||
@ -753,6 +761,10 @@ fxl::RefPtr<DartSnapshot> DartIsolate::GetIsolateSnapshot() const {
|
||||
return isolate_snapshot_;
|
||||
}
|
||||
|
||||
fxl::RefPtr<DartSnapshot> DartIsolate::GetSharedSnapshot() const {
|
||||
return shared_snapshot_;
|
||||
}
|
||||
|
||||
fml::WeakPtr<DartIsolate> DartIsolate::GetWeakIsolatePtr() const {
|
||||
return weak_factory_ ? weak_factory_->GetWeakPtr()
|
||||
: fml::WeakPtr<DartIsolate>();
|
||||
|
||||
@ -41,6 +41,7 @@ class DartIsolate : public UIDartState {
|
||||
static fml::WeakPtr<DartIsolate> CreateRootIsolate(
|
||||
const DartVM* vm,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot,
|
||||
TaskRunners task_runners,
|
||||
std::unique_ptr<Window> window,
|
||||
fml::WeakPtr<GrContext> resource_context,
|
||||
@ -51,6 +52,7 @@ class DartIsolate : public UIDartState {
|
||||
|
||||
DartIsolate(const DartVM* vm,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot,
|
||||
TaskRunners task_runners,
|
||||
fml::WeakPtr<GrContext> resource_context,
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> unref_queue,
|
||||
@ -85,6 +87,7 @@ class DartIsolate : public UIDartState {
|
||||
const DartVM* GetDartVM() const;
|
||||
|
||||
fxl::RefPtr<DartSnapshot> GetIsolateSnapshot() const;
|
||||
fxl::RefPtr<DartSnapshot> GetSharedSnapshot() const;
|
||||
|
||||
fml::WeakPtr<DartIsolate> GetWeakIsolatePtr() const;
|
||||
|
||||
@ -107,6 +110,7 @@ class DartIsolate : public UIDartState {
|
||||
const DartVM* vm_ = nullptr;
|
||||
Phase phase_ = Phase::Unknown;
|
||||
const fxl::RefPtr<DartSnapshot> isolate_snapshot_;
|
||||
const fxl::RefPtr<DartSnapshot> shared_snapshot_;
|
||||
std::vector<std::unique_ptr<AutoFireClosure>> shutdown_callbacks_;
|
||||
ChildIsolatePreparer child_isolate_preparer_;
|
||||
std::unique_ptr<fml::WeakPtrFactory<DartIsolate>> weak_factory_;
|
||||
|
||||
@ -32,6 +32,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) {
|
||||
auto root_isolate = DartIsolate::CreateRootIsolate(
|
||||
vm.get(), // vm
|
||||
vm->GetIsolateSnapshot(), // isolate snapshot
|
||||
vm->GetSharedSnapshot(), // shared snapshot
|
||||
std::move(task_runners), // task runners
|
||||
nullptr, // window
|
||||
{}, // resource context
|
||||
@ -57,6 +58,7 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) {
|
||||
auto root_isolate = DartIsolate::CreateRootIsolate(
|
||||
vm.get(), // vm
|
||||
vm->GetIsolateSnapshot(), // isolate snapshot
|
||||
vm->GetSharedSnapshot(), // shared snapshot
|
||||
std::move(task_runners), // task runners
|
||||
nullptr, // window
|
||||
{}, // resource context
|
||||
@ -85,6 +87,7 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) {
|
||||
auto root_isolate = DartIsolate::CreateRootIsolate(
|
||||
vm.get(), // vm
|
||||
vm->GetIsolateSnapshot(), // isolate snapshot
|
||||
vm->GetSharedSnapshot(), // shared snapshot
|
||||
std::move(task_runners), // task runners
|
||||
nullptr, // window
|
||||
{}, // resource context
|
||||
|
||||
@ -170,6 +170,10 @@ fxl::RefPtr<DartSnapshot> DartSnapshot::IsolateSnapshotFromSettings(
|
||||
#endif
|
||||
}
|
||||
|
||||
fxl::RefPtr<DartSnapshot> DartSnapshot::Empty() {
|
||||
return fxl::MakeRefCounted<DartSnapshot>(nullptr, nullptr);
|
||||
}
|
||||
|
||||
DartSnapshot::DartSnapshot(std::unique_ptr<DartSnapshotBuffer> data,
|
||||
std::unique_ptr<DartSnapshotBuffer> instructions)
|
||||
: data_(std::move(data)), instructions_(std::move(instructions)) {}
|
||||
@ -192,6 +196,10 @@ const DartSnapshotBuffer* DartSnapshot::GetInstructions() const {
|
||||
return instructions_.get();
|
||||
}
|
||||
|
||||
const uint8_t* DartSnapshot::GetDataIfPresent() const {
|
||||
return data_ ? data_->GetSnapshotPointer() : nullptr;
|
||||
}
|
||||
|
||||
const uint8_t* DartSnapshot::GetInstructionsIfPresent() const {
|
||||
return instructions_ ? instructions_->GetSnapshotPointer() : nullptr;
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@ class DartSnapshot : public fxl::RefCountedThreadSafe<DartSnapshot> {
|
||||
static fxl::RefPtr<DartSnapshot> IsolateSnapshotFromSettings(
|
||||
const Settings& settings);
|
||||
|
||||
static fxl::RefPtr<DartSnapshot> Empty();
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
bool IsValidForAOT() const;
|
||||
@ -36,6 +38,8 @@ class DartSnapshot : public fxl::RefCountedThreadSafe<DartSnapshot> {
|
||||
|
||||
const DartSnapshotBuffer* GetInstructions() const;
|
||||
|
||||
const uint8_t* GetDataIfPresent() const;
|
||||
|
||||
const uint8_t* GetInstructionsIfPresent() const;
|
||||
|
||||
private:
|
||||
|
||||
@ -228,7 +228,7 @@ static void EmbedderInformationCallback(Dart_EmbedderInformation* info) {
|
||||
}
|
||||
|
||||
fxl::RefPtr<DartVM> DartVM::ForProcess(Settings settings) {
|
||||
return ForProcess(settings, nullptr, nullptr);
|
||||
return ForProcess(settings, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
static std::once_flag gVMInitialization;
|
||||
@ -237,10 +237,12 @@ static fxl::RefPtr<DartVM> gVM;
|
||||
fxl::RefPtr<DartVM> DartVM::ForProcess(
|
||||
Settings settings,
|
||||
fxl::RefPtr<DartSnapshot> vm_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot) {
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot) {
|
||||
std::call_once(gVMInitialization, [settings, //
|
||||
vm_snapshot, //
|
||||
isolate_snapshot //
|
||||
isolate_snapshot, //
|
||||
shared_snapshot //
|
||||
]() mutable {
|
||||
if (!vm_snapshot) {
|
||||
vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings);
|
||||
@ -248,9 +250,13 @@ fxl::RefPtr<DartVM> DartVM::ForProcess(
|
||||
if (!isolate_snapshot) {
|
||||
isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings);
|
||||
}
|
||||
if (!shared_snapshot) {
|
||||
shared_snapshot = DartSnapshot::Empty();
|
||||
}
|
||||
gVM = fxl::MakeRefCounted<DartVM>(settings, //
|
||||
std::move(vm_snapshot), //
|
||||
std::move(isolate_snapshot) //
|
||||
std::move(isolate_snapshot), //
|
||||
std::move(shared_snapshot) //
|
||||
);
|
||||
});
|
||||
return gVM;
|
||||
@ -262,10 +268,12 @@ fxl::RefPtr<DartVM> DartVM::ForProcessIfInitialized() {
|
||||
|
||||
DartVM::DartVM(const Settings& settings,
|
||||
fxl::RefPtr<DartSnapshot> vm_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot)
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot)
|
||||
: settings_(settings),
|
||||
vm_snapshot_(std::move(vm_snapshot)),
|
||||
isolate_snapshot_(std::move(isolate_snapshot)),
|
||||
shared_snapshot_(std::move(shared_snapshot)),
|
||||
platform_kernel_mapping_(
|
||||
std::make_unique<fml::FileMapping>(settings.platform_kernel_path)),
|
||||
weak_factory_(this) {
|
||||
@ -454,6 +462,10 @@ fxl::RefPtr<DartSnapshot> DartVM::GetIsolateSnapshot() const {
|
||||
return isolate_snapshot_;
|
||||
}
|
||||
|
||||
fxl::RefPtr<DartSnapshot> DartVM::GetSharedSnapshot() const {
|
||||
return shared_snapshot_;
|
||||
}
|
||||
|
||||
ServiceProtocol& DartVM::GetServiceProtocol() {
|
||||
return service_protocol_;
|
||||
}
|
||||
|
||||
@ -30,7 +30,8 @@ class DartVM : public fxl::RefCountedThreadSafe<DartVM> {
|
||||
static fxl::RefPtr<DartVM> ForProcess(
|
||||
Settings settings,
|
||||
fxl::RefPtr<DartSnapshot> vm_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot);
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot);
|
||||
|
||||
static fxl::RefPtr<DartVM> ForProcessIfInitialized();
|
||||
|
||||
@ -43,6 +44,7 @@ class DartVM : public fxl::RefCountedThreadSafe<DartVM> {
|
||||
const DartSnapshot& GetVMSnapshot() const;
|
||||
|
||||
fxl::RefPtr<DartSnapshot> GetIsolateSnapshot() const;
|
||||
fxl::RefPtr<DartSnapshot> GetSharedSnapshot() const;
|
||||
|
||||
fxl::WeakPtr<DartVM> GetWeakPtr();
|
||||
|
||||
@ -52,13 +54,15 @@ class DartVM : public fxl::RefCountedThreadSafe<DartVM> {
|
||||
const Settings settings_;
|
||||
const fxl::RefPtr<DartSnapshot> vm_snapshot_;
|
||||
const fxl::RefPtr<DartSnapshot> isolate_snapshot_;
|
||||
const fxl::RefPtr<DartSnapshot> shared_snapshot_;
|
||||
std::unique_ptr<fml::Mapping> platform_kernel_mapping_;
|
||||
ServiceProtocol service_protocol_;
|
||||
fxl::WeakPtrFactory<DartVM> weak_factory_;
|
||||
|
||||
DartVM(const Settings& settings,
|
||||
fxl::RefPtr<DartSnapshot> vm_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot);
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot);
|
||||
|
||||
~DartVM();
|
||||
|
||||
|
||||
@ -22,12 +22,14 @@ RuntimeController::RuntimeController(
|
||||
RuntimeDelegate& p_client,
|
||||
const DartVM* p_vm,
|
||||
fxl::RefPtr<DartSnapshot> p_isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> p_shared_snapshot,
|
||||
TaskRunners p_task_runners,
|
||||
fml::WeakPtr<GrContext> p_resource_context,
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> p_unref_queue)
|
||||
: RuntimeController(p_client,
|
||||
p_vm,
|
||||
std::move(p_isolate_snapshot),
|
||||
std::move(p_shared_snapshot),
|
||||
std::move(p_task_runners),
|
||||
std::move(p_resource_context),
|
||||
std::move(p_unref_queue),
|
||||
@ -37,6 +39,7 @@ RuntimeController::RuntimeController(
|
||||
RuntimeDelegate& p_client,
|
||||
const DartVM* p_vm,
|
||||
fxl::RefPtr<DartSnapshot> p_isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> p_shared_snapshot,
|
||||
TaskRunners p_task_runners,
|
||||
fml::WeakPtr<GrContext> p_resource_context,
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> p_unref_queue,
|
||||
@ -44,6 +47,7 @@ RuntimeController::RuntimeController(
|
||||
: client_(p_client),
|
||||
vm_(p_vm),
|
||||
isolate_snapshot_(std::move(p_isolate_snapshot)),
|
||||
shared_snapshot_(std::move(p_shared_snapshot)),
|
||||
task_runners_(p_task_runners),
|
||||
resource_context_(p_resource_context),
|
||||
unref_queue_(p_unref_queue),
|
||||
@ -51,6 +55,7 @@ RuntimeController::RuntimeController(
|
||||
root_isolate_(
|
||||
DartIsolate::CreateRootIsolate(vm_,
|
||||
isolate_snapshot_,
|
||||
shared_snapshot_,
|
||||
task_runners_,
|
||||
std::make_unique<Window>(this),
|
||||
resource_context_,
|
||||
@ -94,6 +99,7 @@ std::unique_ptr<RuntimeController> RuntimeController::Clone() const {
|
||||
client_, //
|
||||
vm_, //
|
||||
isolate_snapshot_, //
|
||||
shared_snapshot_, //
|
||||
task_runners_, //
|
||||
resource_context_, //
|
||||
unref_queue_, //
|
||||
|
||||
@ -26,6 +26,7 @@ class RuntimeController final : public WindowClient {
|
||||
RuntimeController(RuntimeDelegate& client,
|
||||
const DartVM* vm,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot,
|
||||
TaskRunners task_runners,
|
||||
fml::WeakPtr<GrContext> resource_context,
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> unref_queue);
|
||||
@ -81,6 +82,7 @@ class RuntimeController final : public WindowClient {
|
||||
RuntimeDelegate& client_;
|
||||
const DartVM* vm_;
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot_;
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot_;
|
||||
TaskRunners task_runners_;
|
||||
fml::WeakPtr<GrContext> resource_context_;
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> unref_queue_;
|
||||
@ -91,6 +93,7 @@ class RuntimeController final : public WindowClient {
|
||||
RuntimeController(RuntimeDelegate& client,
|
||||
const DartVM* vm,
|
||||
fxl::RefPtr<DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<DartSnapshot> shared_snapshot,
|
||||
TaskRunners task_runners,
|
||||
fml::WeakPtr<GrContext> resource_context,
|
||||
fxl::RefPtr<flow::SkiaUnrefQueue> unref_queue,
|
||||
|
||||
@ -38,6 +38,7 @@ static constexpr char kSettingsChannel[] = "flutter/settings";
|
||||
Engine::Engine(Delegate& delegate,
|
||||
const blink::DartVM& vm,
|
||||
fxl::RefPtr<blink::DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<blink::DartSnapshot> shared_snapshot,
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
std::unique_ptr<Animator> animator,
|
||||
@ -57,6 +58,7 @@ Engine::Engine(Delegate& delegate,
|
||||
*this, // runtime delegate
|
||||
&vm, // VM
|
||||
std::move(isolate_snapshot), // isolate snapshot
|
||||
std::move(shared_snapshot), // shared snapshot
|
||||
std::move(task_runners), // task runners
|
||||
std::move(resource_context), // resource context
|
||||
std::move(unref_queue) // skia unref queue
|
||||
|
||||
@ -41,6 +41,7 @@ class Engine final : public blink::RuntimeDelegate {
|
||||
Engine(Delegate& delegate,
|
||||
const blink::DartVM& vm,
|
||||
fxl::RefPtr<blink::DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<blink::DartSnapshot> shared_snapshot,
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
std::unique_ptr<Animator> animator,
|
||||
|
||||
@ -41,6 +41,7 @@ std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
fxl::RefPtr<blink::DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<blink::DartSnapshot> shared_snapshot,
|
||||
Shell::CreateCallback<PlatformView> on_create_platform_view,
|
||||
Shell::CreateCallback<Rasterizer> on_create_rasterizer) {
|
||||
if (!task_runners.IsValid()) {
|
||||
@ -112,6 +113,7 @@ std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(
|
||||
&engine, //
|
||||
shell = shell.get(), //
|
||||
isolate_snapshot = std::move(isolate_snapshot), //
|
||||
shared_snapshot = std::move(shared_snapshot), //
|
||||
vsync_waiter = std::move(vsync_waiter), //
|
||||
resource_context = std::move(resource_context), //
|
||||
unref_queue = std::move(unref_queue) //
|
||||
@ -126,6 +128,7 @@ std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(
|
||||
engine = std::make_unique<Engine>(*shell, //
|
||||
shell->GetDartVM(), //
|
||||
std::move(isolate_snapshot), //
|
||||
std::move(shared_snapshot), //
|
||||
task_runners, //
|
||||
shell->GetSettings(), //
|
||||
std::move(animator), //
|
||||
@ -202,7 +205,8 @@ static void PerformInitializationTasks(const blink::Settings& settings) {
|
||||
});
|
||||
}
|
||||
|
||||
std::unique_ptr<Shell> Shell::Create(
|
||||
|
||||
std::unique_ptr<Shell> Shell::Create(
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
Shell::CreateCallback<PlatformView> on_create_platform_view,
|
||||
@ -214,6 +218,7 @@ std::unique_ptr<Shell> Shell::Create(
|
||||
return Shell::Create(std::move(task_runners), //
|
||||
std::move(settings), //
|
||||
vm->GetIsolateSnapshot(), //
|
||||
blink::DartSnapshot::Empty(), //
|
||||
std::move(on_create_platform_view), //
|
||||
std::move(on_create_rasterizer) //
|
||||
);
|
||||
@ -223,6 +228,7 @@ std::unique_ptr<Shell> Shell::Create(
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
fxl::RefPtr<blink::DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<blink::DartSnapshot> shared_snapshot,
|
||||
Shell::CreateCallback<PlatformView> on_create_platform_view,
|
||||
Shell::CreateCallback<Rasterizer> on_create_rasterizer) {
|
||||
PerformInitializationTasks(settings);
|
||||
@ -241,12 +247,14 @@ std::unique_ptr<Shell> Shell::Create(
|
||||
task_runners = std::move(task_runners), //
|
||||
settings, //
|
||||
isolate_snapshot = std::move(isolate_snapshot), //
|
||||
shared_snapshot = std::move(shared_snapshot), //
|
||||
on_create_platform_view, //
|
||||
on_create_rasterizer //
|
||||
]() {
|
||||
shell = CreateShellOnPlatformThread(std::move(task_runners), //
|
||||
settings, //
|
||||
std::move(isolate_snapshot), //
|
||||
std::move(shared_snapshot), //
|
||||
on_create_platform_view, //
|
||||
on_create_rasterizer //
|
||||
);
|
||||
|
||||
@ -56,6 +56,7 @@ class Shell final : public PlatformView::Delegate,
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
fxl::RefPtr<blink::DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<blink::DartSnapshot> shared_snapshot,
|
||||
CreateCallback<PlatformView> on_create_platform_view,
|
||||
CreateCallback<Rasterizer> on_create_rasterizer);
|
||||
|
||||
@ -105,6 +106,7 @@ class Shell final : public PlatformView::Delegate,
|
||||
blink::TaskRunners task_runners,
|
||||
blink::Settings settings,
|
||||
fxl::RefPtr<blink::DartSnapshot> isolate_snapshot,
|
||||
fxl::RefPtr<blink::DartSnapshot> shared_snapshot,
|
||||
Shell::CreateCallback<PlatformView> on_create_platform_view,
|
||||
Shell::CreateCallback<Rasterizer> on_create_rasterizer);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user