blob: 3f56c700f4f4204f346ec4ff2e50f2c2ba6b6f6e [file] [log] [blame]
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gin/public/wrapper_info.h"
#include "v8/include/v8-object.h"
namespace gin {
DeprecatedWrapperInfo* DeprecatedWrapperInfo::From(
v8::Local<v8::Object> object) {
if (object->InternalFieldCount() != kNumberOfInternalFields)
return NULL;
DeprecatedWrapperInfo* info = static_cast<DeprecatedWrapperInfo*>(
object->GetAlignedPointerFromInternalField(kWrapperInfoIndex));
return info->embedder == kEmbedderNativeGin ? info : NULL;
}
} // namespace gin