mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
// Copyright 2017 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "flutter/lib/ui/compositing/scene_host.h"
|
|
|
|
#include "lib/tonic/dart_args.h"
|
|
#include "lib/tonic/dart_binding_macros.h"
|
|
#include "lib/tonic/dart_library_natives.h"
|
|
#include "lib/tonic/dart_wrappable.h"
|
|
|
|
#ifdef OS_FUCHSIA
|
|
#include "dart-pkg/zircon/sdk_ext/handle.h"
|
|
#endif
|
|
|
|
namespace blink {
|
|
|
|
static void SceneHost_constructor(Dart_NativeArguments args) {
|
|
DartCallConstructor(&SceneHost::create, args);
|
|
}
|
|
|
|
IMPLEMENT_WRAPPERTYPEINFO(ui, SceneHost);
|
|
|
|
#define FOR_EACH_BINDING(V) V(SceneHost, dispose)
|
|
|
|
FOR_EACH_BINDING(DART_NATIVE_CALLBACK)
|
|
|
|
void SceneHost::RegisterNatives(tonic::DartLibraryNatives* natives) {
|
|
natives->Register({{"SceneHost_constructor", SceneHost_constructor, 2, true},
|
|
FOR_EACH_BINDING(DART_REGISTER_NATIVE)});
|
|
}
|
|
|
|
#if defined(OS_FUCHSIA)
|
|
fxl::RefPtr<SceneHost> SceneHost::create(
|
|
fxl::RefPtr<zircon::dart::Handle> export_token_handle) {
|
|
return fxl::MakeRefCounted<SceneHost>(export_token_handle);
|
|
}
|
|
|
|
SceneHost::SceneHost(fxl::RefPtr<zircon::dart::Handle> export_token_handle) {
|
|
export_node_holder_ =
|
|
fxl::MakeRefCounted<flow::ExportNodeHolder>(export_token_handle);
|
|
}
|
|
#else
|
|
fxl::RefPtr<SceneHost> SceneHost::create(Dart_Handle export_token_handle) {
|
|
return fxl::MakeRefCounted<SceneHost>(export_token_handle);
|
|
}
|
|
|
|
SceneHost::SceneHost(Dart_Handle export_token_handle) {}
|
|
#endif
|
|
|
|
SceneHost::~SceneHost() {}
|
|
|
|
void SceneHost::dispose() {
|
|
ClearDartWrapper();
|
|
}
|
|
|
|
} // namespace blink
|