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

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

Issue 176963017: Remove WrapperWorldType from V8 binding (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/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/V8Binding.h » ('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 69385c1184dc2c3edb715e71a2c20d0b2fab9f92..b9e0533c995e14ce35a617bd5743a9e6090dff5e 100644
--- a/Source/bindings/v8/DOMWrapperWorld.h
+++ b/Source/bindings/v8/DOMWrapperWorld.h
@@ -71,26 +71,21 @@ public:
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)
{
- v8::Handle<v8::Context> context = isolate->GetCurrentContext();
- if (context.IsEmpty()) {
- // If a worker thread calls current() with an empty context, it means that there is no DOMWrapperWorld.
- if (!isMainThread())
- return 0;
-
- // If the main thread calls current() with an empty context, it's possible that
- // current() is being called while window is being initialized.
+ 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 world(context);
+ return world(isolate->GetCurrentContext());
}
static DOMWrapperWorld* mainWorld();
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698