From 6dde463edfba9f02d269aad147718dc454717dad Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Sat, 9 Oct 2021 01:57:20 +0000 Subject: [PATCH] dujingcheng@huawei.com Signed-off-by: dujingcheng --- .../platform/ohos/platform_task_runner.cc | 18 +++++++++++++++ .../platform/ohos/platform_task_runner.h | 22 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 engine/flutter/shell/platform/ohos/platform_task_runner.cc create mode 100644 engine/flutter/shell/platform/ohos/platform_task_runner.h diff --git a/engine/flutter/shell/platform/ohos/platform_task_runner.cc b/engine/flutter/shell/platform/ohos/platform_task_runner.cc new file mode 100644 index 00000000..a321dd69 --- /dev/null +++ b/engine/flutter/shell/platform/ohos/platform_task_runner.cc @@ -0,0 +1,18 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// 2021.10.08 platform task runner adapt ohos. +// Copyright (c) 2021 Huawei Device Co., Ltd. All rights reserved. + +#include "flutter/shell/platform/ohos/platform_task_runner.h" + +#include "flutter/shell/platform/ohos/platform_task_runner_adapter.h" + +namespace flutter { + +fml::RefPtr PlatformTaskRunner::CurrentTaskRunner() +{ + return PlatformTaskRunnerAdapter::CurrentTaskRunner(); +} + +} // namespace flutter \ No newline at end of file diff --git a/engine/flutter/shell/platform/ohos/platform_task_runner.h b/engine/flutter/shell/platform/ohos/platform_task_runner.h new file mode 100644 index 00000000..6166126e --- /dev/null +++ b/engine/flutter/shell/platform/ohos/platform_task_runner.h @@ -0,0 +1,22 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// 2021.10.08 platform task runner adapt ohos. +// Copyright (c) 2021 Huawei Device Co., Ltd. All rights reserved. + +#ifndef FLUTTER_SHELL_PLATFORM_OHOS_PLATFORM_TASK_RUNNER_H +#define FLUTTER_SHELL_PLATFORM_OHOS_PLATFORM_TASK_RUNNER_H + +#include "flutter/fml/message_loop_impl.h" +#include "flutter/fml/message_loop_task_queues.h" + +namespace flutter { + +class PlatformTaskRunner { +public: + static fml::RefPtr CurrentTaskRunner(); +}; + +} // namespace flutter + +#endif // FLUTTER_SHELL_PLATFORM_OHOS_PLATFORM_TASK_RUNNER_H \ No newline at end of file -- Gitee