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

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

Issue 2663643002: For a worker, mark relative to its wrapper map. (Closed)
Patch Set: check DOMDataStore access Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/fast/workers/worker-gc-alive.html ('k') | 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 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();
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/workers/worker-gc-alive.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698