@@ -42,7 +42,7 @@ Dart_Handle DartWrappable::CreateDartWrapper(DartState* dart_state) {
42
42
return wrapper;
43
43
}
44
44
45
- void DartWrappable::ClaimDartHandle (Dart_Handle wrapper) {
45
+ void DartWrappable::AssociateWithDartWrapper (Dart_Handle wrapper) {
46
46
TONIC_DCHECK (!dart_wrapper_);
47
47
TONIC_CHECK (!LogIfError (wrapper));
48
48
@@ -58,29 +58,6 @@ void DartWrappable::ClaimDartHandle(Dart_Handle wrapper) {
58
58
wrapper, this , GetAllocationSize (), &FinalizeDartWrapper);
59
59
}
60
60
61
- void DartWrappable::AssociateWithDartWrapper (Dart_NativeArguments args) {
62
- TONIC_DCHECK (!dart_wrapper_);
63
-
64
- Dart_Handle wrapper = Dart_GetNativeArgument (args, 0 );
65
- TONIC_CHECK (!LogIfError (wrapper));
66
-
67
- intptr_t native_fields[kNumberOfNativeFields ];
68
- TONIC_CHECK (!LogIfError (Dart_GetNativeFieldsOfArgument (
69
- args, 0 , kNumberOfNativeFields , native_fields)));
70
- TONIC_CHECK (!native_fields[kPeerIndex ]);
71
- TONIC_CHECK (!native_fields[kWrapperInfoIndex ]);
72
-
73
- const DartWrapperInfo& info = GetDartWrapperInfo ();
74
- TONIC_CHECK (!LogIfError (Dart_SetNativeInstanceField (
75
- wrapper, kPeerIndex , reinterpret_cast <intptr_t >(this ))));
76
- TONIC_CHECK (!LogIfError (Dart_SetNativeInstanceField (
77
- wrapper, kWrapperInfoIndex , reinterpret_cast <intptr_t >(&info))));
78
-
79
- this ->RetainDartWrappableReference (); // Balanced in FinalizeDartWrapper.
80
- dart_wrapper_ = Dart_NewWeakPersistentHandle (
81
- wrapper, this , GetAllocationSize (), &FinalizeDartWrapper);
82
- }
83
-
84
61
void DartWrappable::ClearDartWrapper () {
85
62
TONIC_DCHECK (dart_wrapper_);
86
63
Dart_Handle wrapper = Dart_HandleFromWeakPersistent (dart_wrapper_);
0 commit comments