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

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

Issue 2693893007: binding: Changes the association among global-proxy/global/window-instance (2nd attempt). (Closed)
Patch Set: Fixed a typo in DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds. Created 3 years, 8 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 21331ecd1ecb5eb3b0b82dddf4f1562c483f9d84..b6c72dbbf4bed74f834958ebed0b15c4078b778d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
@@ -31,15 +31,9 @@
#include "bindings/core/v8/DOMWrapperWorld.h"
#include <memory>
+
#include "bindings/core/v8/DOMDataStore.h"
-#include "bindings/core/v8/ScriptController.h"
-#include "bindings/core/v8/V8Binding.h"
-#include "bindings/core/v8/V8DOMActivityLogger.h"
-#include "bindings/core/v8/V8DOMWrapper.h"
-#include "bindings/core/v8/V8Window.h"
-#include "bindings/core/v8/WindowProxy.h"
-#include "bindings/core/v8/WrapperTypeInfo.h"
-#include "core/dom/ExecutionContext.h"
+#include "bindings/core/v8/ScriptFunction.h"
#include "platform/wtf/HashTraits.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/StdLibExtras.h"
@@ -337,4 +331,15 @@ int DOMWrapperWorld::GenerateWorldIdForType(WorldType world_type) {
return kInvalidWorldId;
}
+void DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds(
+ ScriptWrappable* script_wrappable) {
+ DCHECK(script_wrappable);
+ DCHECK(IsMainThread());
+
+ script_wrappable->UnsetWrapperIfAny();
+
+ for (auto& world : GetWorldMap().Values())
+ world->DomDataStore().UnsetWrapperIfAny(script_wrappable);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698