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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate) | 139 static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate) |
140 { | 140 { |
141 return current(isolate).containsWrapper(object); | 141 return current(isolate).containsWrapper(object); |
142 } | 142 } |
143 | 143 |
144 v8::Local<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate) | 144 v8::Local<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate) |
145 { | 145 { |
146 if (m_isMainWorld) | 146 if (m_isMainWorld) |
147 return object->newLocalWrapper(isolate); | 147 return object->newLocalWrapper(isolate); |
148 return m_wrapperMap->newLocal(object, isolate); | 148 return m_wrapperMap->newLocal(isolate, object); |
149 } | 149 } |
150 | 150 |
151 void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable*
child, v8::Isolate* isolate) | 151 void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable*
child, v8::Isolate* isolate) |
152 { | 152 { |
153 if (m_isMainWorld) { | 153 if (m_isMainWorld) { |
154 child->setReference(parent, isolate); | 154 child->setReference(parent, isolate); |
155 return; | 155 return; |
156 } | 156 } |
157 m_wrapperMap->setReference(parent, child, isolate); | 157 m_wrapperMap->setReference(isolate, parent, child); |
158 } | 158 } |
159 | 159 |
160 bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, ScriptWrappa
ble* object) | 160 bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, ScriptWrappa
ble* object) |
161 { | 161 { |
162 if (m_isMainWorld) | 162 if (m_isMainWorld) |
163 return object->setReturnValue(returnValue); | 163 return object->setReturnValue(returnValue); |
164 return m_wrapperMap->setReturnValueFrom(returnValue, object); | 164 return m_wrapperMap->setReturnValueFrom(returnValue, object); |
165 } | 165 } |
166 | 166 |
167 bool containsWrapper(ScriptWrappable* object) | 167 bool containsWrapper(ScriptWrappable* object) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 template <> | 224 template <> |
225 inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWea
k(v8::Isolate* isolate, void* internalFields[v8::kInternalFieldsInWeakCallback],
ScriptWrappable* key) | 225 inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWea
k(v8::Isolate* isolate, void* internalFields[v8::kInternalFieldsInWeakCallback],
ScriptWrappable* key) |
226 { | 226 { |
227 auto typeInfo = reinterpret_cast<WrapperTypeInfo*>(internalFields[v8DOMWrapp
erTypeIndex]); | 227 auto typeInfo = reinterpret_cast<WrapperTypeInfo*>(internalFields[v8DOMWrapp
erTypeIndex]); |
228 typeInfo->derefObject(key); | 228 typeInfo->derefObject(key); |
229 } | 229 } |
230 | 230 |
231 } // namespace blink | 231 } // namespace blink |
232 | 232 |
233 #endif // DOMDataStore_h | 233 #endif // DOMDataStore_h |
OLD | NEW |