Avi Drissman | 468e51b6 | 2022-09-13 20:47:01 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | c07006b | 2013-11-20 03:01:44 | [diff] [blame] | 5 | #include "gin/public/wrapper_info.h" |
Dan Elphick | 05acd60 | 2021-08-30 15:22:07 | [diff] [blame] | 6 | #include "v8/include/v8-object.h" |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 7 | |
8 | namespace gin { | ||||
9 | |||||
Andreas Haas | 3c15226 | 2025-07-02 12:57:48 | [diff] [blame] | 10 | DeprecatedWrapperInfo* DeprecatedWrapperInfo::From( |
11 | v8::Local<v8::Object> object) { | ||||
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 12 | if (object->InternalFieldCount() != kNumberOfInternalFields) |
13 | return NULL; | ||||
Andreas Haas | 3c15226 | 2025-07-02 12:57:48 | [diff] [blame] | 14 | DeprecatedWrapperInfo* info = static_cast<DeprecatedWrapperInfo*>( |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 15 | object->GetAlignedPointerFromInternalField(kWrapperInfoIndex)); |
[email protected] | a1780724 | 2013-11-20 21:59:53 | [diff] [blame] | 16 | return info->embedder == kEmbedderNativeGin ? info : NULL; |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 17 | } |
18 | |||||
19 | } // namespace gin |