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

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

Issue 1683493003: Remove ContextScope from visitDOMWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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 3faa6aaa03e53c7d6816a9717706c3241e9f7b87..caf91073a0b13905e80c6cbb87fafe0eb6b9480c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
@@ -148,8 +148,8 @@ void DOMWrapperWorld::markWrappersInAllWorlds(ScriptWrappable* scriptWrappable,
if (!isMainThread())
return;
WorldMap& isolatedWorlds = isolatedWorldMap();
- for (auto& keyValuePair : isolatedWorlds) {
- DOMDataStore& dataStore = keyValuePair.value->domDataStore();
+ for (auto& world : isolatedWorlds.values()) {
+ DOMDataStore& dataStore = world->domDataStore();
if (dataStore.containsWrapper(scriptWrappable)) {
// Marking for the isolated worlds
dataStore.markWrapper(scriptWrappable);
@@ -157,6 +157,22 @@ void DOMWrapperWorld::markWrappersInAllWorlds(ScriptWrappable* scriptWrappable,
}
}
+void DOMWrapperWorld::setWrapperReferencesInAllWorlds(const v8::Persistent<v8::Object>& parent, ScriptWrappable* scriptWrappable, v8::Isolate* isolate)
+{
+ // Marking for the main world
+ scriptWrappable->setReference(parent, isolate);
+ if (!isMainThread())
+ return;
+ WorldMap& isolatedWorlds = isolatedWorldMap();
+ for (auto& world : isolatedWorlds.values()) {
+ DOMDataStore& dataStore = world->domDataStore();
+ if (dataStore.containsWrapper(scriptWrappable)) {
+ // Marking for the isolated worlds
+ dataStore.setReference(parent, scriptWrappable, isolate);
+ }
+ }
+}
+
DOMWrapperWorld::~DOMWrapperWorld()
{
ASSERT(!isMainWorld());

Powered by Google App Engine
This is Rietveld 408576698