5#ifndef FLUTTER_FML_UNIQUE_FD_H_
6#define FLUTTER_FML_UNIQUE_FD_H_
8#include "flutter/fml/build_config.h"
9#include "flutter/fml/unique_object.h"
29 std::wstring filename;
36struct UniqueFDTraits {
37 static std::mutex file_map_mutex;
38 static std::map<HANDLE, DirCacheEntry> file_map;
42 static void Free_Handle(
HANDLE fd);
47 UniqueFDTraits::Free_Handle(fd);
50 static void RemoveCacheEntry(
HANDLE fd) {
51 const std::lock_guard<std::mutex> lock(file_map_mutex);
56 static void StoreCacheEntry(
HANDLE fd, DirCacheEntry
state) {
57 const std::lock_guard<std::mutex> lock(file_map_mutex);
61 static std::optional<DirCacheEntry> GetCacheEntry(
HANDLE fd) {
62 const std::lock_guard<std::mutex> lock(file_map_mutex);
63 auto found = file_map.find(fd);
64 return found == file_map.end()
66 : std::optional<DirCacheEntry>{found->second};
79 static void Free(
int fd);
96using UniqueFD = UniqueObject<HANDLE, internal::os_win::UniqueFDTraits>;
static void Free(FreeList *free_list, uword address, intptr_t size, bool is_protected)
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 Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
UniqueObject< int, internal::os_unix::UniqueFDTraits > UniqueFD
static DIR * InvalidValue()
static void Free(DIR *dir)
static bool IsValid(DIR *value)
static int InvalidValue()
static bool IsValid(int value)
#define INVALID_HANDLE_VALUE