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

Unified Diff: Source/bindings/v8/V8PerContextData.cpp

Issue 189513012: DOMDataStore should be cleared when shutting down worker threads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/bindings/v8/V8PerContextData.h ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8PerContextData.cpp
diff --git a/Source/bindings/v8/V8PerContextData.cpp b/Source/bindings/v8/V8PerContextData.cpp
index 169e2a16fd6bddb53897e8983dbf667c72d59887..24288ecc2923209088dc6277982697c6965e16bf 100644
--- a/Source/bindings/v8/V8PerContextData.cpp
+++ b/Source/bindings/v8/V8PerContextData.cpp
@@ -51,7 +51,7 @@ static void disposeMapWithUnsafePersistentValues(Map* map)
class V8PerContextDataHolder {
WTF_MAKE_NONCOPYABLE(V8PerContextDataHolder);
public:
- static void install(v8::Handle<v8::Context> context, DOMWrapperWorld* world)
+ static void install(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperWorld> world)
{
new V8PerContextDataHolder(context, world);
}
@@ -67,10 +67,10 @@ public:
V8PerContextData* perContextData() const { return m_perContextData; }
void setPerContextData(V8PerContextData* data) { m_perContextData = data; }
- DOMWrapperWorld* world() const { return m_world; }
+ DOMWrapperWorld* world() const { return m_world.get(); }
private:
- V8PerContextDataHolder(v8::Handle<v8::Context> context, DOMWrapperWorld* world)
+ V8PerContextDataHolder(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperWorld> world)
: m_context(v8::Isolate::GetCurrent(), context)
, m_perContextData(0)
, m_world(world)
@@ -89,13 +89,10 @@ private:
ScopedPersistent<v8::Context> m_context;
V8PerContextData* m_perContextData;
- // This should not be a RefPtr. Otherwise, it creates a cycle:
- // V8PerContextData => DOMWrapperWorld => DOMDataStore => global objects
- // => Window or WorkerGlobalScope => V8PerContextData.
- DOMWrapperWorld* m_world;
+ RefPtr<DOMWrapperWorld> m_world;
};
-V8PerContextData::V8PerContextData(v8::Handle<v8::Context> context, DOMWrapperWorld* world)
+V8PerContextData::V8PerContextData(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperWorld> world)
: m_activityLogger(0)
, m_isolate(context->GetIsolate())
, m_contextHolder(adoptPtr(new gin::ContextHolder(context->GetIsolate())))
« no previous file with comments | « Source/bindings/v8/V8PerContextData.h ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698