Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 638c182

Browse files
authored
[fuchsia] zx::vmar::map migration (#22003)
The new map() method receives its arguments in the same order as the underlying C system call. This patch should not change any behavior.
1 parent 8a5b423 commit 638c182

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

shell/platform/fuchsia/flutter/component.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class FileInNamespaceBuffer final : public fml::Mapping {
481481
}
482482
uintptr_t addr;
483483
zx_status_t status =
484-
zx::vmar::root_self()->map(0, buffer.vmo, 0, buffer.size, flags, &addr);
484+
zx::vmar::root_self()->map(flags, 0, buffer.vmo, 0, buffer.size, &addr);
485485
if (status != ZX_OK) {
486486
FML_LOG(FATAL) << "Failed to map " << path << ": "
487487
<< zx_status_get_string(status);

shell/platform/fuchsia/flutter/runner.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ uintptr_t GetICUData(const fuchsia::mem::Buffer& icu_data) {
4545
return 0u;
4646

4747
uintptr_t data = 0u;
48-
zx_status_t status = zx::vmar::root_self()->map(
49-
0, icu_data.vmo, 0, static_cast<size_t>(data_size), ZX_VM_PERM_READ,
50-
&data);
48+
zx_status_t status =
49+
zx::vmar::root_self()->map(ZX_VM_PERM_READ, 0, icu_data.vmo, 0,
50+
static_cast<size_t>(data_size), &data);
5151
if (status == ZX_OK) {
5252
return data;
5353
}

shell/platform/fuchsia/runtime/dart/utils/mapped_resource.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ bool MappedResource::LoadFromVmo(const std::string& path,
8282
flags |= ZX_VM_PERM_EXECUTE;
8383
}
8484
uintptr_t addr;
85-
zx_status_t status = zx::vmar::root_self()->map(
86-
0, resource_vmo.vmo, 0, resource_vmo.size, flags, &addr);
85+
zx_status_t status = zx::vmar::root_self()->map(flags, 0, resource_vmo.vmo, 0,
86+
resource_vmo.size, &addr);
8787
if (status != ZX_OK) {
8888
FX_LOGF(ERROR, LOG_TAG, "Failed to map: %s", zx_status_get_string(status));
8989
return false;

0 commit comments

Comments
 (0)