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

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

Issue 209713003: Make DOMWrapperWorld::current() return a reference instead of a pointer (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/V8PerIsolateData.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 bd1f190c5b247c0efe609a2026c46e18635eb63a..059c4ad0bf5894b4636c753e14fda12d23171241 100644
--- a/Source/bindings/v8/V8PerContextData.cpp
+++ b/Source/bindings/v8/V8PerContextData.cpp
@@ -68,7 +68,7 @@ public:
V8PerContextData* perContextData() const { return m_perContextData; }
void setPerContextData(V8PerContextData* data) { m_perContextData = data; }
- DOMWrapperWorld* world() const { return m_world.get(); }
+ DOMWrapperWorld& world() const { return *m_world; }
v8::Handle<v8::Context> context() const { return m_context.newLocal(m_isolate); }
private:
@@ -78,6 +78,7 @@ private:
, m_perContextData(0)
, m_world(world)
{
+ ASSERT(m_world);
m_context.setWeak(this, &V8PerContextDataHolder::weakCallback);
context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this);
}
@@ -130,10 +131,9 @@ V8PerContextData* V8PerContextData::from(v8::Handle<v8::Context> context)
return V8PerContextDataHolder::from(context)->perContextData();
}
-DOMWrapperWorld* V8PerContextData::world(v8::Handle<v8::Context> context)
+DOMWrapperWorld& V8PerContextData::world(v8::Handle<v8::Context> context)
{
- DOMWrapperWorld* world = V8PerContextDataHolder::from(context)->world();
- ASSERT(world);
+ DOMWrapperWorld& world = V8PerContextDataHolder::from(context)->world();
return world;
}
« no previous file with comments | « Source/bindings/v8/V8PerContextData.h ('k') | Source/bindings/v8/V8PerIsolateData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698