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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 template<typename T> | 106 template<typename T> |
107 inline v8::Handle<v8::Object> get(T* object) | 107 inline v8::Handle<v8::Object> get(T* object) |
108 { | 108 { |
109 if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == Mai
nWorld) | 109 if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == Mai
nWorld) |
110 return ScriptWrappable::getWrapperFromObject(object); | 110 return ScriptWrappable::getWrapperFromObject(object); |
111 return m_wrapperMap.get(object); | 111 return m_wrapperMap.get(object); |
112 } | 112 } |
113 | 113 |
114 void reportMemoryUsage(MemoryObjectInfo*) const; | |
115 | |
116 private: | 114 private: |
117 template<typename T> | 115 template<typename T> |
118 inline void set(T* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isol
ate, const WrapperConfiguration& configuration) | 116 inline void set(T* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isol
ate, const WrapperConfiguration& configuration) |
119 { | 117 { |
120 ASSERT(!!object); | 118 ASSERT(!!object); |
121 ASSERT(!wrapper.IsEmpty()); | 119 ASSERT(!wrapper.IsEmpty()); |
122 if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == Mai
nWorld) { | 120 if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == Mai
nWorld) { |
123 ScriptWrappable::setWrapperInObject(object, wrapper, isolate, config
uration); | 121 ScriptWrappable::setWrapperInObject(object, wrapper, isolate, config
uration); |
124 return; | 122 return; |
125 } | 123 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 WrapperTypeInfo* type = toWrapperTypeInfo(wrapper); | 155 WrapperTypeInfo* type = toWrapperTypeInfo(wrapper); |
158 ASSERT(type->derefObjectFunction); | 156 ASSERT(type->derefObjectFunction); |
159 void* key = static_cast<void*>(toNative(wrapper)); | 157 void* key = static_cast<void*>(toNative(wrapper)); |
160 map->removeAndDispose(key, wrapper, isolate); | 158 map->removeAndDispose(key, wrapper, isolate); |
161 type->derefObject(key); | 159 type->derefObject(key); |
162 } | 160 } |
163 | 161 |
164 } // namespace WebCore | 162 } // namespace WebCore |
165 | 163 |
166 #endif // DOMDataStore_h | 164 #endif // DOMDataStore_h |
OLD | NEW |