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

Unified Diff: Source/bindings/v8/DOMWrapperWorld.h

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/DOMRequestState.h ('k') | Source/bindings/v8/DOMWrapperWorld.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/DOMWrapperWorld.h
diff --git a/Source/bindings/v8/DOMWrapperWorld.h b/Source/bindings/v8/DOMWrapperWorld.h
index b9e0533c995e14ce35a617bd5743a9e6090dff5e..79ef25eefd8d2de26003f074dcaf7239c14cb75b 100644
--- a/Source/bindings/v8/DOMWrapperWorld.h
+++ b/Source/bindings/v8/DOMWrapperWorld.h
@@ -69,26 +69,25 @@ public:
static bool isolatedWorldsExist() { return isolatedWorldCount; }
static void allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld> >& worlds);
- static DOMWrapperWorld* world(v8::Handle<v8::Context> context)
+ static DOMWrapperWorld& world(v8::Handle<v8::Context> context)
{
ASSERT(!context.IsEmpty());
return V8PerContextData::world(context);
}
- // Will return null if there is no DOMWrapperWorld for the current context.
- static DOMWrapperWorld* current(v8::Isolate* isolate)
+ static DOMWrapperWorld& current(v8::Isolate* isolate)
{
if (isMainThread() && worldOfInitializingWindow) {
// It's possible that current() is being called while window is being initialized.
// In order to make current() workable during the initialization phase,
// we cache the world of the initializing window on worldOfInitializingWindow.
// If there is no initiazing window, worldOfInitializingWindow is 0.
- return worldOfInitializingWindow;
+ return *worldOfInitializingWindow;
}
return world(isolate->GetCurrentContext());
}
- static DOMWrapperWorld* mainWorld();
+ static DOMWrapperWorld& mainWorld();
// Associates an isolated world (see above for description) with a security
// origin. XMLHttpRequest instances used in that world will be considered
« no previous file with comments | « Source/bindings/v8/DOMRequestState.h ('k') | Source/bindings/v8/DOMWrapperWorld.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698