| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 static v8::Local<v8::Object> getWrapper(ScriptWrappable* object, v8::Isolate
* isolate) | 101 static v8::Local<v8::Object> getWrapper(ScriptWrappable* object, v8::Isolate
* isolate) |
| 102 { | 102 { |
| 103 return current(isolate).get(object, isolate); | 103 return current(isolate).get(object, isolate); |
| 104 } | 104 } |
| 105 | 105 |
| 106 static v8::Local<v8::Object> getWrapper(Node* node, v8::Isolate* isolate) | 106 static v8::Local<v8::Object> getWrapper(Node* node, v8::Isolate* isolate) |
| 107 { | 107 { |
| 108 if (canUseScriptWrappable(node)) | 108 if (canUseScriptWrappable(node)) |
| 109 return ScriptWrappable::fromNode(node)->newLocalWrapper(isolate); | 109 return ScriptWrappable::fromNode(node)->mainWorldWrapper(isolate); |
| 110 return current(isolate).get(ScriptWrappable::fromNode(node), isolate); | 110 return current(isolate).get(ScriptWrappable::fromNode(node), isolate); |
| 111 } | 111 } |
| 112 | 112 |
| 113 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, Sc
riptWrappable* child, v8::Isolate* isolate) | 113 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, Sc
riptWrappable* child, v8::Isolate* isolate) |
| 114 { | 114 { |
| 115 current(isolate).setReference(parent, child, isolate); | 115 current(isolate).setReference(parent, child, isolate); |
| 116 } | 116 } |
| 117 | 117 |
| 118 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, No
de* child, v8::Isolate* isolate) | 118 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, No
de* child, v8::Isolate* isolate) |
| 119 { | 119 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate) | 144 static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate) |
| 145 { | 145 { |
| 146 return current(isolate).containsWrapper(object); | 146 return current(isolate).containsWrapper(object); |
| 147 } | 147 } |
| 148 | 148 |
| 149 v8::Local<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate) | 149 v8::Local<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate) |
| 150 { | 150 { |
| 151 if (m_isMainWorld) | 151 if (m_isMainWorld) |
| 152 return object->newLocalWrapper(isolate); | 152 return object->mainWorldWrapper(isolate); |
| 153 return m_wrapperMap->newLocal(isolate, object); | 153 return m_wrapperMap->newLocal(isolate, object); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void markWrapper(ScriptWrappable* scriptWrappable) | 156 void markWrapper(ScriptWrappable* scriptWrappable) |
| 157 { | 157 { |
| 158 m_wrapperMap->markWrapper(scriptWrappable); | 158 m_wrapperMap->markWrapper(scriptWrappable); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable*
child, v8::Isolate* isolate) | 161 void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable*
child, v8::Isolate* isolate) |
| 162 { | 162 { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 template<> | 228 template<> |
| 229 inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWea
k(const v8::WeakCallbackInfo<WeakCallbackDataType>& data) | 229 inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWea
k(const v8::WeakCallbackInfo<WeakCallbackDataType>& data) |
| 230 { | 230 { |
| 231 auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalFi
eld(v8DOMWrapperTypeIndex)); | 231 auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalFi
eld(v8DOMWrapperTypeIndex)); |
| 232 wrapperTypeInfo->wrapperDestroyed(); | 232 wrapperTypeInfo->wrapperDestroyed(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace blink | 235 } // namespace blink |
| 236 | 236 |
| 237 #endif // DOMDataStore_h | 237 #endif // DOMDataStore_h |
| OLD | NEW |