From 477a773cdbf49b04b39e9602c3d9a856395427d6 Mon Sep 17 00:00:00 2001 From: Ian McKellar Date: Fri, 30 Mar 2018 05:23:36 +0000 Subject: [PATCH] [fidl] Port Dart runtime to FIDL2. Change-Id: I0423c17514027b282856f5796a550ceaa3b66baf Reviewed-on: https://dart-review.googlesource.com/48840 Reviewed-by: Zach Anderson Reviewed-by: Adam Barth --- runtime/vm/BUILD.gn | 2 +- runtime/vm/os_fuchsia.cc | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn index 5c333da5c0f..5a14a5588f5 100644 --- a/runtime/vm/BUILD.gn +++ b/runtime/vm/BUILD.gn @@ -71,7 +71,7 @@ template("build_libdart_vm") { # TODO(US-399): Remove time_service specific code when it is no longer # necessary. "//garnet/public/lib/app/cpp", - "//garnet/public/lib/time_service/fidl", + "//garnet/public/lib/time_zone/fidl", # TODO(zra): When the platform-specific timeline code is moved out to # the embedder, this can go away. diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc index 0e4e6c4b866..bd21b78183f 100644 --- a/runtime/vm/os_fuchsia.cc +++ b/runtime/vm/os_fuchsia.cc @@ -14,14 +14,13 @@ #include #include +#include + #include "lib/app/cpp/environment_services.h" -#include "lib/time_service/fidl/time_service.fidl.h" #include "platform/assert.h" #include "vm/zone.h" -static constexpr char kTimeServiceName[] = "time_service::TimeService"; - namespace dart { #ifndef PRODUCT @@ -42,17 +41,18 @@ intptr_t OS::ProcessId() { } static zx_status_t GetTimeServicePtr( - time_service::TimeServiceSyncPtr* time_svc) { + time_zone::TimezoneSyncPtr* time_svc) { zx::channel service_root = app::subtle::CreateStaticServiceRootHandle(); - zx::channel time_svc_channel = GetSynchronousProxy(time_svc).TakeChannel(); - return fdio_service_connect_at(service_root.get(), kTimeServiceName, + zx::channel time_svc_channel = time_svc->NewRequest().TakeChannel(); + return fdio_service_connect_at(service_root.get(), + time_zone::Timezone::Name_, time_svc_channel.release()); } static zx_status_t GetLocalAndDstOffsetInSeconds(int64_t seconds_since_epoch, int32_t* local_offset, int32_t* dst_offset) { - time_service::TimeServiceSyncPtr time_svc; + time_zone::TimezoneSyncPtr time_svc; zx_status_t status = GetTimeServicePtr(&time_svc); if (status == ZX_OK) { time_svc->GetTimezoneOffsetMinutes(seconds_since_epoch * 1000, local_offset, @@ -64,9 +64,9 @@ static zx_status_t GetLocalAndDstOffsetInSeconds(int64_t seconds_since_epoch, } const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { - time_service::TimeServiceSyncPtr time_svc; + time_zone::TimezoneSyncPtr time_svc; if (GetTimeServicePtr(&time_svc) == ZX_OK) { - f1dl::String res; + fidl::StringPtr res; time_svc->GetTimezoneId(&res); char* tz_name = Thread::Current()->zone()->Alloc(res->size() + 1); memmove(tz_name, res->data(), res->size());