提交 52b4d62e 编写于 作者: A Adam Barth 提交者: GitHub

Remove mojo_converter.h (#2879)

We can use the one from //lib/tonic instead.
上级 1c9c7aa8
......@@ -6,11 +6,11 @@
#include "flow/texture_image.h"
#include "flutter/lib/ui/painting/image.h"
#include "flutter/tonic/mojo_converter.h"
#include "glue/movable_wrapper.h"
#include "glue/trace_event.h"
#include "lib/tonic/dart_persistent_value.h"
#include "lib/tonic/logging/dart_invoke.h"
#include "lib/tonic/mojo_converter.h"
#include "lib/tonic/typed_data/uint8_list.h"
#include "sky/engine/platform/mojo/data_pipe.h"
#include "sky/engine/platform/SharedBuffer.h"
......
......@@ -18,7 +18,6 @@ source_set("tonic") {
"dart_snapshot_loader.h",
"dart_state.cc",
"dart_state.h",
"mojo_converter.h",
]
deps = [
......
// Copyright 2015 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.
#ifndef FLUTTER_TONIC_MOJO_CONVERTER_H_
#define FLUTTER_TONIC_MOJO_CONVERTER_H_
#include "lib/tonic/converter/dart_converter.h"
#include "mojo/public/cpp/system/handle.h"
namespace tonic {
template <typename HandleType>
struct DartConverter<mojo::ScopedHandleBase<HandleType>> {
static mojo::ScopedHandleBase<HandleType> FromDart(Dart_Handle handle) {
uint64_t raw_handle = 0;
Dart_Handle result = Dart_IntegerToUint64(handle, &raw_handle);
if (Dart_IsError(result) || !raw_handle)
return mojo::ScopedHandleBase<HandleType>();
HandleType mojo_handle(static_cast<MojoHandle>(raw_handle));
return mojo::MakeScopedHandle(mojo_handle);
}
static Dart_Handle ToDart(mojo::ScopedHandleBase<HandleType> mojo_handle) {
return Dart_NewInteger(static_cast<int64_t>(mojo_handle.release().value()));
}
static mojo::ScopedHandleBase<HandleType>
FromArguments(Dart_NativeArguments args, int index, Dart_Handle& exception) {
int64_t raw_handle = 0;
Dart_Handle result =
Dart_GetNativeIntegerArgument(args, index, &raw_handle);
if (Dart_IsError(result) || !raw_handle)
return mojo::ScopedHandleBase<HandleType>();
HandleType mojo_handle(static_cast<MojoHandle>(raw_handle));
return mojo::MakeScopedHandle(mojo_handle);
}
};
} // namespace tonic
#endif // FLUTTER_TONIC_MOJO_CONVERTER_H_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册