| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 m_liveRoot.set(isolate(), v8::Null(isolate())); | 179 m_liveRoot.set(isolate(), v8::Null(isolate())); |
| 180 return m_liveRoot.getUnsafe(); | 180 return m_liveRoot.getUnsafe(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // willBeDestroyed() clear things that should be cleared before | 183 // willBeDestroyed() clear things that should be cleared before |
| 184 // ThreadState::detach() gets called. | 184 // ThreadState::detach() gets called. |
| 185 void V8PerIsolateData::willBeDestroyed(v8::Isolate* isolate) | 185 void V8PerIsolateData::willBeDestroyed(v8::Isolate* isolate) |
| 186 { | 186 { |
| 187 V8PerIsolateData* data = from(isolate); | 187 V8PerIsolateData* data = from(isolate); |
| 188 | 188 |
| 189 data->m_threadDebugger.clear(); | 189 data->m_threadDebugger.reset(); |
| 190 // Clear any data that may have handles into the heap, | 190 // Clear any data that may have handles into the heap, |
| 191 // prior to calling ThreadState::detach(). | 191 // prior to calling ThreadState::detach(). |
| 192 data->clearEndOfScopeTasks(); | 192 data->clearEndOfScopeTasks(); |
| 193 | 193 |
| 194 data->m_activeScriptWrappables.clear(); | 194 data->m_activeScriptWrappables.clear(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 // destroy() clear things that should be cleared after ThreadState::detach() | 197 // destroy() clear things that should be cleared after ThreadState::detach() |
| 198 // gets called but before the Isolate exits. | 198 // gets called but before the Isolate exits. |
| 199 void V8PerIsolateData::destroy(v8::Isolate* isolate) | 199 void V8PerIsolateData::destroy(v8::Isolate* isolate) |
| 200 { | 200 { |
| 201 isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback); | 201 isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback); |
| 202 isolate->RemoveMicrotasksCompletedCallback(µtasksCompletedCallback); | 202 isolate->RemoveMicrotasksCompletedCallback(µtasksCompletedCallback); |
| 203 V8PerIsolateData* data = from(isolate); | 203 V8PerIsolateData* data = from(isolate); |
| 204 | 204 |
| 205 // Clear everything before exiting the Isolate. | 205 // Clear everything before exiting the Isolate. |
| 206 if (data->m_scriptRegexpScriptState) | 206 if (data->m_scriptRegexpScriptState) |
| 207 data->m_scriptRegexpScriptState->disposePerContextData(); | 207 data->m_scriptRegexpScriptState->disposePerContextData(); |
| 208 data->m_liveRoot.clear(); | 208 data->m_liveRoot.clear(); |
| 209 data->m_hiddenValue.clear(); | 209 data->m_hiddenValue.reset(); |
| 210 data->m_stringCache->dispose(); | 210 data->m_stringCache->dispose(); |
| 211 data->m_stringCache.clear(); | 211 data->m_stringCache.reset(); |
| 212 data->m_interfaceTemplateMapForNonMainWorld.clear(); | 212 data->m_interfaceTemplateMapForNonMainWorld.clear(); |
| 213 data->m_interfaceTemplateMapForMainWorld.clear(); | 213 data->m_interfaceTemplateMapForMainWorld.clear(); |
| 214 data->m_operationTemplateMapForNonMainWorld.clear(); | 214 data->m_operationTemplateMapForNonMainWorld.clear(); |
| 215 data->m_operationTemplateMapForMainWorld.clear(); | 215 data->m_operationTemplateMapForMainWorld.clear(); |
| 216 if (isMainThread()) | 216 if (isMainThread()) |
| 217 mainThreadPerIsolateData = 0; | 217 mainThreadPerIsolateData = 0; |
| 218 | 218 |
| 219 // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. | 219 // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. |
| 220 isolate->Exit(); | 220 isolate->Exit(); |
| 221 delete data; | 221 delete data; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 345 |
| 346 void V8PerIsolateData::addActiveScriptWrappable(ActiveScriptWrappable* wrappable
) | 346 void V8PerIsolateData::addActiveScriptWrappable(ActiveScriptWrappable* wrappable
) |
| 347 { | 347 { |
| 348 if (!m_activeScriptWrappables) | 348 if (!m_activeScriptWrappables) |
| 349 m_activeScriptWrappables = new ActiveScriptWrappableSet(); | 349 m_activeScriptWrappables = new ActiveScriptWrappableSet(); |
| 350 | 350 |
| 351 m_activeScriptWrappables->add(wrappable); | 351 m_activeScriptWrappables->add(wrappable); |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace blink | 354 } // namespace blink |
| OLD | NEW |