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

Commit 477a773

Browse files
ianloiczanderso
authored andcommitted
[fidl] Port Dart runtime to FIDL2.
Change-Id: I0423c17514027b282856f5796a550ceaa3b66baf Reviewed-on: https://dart-review.googlesource.com/48840 Reviewed-by: Zach Anderson <zra@google.com> Reviewed-by: Adam Barth <abarth@google.com>
1 parent d46dd1b commit 477a773

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

runtime/vm/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ template("build_libdart_vm") {
7171
# TODO(US-399): Remove time_service specific code when it is no longer
7272
# necessary.
7373
"//garnet/public/lib/app/cpp",
74-
"//garnet/public/lib/time_service/fidl",
74+
"//garnet/public/lib/time_zone/fidl",
7575

7676
# TODO(zra): When the platform-specific timeline code is moved out to
7777
# the embedder, this can go away.

runtime/vm/os_fuchsia.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
#include <zircon/syscalls/object.h>
1515
#include <zircon/types.h>
1616

17+
#include <fuchsia/cpp/time_zone.h>
18+
1719
#include "lib/app/cpp/environment_services.h"
18-
#include "lib/time_service/fidl/time_service.fidl.h"
1920

2021
#include "platform/assert.h"
2122
#include "vm/zone.h"
2223

23-
static constexpr char kTimeServiceName[] = "time_service::TimeService";
24-
2524
namespace dart {
2625

2726
#ifndef PRODUCT
@@ -42,17 +41,18 @@ intptr_t OS::ProcessId() {
4241
}
4342

4443
static zx_status_t GetTimeServicePtr(
45-
time_service::TimeServiceSyncPtr* time_svc) {
44+
time_zone::TimezoneSyncPtr* time_svc) {
4645
zx::channel service_root = app::subtle::CreateStaticServiceRootHandle();
47-
zx::channel time_svc_channel = GetSynchronousProxy(time_svc).TakeChannel();
48-
return fdio_service_connect_at(service_root.get(), kTimeServiceName,
46+
zx::channel time_svc_channel = time_svc->NewRequest().TakeChannel();
47+
return fdio_service_connect_at(service_root.get(),
48+
time_zone::Timezone::Name_,
4949
time_svc_channel.release());
5050
}
5151

5252
static zx_status_t GetLocalAndDstOffsetInSeconds(int64_t seconds_since_epoch,
5353
int32_t* local_offset,
5454
int32_t* dst_offset) {
55-
time_service::TimeServiceSyncPtr time_svc;
55+
time_zone::TimezoneSyncPtr time_svc;
5656
zx_status_t status = GetTimeServicePtr(&time_svc);
5757
if (status == ZX_OK) {
5858
time_svc->GetTimezoneOffsetMinutes(seconds_since_epoch * 1000, local_offset,
@@ -64,9 +64,9 @@ static zx_status_t GetLocalAndDstOffsetInSeconds(int64_t seconds_since_epoch,
6464
}
6565

6666
const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) {
67-
time_service::TimeServiceSyncPtr time_svc;
67+
time_zone::TimezoneSyncPtr time_svc;
6868
if (GetTimeServicePtr(&time_svc) == ZX_OK) {
69-
f1dl::String res;
69+
fidl::StringPtr res;
7070
time_svc->GetTimezoneId(&res);
7171
char* tz_name = Thread::Current()->zone()->Alloc<char>(res->size() + 1);
7272
memmove(tz_name, res->data(), res->size());

0 commit comments

Comments
 (0)