| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 { | 69 { |
| 70 m_handle.Reset(isolate, handle); | 70 m_handle.Reset(isolate, handle); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Note: This is clear in the OwnPtr sense, not the v8::Handle sense. | 73 // Note: This is clear in the OwnPtr sense, not the v8::Handle sense. |
| 74 void clear() | 74 void clear() |
| 75 { | 75 { |
| 76 m_handle.Reset(); | 76 m_handle.Reset(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool operator==(const ScopedPersistent<T>& other) const | 79 bool operator==(const ScopedPersistent<T>& other) |
| 80 { | 80 { |
| 81 return m_handle == other.m_handle; | 81 return m_handle == other.m_handle; |
| 82 } | 82 } |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 // FIXME: This function does an unsafe handle access. Remove it. | 85 // FIXME: This function does an unsafe handle access. Remove it. |
| 86 friend class V8AbstractEventListener; | 86 friend class V8AbstractEventListener; |
| 87 friend class V8PerIsolateData; | 87 friend class V8PerIsolateData; |
| 88 ALWAYS_INLINE v8::Persistent<T>& getUnsafe() | 88 ALWAYS_INLINE v8::Persistent<T>& getUnsafe() |
| 89 { | 89 { |
| 90 return m_handle; | 90 return m_handle; |
| 91 } | 91 } |
| 92 | 92 |
| 93 v8::Persistent<T> m_handle; | 93 v8::Persistent<T> m_handle; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace WebCore | 96 } // namespace WebCore |
| 97 | 97 |
| 98 #endif // ScopedPersistent_h | 98 #endif // ScopedPersistent_h |
| OLD | NEW |