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 | |
156 #if !ENABLE(OILPAN) | 154 #if !ENABLE(OILPAN) |
157 protected: | 155 protected: |
158 virtual ~ScriptWrappable() | 156 virtual ~ScriptWrappable() |
159 { | 157 { |
160 // We must not get deleted as long as we contain a wrapper. If this happ
ens, we screwed up ref | 158 // We must not get deleted as long as we contain a wrapper. If this happ
ens, we screwed up ref |
161 // counting somewhere. Crash here instead of crashing during a later gc
cycle. | 159 // counting somewhere. Crash here instead of crashing during a later gc
cycle. |
162 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper()); | 160 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper()); |
163 } | 161 } |
164 #endif | 162 #endif |
165 // With Oilpan we don't need a ScriptWrappable destructor. | 163 // With Oilpan we don't need a ScriptWrappable destructor. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // in X's cpp code, and instantiate X, i.e. "template class X;". | 262 // in X's cpp code, and instantiate X, i.e. "template class X;". |
265 #define DECLARE_WRAPPERTYPEINFO() \ | 263 #define DECLARE_WRAPPERTYPEINFO() \ |
266 public: \ | 264 public: \ |
267 const WrapperTypeInfo* wrapperTypeInfo() const override; \ | 265 const WrapperTypeInfo* wrapperTypeInfo() const override; \ |
268 private: \ | 266 private: \ |
269 typedef void end_of_define_wrappertypeinfo_not_reached_t | 267 typedef void end_of_define_wrappertypeinfo_not_reached_t |
270 | 268 |
271 } // namespace blink | 269 } // namespace blink |
272 | 270 |
273 #endif // ScriptWrappable_h | 271 #endif // ScriptWrappable_h |
OLD | NEW |