5#ifndef FLUTTER_FML_MAPPING_H_
6#define FLUTTER_FML_MAPPING_H_
8#include <initializer_list>
13#include "flutter/fml/build_config.h"
14#include "flutter/fml/file.h"
15#include "flutter/fml/macros.h"
16#include "flutter/fml/native_library.h"
17#include "flutter/fml/unique_fd.h"
48 std::initializer_list<Protection> protection = {
53 static std::unique_ptr<FileMapping>
CreateReadOnly(
const std::string& path);
57 const std::string& sub_path =
"");
60 const std::string& path);
64 const std::string& sub_path =
"");
67 size_t GetSize()
const override;
82 uint8_t* mapping_ =
nullptr;
83 uint8_t* mutable_mapping_ =
nullptr;
101 size_t GetSize()
const override;
110 std::vector<uint8_t> data_;
121 bool dontneed_safe =
false);
126 size_t GetSize()
const override;
135 const uint8_t*
const data_;
138 const bool dontneed_safe_;
161 template <
typename T>
175 size_t GetSize()
const override;
185 [[nodiscard]] uint8_t*
Release();
197 const char* symbol_name);
202 size_t GetSize()
const override;
212 const uint8_t* mapping_ =
nullptr;
const uint8_t * GetMapping() const override
bool IsDontNeedSafe() const override
size_t GetSize() const override
static std::unique_ptr< FileMapping > CreateReadExecute(const std::string &path)
size_t GetSize() const override
bool IsDontNeedSafe() const override
uint8_t * GetMutableMapping()
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
const uint8_t * GetMapping() const override
A Mapping like NonOwnedMapping, but uses Free as its release proc.
bool IsDontNeedSafe() const override
static MallocMapping Copy(const T *begin, const T *end)
size_t GetSize() const override
const uint8_t * GetMapping() const override
~MallocMapping() override
virtual bool IsDontNeedSafe() const =0
virtual const uint8_t * GetMapping() const =0
virtual size_t GetSize() const =0
std::function< void(const uint8_t *data, size_t size)> ReleaseProc
const uint8_t * GetMapping() const override
size_t GetSize() const override
~NonOwnedMapping() override
bool IsDontNeedSafe() const override
bool IsDontNeedSafe() const override
~SymbolMapping() override
const uint8_t * GetMapping() const override
size_t GetSize() const override
static const char * begin(const StringSlice &s)
#define FML_DCHECK(condition)
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
constexpr std::size_t size(T(&array)[N])