diff options
Diffstat (limited to 'gin/wrapper_info.cc')
-rw-r--r-- | gin/wrapper_info.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gin/wrapper_info.cc b/gin/wrapper_info.cc new file mode 100644 index 0000000..d14156d --- /dev/null +++ b/gin/wrapper_info.cc @@ -0,0 +1,16 @@ +// 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. + +#include "gin/wrapper_info.h" + +namespace gin { + +WrapperInfo* WrapperInfo::From(v8::Handle<v8::Object> object) { + if (object->InternalFieldCount() != kNumberOfInternalFields) + return NULL; + return static_cast<WrapperInfo*>( + object->GetAlignedPointerFromInternalField(kWrapperInfoIndex)); +} + +} // namespace gin |