Chromium Code Reviews| 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 9e6672465511eb4ba8ab3d079ed680d821684127..b09e47092f972643333fb67394f18d3cc0f46c5d 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp |
| @@ -133,10 +133,19 @@ void DOMWrapperWorld::markWrappersInAllWorlds( |
| // needed (there is no way to get from one wrapper to another), nor wanted |
| // (big performance and memory overhead). |
| - // Marking for the main world |
| - scriptWrappable->markWrapper(visitor); |
| - if (!isMainThread()) |
| + // Handle marking in per-worker wrapper worlds. |
| + if (!isMainThread()) { |
| + v8::Isolate* isolate = ThreadState::current()->isolate(); |
| + if (isolate && !isolate->GetCurrentContext().IsEmpty()) { |
|
jochen (gone - plz use gerrit)
2017/01/30 15:34:01
maybe remove the GetCurrentContext() call? That cr
|
| + DOMDataStore& dataStore = |
| + DOMWrapperWorld::current(isolate).domDataStore(); |
| + if (dataStore.containsWrapper(scriptWrappable)) { |
| + dataStore.markWrapper(scriptWrappable); |
| + } |
| + } |
| return; |
| + } |
| + scriptWrappable->markWrapper(visitor); |
| WorldMap& isolatedWorlds = isolatedWorldMap(); |
| for (auto& world : isolatedWorlds.values()) { |
| DOMDataStore& dataStore = world->domDataStore(); |