| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // | 147 // |
| 148 // The definition of fromNode is placed in Node.h because we'd like to | 148 // The definition of fromNode is placed in Node.h because we'd like to |
| 149 // inline calls to fromNode as much as possible. | 149 // inline calls to fromNode as much as possible. |
| 150 static ScriptWrappable* fromNode(Node*); | 150 static ScriptWrappable* fromNode(Node*); |
| 151 | 151 |
| 152 bool setReturnValue(v8::ReturnValue<v8::Value> returnValue) { | 152 bool setReturnValue(v8::ReturnValue<v8::Value> returnValue) { |
| 153 returnValue.Set(m_mainWorldWrapper); | 153 returnValue.Set(m_mainWorldWrapper); |
| 154 return containsWrapper(); | 154 return containsWrapper(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void setReference(const v8::Persistent<v8::Object>& parent, | |
| 158 v8::Isolate* isolate) { | |
| 159 isolate->SetReference(parent, m_mainWorldWrapper); | |
| 160 } | |
| 161 | |
| 162 bool containsWrapper() const { return !m_mainWorldWrapper.IsEmpty(); } | 157 bool containsWrapper() const { return !m_mainWorldWrapper.IsEmpty(); } |
| 163 | 158 |
| 164 // Mark wrapper of this ScriptWrappable as alive in V8. Only marks | 159 // Mark wrapper of this ScriptWrappable as alive in V8. Only marks |
| 165 // wrapper in the main world. To mark wrappers in all worlds call | 160 // wrapper in the main world. To mark wrappers in all worlds call |
| 166 // ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*) | 161 // ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*) |
| 167 void markWrapper(const WrapperVisitor*) const; | 162 void markWrapper(const WrapperVisitor*) const; |
| 168 | 163 |
| 169 private: | 164 private: |
| 170 // These classes are exceptionally allowed to use mainWorldWrapper(). | 165 // These classes are exceptionally allowed to use mainWorldWrapper(). |
| 171 friend class DOMDataStore; | 166 friend class DOMDataStore; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 #define DECLARE_WRAPPERTYPEINFO() \ | 211 #define DECLARE_WRAPPERTYPEINFO() \ |
| 217 public: \ | 212 public: \ |
| 218 const WrapperTypeInfo* wrapperTypeInfo() const override; \ | 213 const WrapperTypeInfo* wrapperTypeInfo() const override; \ |
| 219 \ | 214 \ |
| 220 private: \ | 215 private: \ |
| 221 typedef void end_of_define_wrappertypeinfo_not_reached_t | 216 typedef void end_of_define_wrappertypeinfo_not_reached_t |
| 222 | 217 |
| 223 } // namespace blink | 218 } // namespace blink |
| 224 | 219 |
| 225 #endif // ScriptWrappable_h | 220 #endif // ScriptWrappable_h |
| OLD | NEW |