@@ -883,19 +883,6 @@ class TracedReferenceBase {
883883 */
884884 V8_INLINE uint16_t WrapperClassId () const ;
885885
886- /* *
887- * Adds a finalization callback to the handle. The type of this callback is
888- * similar to WeakCallbackType::kInternalFields, i.e., it will pass the
889- * parameter and the first two internal fields of the object.
890- *
891- * The callback is then supposed to reset the handle in the callback. No
892- * further V8 API may be called in this callback. In case additional work
893- * involving V8 needs to be done, a second callback can be scheduled using
894- * WeakCallbackInfo<void>::SetSecondPassCallback.
895- */
896- V8_INLINE void SetFinalizationCallback (
897- void * parameter, WeakCallbackInfo<void >::Callback callback);
898-
899886 template <class S >
900887 V8_INLINE TracedReferenceBase<S>& As () const {
901888 return reinterpret_cast <TracedReferenceBase<S>&>(
@@ -1033,6 +1020,19 @@ class TracedGlobal : public TracedReferenceBase<T> {
10331020 return reinterpret_cast <TracedGlobal<S>&>(
10341021 const_cast <TracedGlobal<T>&>(*this ));
10351022 }
1023+
1024+ /* *
1025+ * Adds a finalization callback to the handle. The type of this callback is
1026+ * similar to WeakCallbackType::kInternalFields, i.e., it will pass the
1027+ * parameter and the first two internal fields of the object.
1028+ *
1029+ * The callback is then supposed to reset the handle in the callback. No
1030+ * further V8 API may be called in this callback. In case additional work
1031+ * involving V8 needs to be done, a second callback can be scheduled using
1032+ * WeakCallbackInfo<void>::SetSecondPassCallback.
1033+ */
1034+ V8_INLINE void SetFinalizationCallback (
1035+ void * parameter, WeakCallbackInfo<void >::Callback callback);
10361036};
10371037
10381038/* *
@@ -1142,6 +1142,20 @@ class TracedReference : public TracedReferenceBase<T> {
11421142 return reinterpret_cast <TracedReference<S>&>(
11431143 const_cast <TracedReference<T>&>(*this ));
11441144 }
1145+
1146+ /* *
1147+ * Adds a finalization callback to the handle. The type of this callback is
1148+ * similar to WeakCallbackType::kInternalFields, i.e., it will pass the
1149+ * parameter and the first two internal fields of the object.
1150+ *
1151+ * The callback is then supposed to reset the handle in the callback. No
1152+ * further V8 API may be called in this callback. In case additional work
1153+ * involving V8 needs to be done, a second callback can be scheduled using
1154+ * WeakCallbackInfo<void>::SetSecondPassCallback.
1155+ */
1156+ V8_DEPRECATE_SOON (" Use TracedGlobal<> if callbacks are required." )
1157+ V8_INLINE void SetFinalizationCallback (
1158+ void * parameter, WeakCallbackInfo<void >::Callback callback);
11451159};
11461160
11471161 /* *
@@ -7618,7 +7632,7 @@ class V8_EXPORT EmbedderHeapTracer {
76187632 virtual void RegisterV8References (
76197633 const std::vector<std::pair<void *, void *> >& embedder_fields) = 0;
76207634
7621- V8_DEPRECATE_SOON (" Use version taking TracedReferenceBase<v8::Data> argument" )
7635+ V8_DEPRECATED (" Use version taking TracedReferenceBase<v8::Data> argument" )
76227636 void RegisterEmbedderReference (const TracedReferenceBase<v8::Value>& ref);
76237637 void RegisterEmbedderReference (const TracedReferenceBase<v8::Data>& ref);
76247638
@@ -7652,8 +7666,7 @@ class V8_EXPORT EmbedderHeapTracer {
76527666 * overriden to fill a |TraceSummary| that is used by V8 to schedule future
76537667 * garbage collections.
76547668 */
7655- V8_DEPRECATED (" Use version with parameter." ) virtual void TraceEpilogue () {}
7656- virtual void TraceEpilogue (TraceSummary* trace_summary);
7669+ virtual void TraceEpilogue (TraceSummary* trace_summary) {}
76577670
76587671 /* *
76597672 * Called upon entering the final marking pause. No more incremental marking
@@ -7704,8 +7717,7 @@ class V8_EXPORT EmbedderHeapTracer {
77047717 */
77057718 virtual void ResetHandleInNonTracingGC (
77067719 const v8::TracedReference<v8::Value>& handle);
7707- V8_DEPRECATE_SOON (
7708- " Use TracedReference version when not requiring destructors." )
7720+ V8_DEPRECATED (" Use TracedReference version when not requiring destructors." )
77097721 virtual void ResetHandleInNonTracingGC (
77107722 const v8::TracedGlobal<v8::Value>& handle);
77117723
@@ -10524,10 +10536,17 @@ uint16_t TracedReferenceBase<T>::WrapperClassId() const {
1052410536}
1052510537
1052610538template <class T >
10527- void TracedReferenceBase<T>::SetFinalizationCallback(
10539+ void TracedGlobal<T>::SetFinalizationCallback(
10540+ void * parameter, typename WeakCallbackInfo<void >::Callback callback) {
10541+ V8::SetFinalizationCallbackTraced (
10542+ reinterpret_cast <internal::Address*>(this ->val_ ), parameter, callback);
10543+ }
10544+
10545+ template <class T >
10546+ void TracedReference<T>::SetFinalizationCallback(
1052810547 void * parameter, typename WeakCallbackInfo<void >::Callback callback) {
10529- V8::SetFinalizationCallbackTraced (reinterpret_cast <internal::Address*>(val_),
10530- parameter, callback);
10548+ V8::SetFinalizationCallbackTraced (
10549+ reinterpret_cast <internal::Address*>( this -> val_ ), parameter, callback);
1053110550}
1053210551
1053310552template <typename T>
0 commit comments