mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
* Read core platform kernel file during Dart initialization. Currently service isolate is initialized from the source code parsed by VM. This CL changes it so service isolate created during Dart initialization is created from the kernel platform.dill file if it is present in the application bundle. Then this platform kernel file is kept in dart_init module and reused for application sciprt isolates. * Reformat and merge * Use accessor method * Avoid passing running_from_kernel param. Add TODO for cleanup. Rename param.
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_RUNTIME_DART_SERVICE_ISOLATE_H_
|
|
#define FLUTTER_RUNTIME_DART_SERVICE_ISOLATE_H_
|
|
|
|
#include <string>
|
|
|
|
#include "third_party/dart/runtime/include/dart_api.h"
|
|
|
|
namespace blink {
|
|
|
|
class DartServiceIsolate {
|
|
public:
|
|
static bool Bootstrap();
|
|
|
|
static bool Startup(std::string server_ip,
|
|
intptr_t server_port,
|
|
Dart_LibraryTagHandler embedder_tag_handler,
|
|
bool running_from_sources,
|
|
bool disable_origin_check,
|
|
char** error);
|
|
|
|
static std::string GetObservatoryUri();
|
|
|
|
private:
|
|
// Native entries.
|
|
static void TriggerResourceLoad(Dart_NativeArguments args);
|
|
static void NotifyServerState(Dart_NativeArguments args);
|
|
static void Shutdown(Dart_NativeArguments args);
|
|
|
|
// Script loading.
|
|
static Dart_Handle GetSource(const char* name);
|
|
static Dart_Handle LoadScript(const char* name);
|
|
static Dart_Handle LoadSource(Dart_Handle library, const char* name);
|
|
static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
|
|
Dart_Handle library,
|
|
Dart_Handle url);
|
|
|
|
// Observatory resource loading.
|
|
static Dart_Handle LoadResources(Dart_Handle library);
|
|
static Dart_Handle LoadResource(Dart_Handle library, const char* name);
|
|
};
|
|
|
|
} // namespace blink
|
|
|
|
#endif // FLUTTER_RUNTIME_DART_SERVICE_ISOLATE_H_
|