| Index: mojo/public/bindings/js/v8_wrapper.h
|
| diff --git a/mojo/public/bindings/js/v8_wrapper.h b/mojo/public/bindings/js/v8_wrapper.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..57038955c980f5445ef90d07235d83c483ae9a6b
|
| --- /dev/null
|
| +++ b/mojo/public/bindings/js/v8_wrapper.h
|
| @@ -0,0 +1,51 @@
|
| +// Copyright 2013 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 MOJO_PUBLIC_BINDINGS_JS_V8_WRAPPER_H_
|
| +#define MOJO_PUBLIC_BINDINGS_JS_V8_WRAPPER_H_
|
| +
|
| +#include "v8/include/v8.h"
|
| +
|
| +namespace mojo {
|
| +namespace js {
|
| +
|
| +enum InternalFields {
|
| + kWrapperInfoIndex,
|
| + kEncodedValueIndex,
|
| + kNumberOfInternalFields,
|
| +};
|
| +
|
| +struct WrapperInfo {
|
| + static WrapperInfo* From(v8::Handle<v8::Object> object);
|
| + // Currently we just use the address of this struct for identity.
|
| +};
|
| +
|
| +template<typename T>
|
| +struct Wrapper {};
|
| +
|
| +template<>
|
| +struct Wrapper<int32_t> {
|
| + static v8::Handle<v8::Value> ToObject(v8::Isolate* isolate,
|
| + int32_t native);
|
| + static int32_t ToNative(v8::Handle<v8::Value> value);
|
| +};
|
| +
|
| +template<>
|
| +struct Wrapper<uint32_t> {
|
| + static v8::Handle<v8::Value> ToObject(v8::Isolate* isolate,
|
| + uint32_t native);
|
| + static uint32_t ToNative(v8::Handle<v8::Value> value);
|
| +};
|
| +
|
| +template<>
|
| +struct Wrapper<uint64_t> {
|
| + static v8::Handle<v8::Value> ToObject(v8::Isolate* isolate,
|
| + uint64_t native);
|
| + static uint64_t ToNative(v8::Handle<v8::Value> value);
|
| +};
|
| +
|
| +} // namespace js
|
| +} // namespace mojo
|
| +
|
| +#endif // MOJO_PUBLIC_BINDINGS_JS_V8_WRAPPER_H_
|
|
|