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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp

Issue 2680863004: [wrapper-tracing] Reset TLS on disposing (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
index 0c43fadfa4bad3e9bab67a766ae98ff6ae61fa21..93a864ad94ecae48e73ad3019a948239cffa088b 100644
--- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
@@ -141,8 +141,9 @@ void DOMWrapperWorld::markWrappersInAllWorlds(
// Handle marking in per-worker wrapper worlds.
if (!isMainThread()) {
DCHECK(ThreadState::current()->isolate());
- if (workerWorld()) {
- DOMDataStore& dataStore = workerWorld()->domDataStore();
+ DOMWrapperWorld* worker = workerWorld();
+ if (worker) {
+ DOMDataStore& dataStore = worker->domDataStore();
if (dataStore.containsWrapper(scriptWrappable)) {
dataStore.markWrapper(scriptWrappable);
}
@@ -187,10 +188,6 @@ DOMWrapperWorld::~DOMWrapperWorld() {
dispose();
- if (m_worldId == WorkerWorldId) {
- workerWorld() = nullptr;
- }
-
if (!isIsolatedWorld())
return;
@@ -209,6 +206,8 @@ DOMWrapperWorld::~DOMWrapperWorld() {
void DOMWrapperWorld::dispose() {
m_domObjectHolders.clear();
m_domDataStore.reset();
+ if (isWorkerWorld())
+ workerWorld() = nullptr;
}
#if DCHECK_IS_ON()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698