5#ifndef LIB_TONIC_FILE_LOADER_FILE_LOADER_H_
6#define LIB_TONIC_FILE_LOADER_FILE_LOADER_H_
13#include "third_party/dart/runtime/include/dart_api.h"
27 const std::string&
packages()
const {
return packages_; }
47 static std::string SanitizeURIEscapedCharacters(
const std::string& str);
48 static std::string SanitizePath(
const std::string&
path);
50 std::string GetFilePathForURL(std::string url);
51 std::string GetFilePathForPackageURL(std::string url);
52 std::string GetFilePathForFileURL(std::string url);
54 std::string GetFileURLForPath(
const std::string&
path);
56 bool ReadFileToString(
const std::string&
path, std::string*
result);
57 std::pair<uint8_t*, intptr_t> ReadFileToBytes(
const std::string&
path);
60 std::string packages_;
61 std::unique_ptr<PackagesMap> packages_map_;
62 std::vector<uint8_t*> kernel_buffers_;
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
const std::string & packages() const
Dart_Handle Import(Dart_Handle url)
void SetPackagesUrl(Dart_Handle url)
static const char kFileURLPrefix[]
bool LoadPackagesMap(const std::string &packages)
Dart_Handle HandleLibraryTag(Dart_LibraryTag tag, Dart_Handle library, Dart_Handle url)
static const size_t kFileURLPrefixLength
Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url)
Dart_Handle Kernel(Dart_Handle url)
Dart_Handle FetchBytes(const std::string &url, uint8_t *&buffer, intptr_t &buffer_size)
static const std::string kPathSeparator
struct _Dart_Handle * Dart_Handle
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer