| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 isolate->SetObjectGroupId(v8::Persistent<v8::Value>::Cast(m_wrapper), gr
oupId); | 144 isolate->SetObjectGroupId(v8::Persistent<v8::Value>::Cast(m_wrapper), gr
oupId); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void setReference(const v8::Persistent<v8::Object>& parent, v8::Isolate* iso
late) | 147 void setReference(const v8::Persistent<v8::Object>& parent, v8::Isolate* iso
late) |
| 148 { | 148 { |
| 149 isolate->SetReference(parent, m_wrapper); | 149 isolate->SetReference(parent, m_wrapper); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool containsWrapper() const { return !m_wrapper.IsEmpty(); } | 152 bool containsWrapper() const { return !m_wrapper.IsEmpty(); } |
| 153 | 153 |
| 154 virtual bool hasPendingActivity() const; |
| 155 |
| 154 #if !ENABLE(OILPAN) | 156 #if !ENABLE(OILPAN) |
| 155 protected: | 157 protected: |
| 156 virtual ~ScriptWrappable() | 158 virtual ~ScriptWrappable() |
| 157 { | 159 { |
| 158 // We must not get deleted as long as we contain a wrapper. If this happ
ens, we screwed up ref | 160 // We must not get deleted as long as we contain a wrapper. If this happ
ens, we screwed up ref |
| 159 // counting somewhere. Crash here instead of crashing during a later gc
cycle. | 161 // counting somewhere. Crash here instead of crashing during a later gc
cycle. |
| 160 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper()); | 162 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper()); |
| 161 } | 163 } |
| 162 #endif | 164 #endif |
| 163 // With Oilpan we don't need a ScriptWrappable destructor. | 165 // With Oilpan we don't need a ScriptWrappable destructor. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // in X's cpp code, and instantiate X, i.e. "template class X;". | 264 // in X's cpp code, and instantiate X, i.e. "template class X;". |
| 263 #define DECLARE_WRAPPERTYPEINFO() \ | 265 #define DECLARE_WRAPPERTYPEINFO() \ |
| 264 public: \ | 266 public: \ |
| 265 const WrapperTypeInfo* wrapperTypeInfo() const override; \ | 267 const WrapperTypeInfo* wrapperTypeInfo() const override; \ |
| 266 private: \ | 268 private: \ |
| 267 typedef void end_of_define_wrappertypeinfo_not_reached_t | 269 typedef void end_of_define_wrappertypeinfo_not_reached_t |
| 268 | 270 |
| 269 } // namespace blink | 271 } // namespace blink |
| 270 | 272 |
| 271 #endif // ScriptWrappable_h | 273 #endif // ScriptWrappable_h |
| OLD | NEW |