Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index b3dff3fee107a6e3992e925b488d8ba760723e50..acc4a86823d93b955ba26ade219ce0e4ea433e6e 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -4541,8 +4541,7 @@ class V8EXPORT V8 { |
| static internal::Object** GlobalizeReference(internal::Isolate* isolate, |
| internal::Object** handle); |
| - static void DisposeGlobal(internal::Isolate* isolate, |
| - internal::Object** global_handle); |
| + static void DisposeGlobal(internal::Object** global_handle); |
| typedef WeakReferenceCallbacks<Value, void>::Revivable RevivableCallback; |
| static void MakeWeak(internal::Isolate* isolate, |
| internal::Object** global_handle, |
| @@ -5486,18 +5485,17 @@ bool Persistent<T>::IsWeak(Isolate* isolate) const { |
| template <class T> |
| void Persistent<T>::Dispose() { |
| - Dispose(Isolate::GetCurrent()); |
| + if (this->IsEmpty()) return; |
| + V8::DisposeGlobal(reinterpret_cast<internal::Object**>(this->val_)); |
| +#ifndef V8_USE_UNSAFE_HANDLES |
| + val_ = 0; |
| +#endif |
| } |
| template <class T> |
| void Persistent<T>::Dispose(Isolate* isolate) { |
|
Sven Panne
2013/05/23 08:09:11
I thought we want to remove this? Or is it just to
dcarney
2013/05/23 08:15:59
yeah, we've only just started moving chrome away f
|
| - if (this->IsEmpty()) return; |
| - V8::DisposeGlobal(reinterpret_cast<internal::Isolate*>(isolate), |
| - reinterpret_cast<internal::Object**>(this->val_)); |
| -#ifndef V8_USE_UNSAFE_HANDLES |
| - val_ = 0; |
| -#endif |
| + Dispose(); |
| } |