#include <mapped_resource.h>
Definition at line 50 of file mapped_resource.h.
◆ MappedResource() [1/2]
dart_utils::MappedResource::MappedResource |
( |
| ) |
|
|
inline |
◆ MappedResource() [2/2]
Definition at line 53 of file mapped_resource.h.
54 : address_(other.address_), size_(other.size_) {
55 other.address_ =
nullptr;
◆ ~MappedResource()
dart_utils::MappedResource::~MappedResource |
( |
| ) |
|
Definition at line 97 of file mapped_resource.cc.
98 if (address_ !=
nullptr) {
99 zx::vmar::root_self()->unmap(reinterpret_cast<uintptr_t>(address_), size_);
◆ address()
const uint8_t* dart_utils::MappedResource::address |
( |
| ) |
const |
|
inline |
◆ LoadFromDir()
static bool dart_utils::MappedResource::LoadFromDir |
( |
int |
dirfd, |
|
|
const std::string & |
path, |
|
|
MappedResource & |
resource, |
|
|
bool |
executable = false |
|
) |
| |
|
static |
◆ LoadFromNamespace()
bool dart_utils::MappedResource::LoadFromNamespace |
( |
fdio_ns_t * |
namespc, |
|
|
const std::string & |
path, |
|
|
MappedResource & |
resource, |
|
|
bool |
executable = false |
|
) |
| |
|
static |
Definition at line 63 of file mapped_resource.cc.
References LoadFromVmo(), and dart_utils::OpenVmo().
Referenced by dart_runner::CreateServiceIsolate(), dart_runner::DartRunner::DartRunner(), dart_runner::GetVMServiceAssetsArchiveCallback(), dart_runner::DartComponentControllerV2::SetUp(), and dart_runner::DartTestComponentControllerV2::SetUp().
67 fuchsia::mem::Buffer resource_vmo;
68 return OpenVmo(&resource_vmo, namespc,
path, executable) &&
static bool OpenVmo(fuchsia::mem::Buffer *resource_vmo, fdio_ns_t *namespc, const std::string &path, bool executable)
static bool LoadFromVmo(const std::string &path, fuchsia::mem::Buffer resource_vmo, MappedResource &resource, bool executable=false)
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
◆ LoadFromVmo()
bool dart_utils::MappedResource::LoadFromVmo |
( |
const std::string & |
path, |
|
|
fuchsia::mem::Buffer |
resource_vmo, |
|
|
MappedResource & |
resource, |
|
|
bool |
executable = false |
|
) |
| |
|
static |
Definition at line 72 of file mapped_resource.cc.
References flags, and LOG_TAG.
Referenced by LoadFromNamespace().
76 if (resource_vmo.size == 0) {
80 uint32_t
flags = ZX_VM_PERM_READ;
82 flags |= ZX_VM_PERM_EXECUTE;
85 zx_status_t status = zx::vmar::root_self()->map(flags, 0, resource_vmo.vmo, 0,
86 resource_vmo.size, &addr);
87 if (status != ZX_OK) {
88 FX_LOGF(ERROR,
LOG_TAG,
"Failed to map: %s", zx_status_get_string(status));
92 resource.address_ =
reinterpret_cast<void*
>(addr);
93 resource.size_ = resource_vmo.size;
FlutterSemanticsFlag flags
◆ operator=()
Definition at line 58 of file mapped_resource.h.
59 address_ = other.address_;
61 other.address_ =
nullptr;
◆ size()
size_t dart_utils::MappedResource::size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: