Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp

Issue 1966743004: Move tracking of ActiveScriptWrappables to V8PerIsolateData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lazy creation of map Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.clear();
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
194 data->m_activeScriptWrappables.clear();
193 } 195 }
194 196
195 // destroy() clear things that should be cleared after ThreadState::detach() 197 // destroy() clear things that should be cleared after ThreadState::detach()
196 // gets called but before the Isolate exits. 198 // gets called but before the Isolate exits.
197 void V8PerIsolateData::destroy(v8::Isolate* isolate) 199 void V8PerIsolateData::destroy(v8::Isolate* isolate)
198 { 200 {
199 isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback); 201 isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback);
200 isolate->RemoveMicrotasksCompletedCallback(&microtasksCompletedCallback); 202 isolate->RemoveMicrotasksCompletedCallback(&microtasksCompletedCallback);
201 V8PerIsolateData* data = from(isolate); 203 V8PerIsolateData* data = from(isolate);
202 204
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 { 336 {
335 ASSERT(!m_threadDebugger); 337 ASSERT(!m_threadDebugger);
336 m_threadDebugger = std::move(threadDebugger); 338 m_threadDebugger = std::move(threadDebugger);
337 } 339 }
338 340
339 ThreadDebugger* V8PerIsolateData::threadDebugger() 341 ThreadDebugger* V8PerIsolateData::threadDebugger()
340 { 342 {
341 return m_threadDebugger.get(); 343 return m_threadDebugger.get();
342 } 344 }
343 345
346 void V8PerIsolateData::addActiveScriptWrappable(ActiveScriptWrappable* wrappable )
347 {
348 if (!m_activeScriptWrappables)
349 m_activeScriptWrappables = new ActiveScriptWrappableSet();
350
351 m_activeScriptWrappables->add(wrappable);
352 }
353
344 } // namespace blink 354 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698