Roll src/third_party/WebKit 58870dd:8cff7c9 (svn 202487:202488)
[chromium-blink-merge.git] / gin / public / wrapper_info.h
blob4a1f55f32b1b31d43dade23e70bbe179740887ca
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GIN_PUBLIC_WRAPPER_INFO_H_
6 #define GIN_PUBLIC_WRAPPER_INFO_H_
8 #include "gin/gin_export.h"
9 #include "gin/public/gin_embedders.h"
10 #include "v8/include/v8.h"
12 namespace gin {
14 // Gin embedder that use their own WrapperInfo-like structs must ensure that
15 // the first field is of type GinEmbedderId and has the correct id set. They
16 // also should use kWrapperInfoIndex to start their WrapperInfo-like struct
17 // and ensure that all objects have kNumberOfInternalFields internal fields.
19 enum InternalFields {
20 kWrapperInfoIndex,
21 kEncodedValueIndex,
22 kNumberOfInternalFields,
25 struct GIN_EXPORT WrapperInfo {
26 static WrapperInfo* From(v8::Local<v8::Object> object);
27 const GinEmbedder embedder;
30 } // namespace gin
32 #endif // GIN_PUBLIC_WRAPPER_INFO_H_