| 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 62ee227650a36c24720f7bb4e9295a1c5cb1f41d..c1e74fb3f184f4dd79032f1b0e981230d221a18d 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
|
| @@ -137,6 +137,27 @@ void DOMWrapperWorld::allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld>>& wor
|
| worlds.append(it->value);
|
| }
|
|
|
| +void DOMWrapperWorld::markWrappersInAllWorlds(ScriptWrappable* scriptWrappable, v8::Isolate* isolate)
|
| +{
|
| + // TODO(hlopko): Currently wrapper in one world will keep wrappers in all
|
| + // worlds alive (possibly holding on entire documents). This is neither
|
| + // 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(isolate);
|
| + if (!isMainThread())
|
| + return;
|
| + WorldMap& isolatedWorlds = isolatedWorldMap();
|
| + for (auto& keyValuePair : isolatedWorlds) {
|
| + DOMDataStore& dataStore = keyValuePair.value->domDataStore();
|
| + if (dataStore.containsWrapper(scriptWrappable)) {
|
| + // Marking for the isolated worlds
|
| + dataStore.markWrapper(scriptWrappable);
|
| + }
|
| + }
|
| +}
|
| +
|
| DOMWrapperWorld::~DOMWrapperWorld()
|
| {
|
| ASSERT(!isMainWorld());
|
|
|