[go: nahoru, domu]

blob: 6bf831696b0c1d5787fa3619fb8372e0fe5f18cd [file] [log] [blame]
// 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/public/wrapper_info.h"
namespace gin {
WrapperInfo* WrapperInfo::From(v8::Handle<v8::Object> object) {
if (object->InternalFieldCount() != kNumberOfInternalFields)
return NULL;
WrapperInfo* info = static_cast<WrapperInfo*>(
object->GetAlignedPointerFromInternalField(kWrapperInfoIndex));
return info->embedder == kEmbedderNativeGin ? info : NULL;
}
} // namespace gin