blob: 3f56c700f4f4204f346ec4ff2e50f2c2ba6b6f6e [file] [log] [blame]
Avi Drissman468e51b62022-09-13 20:47:011// Copyright 2013 The Chromium Authors
[email protected]a22998a2013-11-10 05:00:502// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]c07006b2013-11-20 03:01:445#include "gin/public/wrapper_info.h"
Dan Elphick05acd602021-08-30 15:22:076#include "v8/include/v8-object.h"
[email protected]a22998a2013-11-10 05:00:507
8namespace gin {
9
Andreas Haas3c152262025-07-02 12:57:4810DeprecatedWrapperInfo* DeprecatedWrapperInfo::From(
11 v8::Local<v8::Object> object) {
[email protected]a22998a2013-11-10 05:00:5012 if (object->InternalFieldCount() != kNumberOfInternalFields)
13 return NULL;
Andreas Haas3c152262025-07-02 12:57:4814 DeprecatedWrapperInfo* info = static_cast<DeprecatedWrapperInfo*>(
[email protected]a22998a2013-11-10 05:00:5015 object->GetAlignedPointerFromInternalField(kWrapperInfoIndex));
[email protected]a17807242013-11-20 21:59:5316 return info->embedder == kEmbedderNativeGin ? info : NULL;
[email protected]a22998a2013-11-10 05:00:5017}
18
19} // namespace gin