Chromium Code Reviews| Index: src/handles.h |
| diff --git a/src/handles.h b/src/handles.h |
| index b0b271c5c634c14b8911d66f508a35f6e4fb94a6..84d3aebfc8a284ae540a0e12299f8c0ec65000d7 100644 |
| --- a/src/handles.h |
| +++ b/src/handles.h |
| @@ -64,9 +64,7 @@ class Handle { |
| INLINE(T* operator ->() const) { return operator*(); } |
| // Check if this handle refers to the exact same object as the other handle. |
| - bool is_identical_to(const Handle<T> other) const { |
| - return *location_ == *other.location_; |
| - } |
| + INLINE(bool is_identical_to(const Handle<T> other) const); |
| // Provides the C++ dereference operator. |
| INLINE(T* operator*() const); |
| @@ -341,29 +339,15 @@ class NoHandleAllocation BASE_EMBEDDED { |
| }; |
| -class NoHandleDereference BASE_EMBEDDED { |
| - public: |
| -#ifndef DEBUG |
| - explicit NoHandleDereference(Isolate* isolate) {} |
| - ~NoHandleDereference() {} |
| -#else |
| - explicit inline NoHandleDereference(Isolate* isolate); |
| - inline ~NoHandleDereference(); |
| - private: |
| - Isolate* isolate_; |
| - bool old_state_; |
| -#endif |
| -}; |
| - |
| - |
| -class AllowHandleDereference BASE_EMBEDDED { |
| +class HandleDereferenceGuard BASE_EMBEDDED { |
| public: |
| + enum State { ALLOW, DISALLOW}; |
|
Jakob Kummerow
2013/03/13 15:50:31
nit: space before '}'
Yang
2013/03/13 17:00:15
Done.
|
| #ifndef DEBUG |
| - explicit AllowHandleDereference(Isolate* isolate) {} |
| - ~AllowHandleDereference() {} |
| + HandleDereferenceGuard(Isolate* isolate, State state) { } |
| + ~HandleDereferenceGuard() { } |
| #else |
| - explicit inline AllowHandleDereference(Isolate* isolate); |
| - inline ~AllowHandleDereference(); |
| + inline HandleDereferenceGuard(Isolate* isolate, State state); |
| + inline ~HandleDereferenceGuard(); |
| private: |
| Isolate* isolate_; |
| bool old_state_; |