This source file includes following definitions.
- ToV8
- FromV8
#include "mojo/bindings/js/handle.h"
namespace gin {
gin::WrapperInfo HandleWrapper::kWrapperInfo = { gin::kEmbedderNativeGin };
HandleWrapper::HandleWrapper(MojoHandle handle)
: handle_(mojo::Handle(handle)) {
}
HandleWrapper::~HandleWrapper() {
}
v8::Handle<v8::Value> Converter<mojo::Handle>::ToV8(v8::Isolate* isolate,
const mojo::Handle& val) {
return HandleWrapper::Create(isolate, val.value()).ToV8();
}
bool Converter<mojo::Handle>::FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
mojo::Handle* out) {
gin::Handle<HandleWrapper> handle;
if (!Converter<gin::Handle<HandleWrapper> >::FromV8(isolate, val, &handle))
return false;
*out = handle->get();
return true;
}
}