Index: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h |
diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h |
index 2f6db85055108ee4785b83fea0230388f30a7ddf..fdbaa431aa9c2ce9b513e25cc71a0e5f398814ad 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h |
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h |
@@ -43,7 +43,6 @@ |
namespace blink { |
class DOMDataStore; |
-class DOMObjectHolderBase; |
enum WorldIdConstants { |
MainWorldId = 0, |
@@ -54,6 +53,8 @@ |
WorkerWorldId, |
TestingWorldId, |
}; |
+ |
+class DOMObjectHolderBase; |
// This class represent a collection of DOM wrappers for a specific world. |
class CORE_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { |
@@ -113,6 +114,7 @@ |
int worldId() const { return m_worldId; } |
DOMDataStore& domDataStore() const { return *m_domDataStore; } |
+ public: |
template <typename T> |
void registerDOMObjectHolder(v8::Isolate*, T*, v8::Local<v8::Value>); |
@@ -124,29 +126,6 @@ |
void registerDOMObjectHolderInternal(std::unique_ptr<DOMObjectHolderBase>); |
void unregisterDOMObjectHolder(DOMObjectHolderBase*); |
- // Dissociates all wrappers in all worlds associated with |scriptWrappable|. |
- // |
- // Do not use this function except for DOMWindow. Only DOMWindow needs to |
- // dissociate wrappers from the ScriptWrappable because of the following two |
- // reasons. |
- // |
- // Reason 1) Case of the main world |
- // A DOMWindow may be collected by Blink GC *before* V8 GC collects the |
- // wrapper because the wrapper object associated with a DOMWindow is a global |
- // proxy object, which remains after navigations. We don't want V8 GC |
- // to reset the weak persistent handle within the DOMWindow *after* Blink GC |
- // collects the DOMWindow because it's use-after-free. Thus, we need to |
- // dissociate the wrapper in advance. |
- // |
- // Reason 2) Case of isolated worlds |
- // As same, a DOMWindow may be collected before the wrapper gets collected. |
- // A DOMWrapperMap supports mapping from ScriptWrappable* to v8::Global<T>, |
- // and we don't want to leave an entry of an already-dead DOMWindow* to the |
- // persistent handle for the global proxy object, especially considering that |
- // the address to the already-dead DOMWindow* may be re-used. |
- friend class DOMWindow; |
- static void dissociateDOMWindowWrappersInAllWorlds(ScriptWrappable*); |
- |
static unsigned isolatedWorldCount; |
const int m_worldId; |