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

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

Issue 14297007: Make DOMWrapperWorlds easier to use (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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/DOMWrapperWorld.cpp ('k') | Source/bindings/v8/V8MutationCallback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8Binding.cpp
diff --git a/Source/bindings/v8/V8Binding.cpp b/Source/bindings/v8/V8Binding.cpp
index 1615ae84774d9cf6086780eb449a4a2f532418ec..3e61352e17114bff14380cd79b530983bd6f05fa 100644
--- a/Source/bindings/v8/V8Binding.cpp
+++ b/Source/bindings/v8/V8Binding.cpp
@@ -345,15 +345,11 @@ v8::Local<v8::Context> toV8Context(ScriptExecutionContext* context, const WorldC
v8::Local<v8::Context> toV8Context(ScriptExecutionContext* context, DOMWrapperWorld* world)
{
if (context->isDocument()) {
- if (Frame* frame = toDocument(context)->frame()) {
- // FIXME: Store the DOMWrapperWorld for the main world in the v8::Context so callers
- // that are looking up their world with DOMWrapperWorld::isolatedWorld(v8::Context::GetCurrent())
- // won't end up passing null here when later trying to get their v8::Context back.
- if (!world)
- return frame->script()->mainWorldContext();
+ ASSERT(world);
+ if (Frame* frame = toDocument(context)->frame())
return v8::Local<v8::Context>::New(frame->script()->windowShell(world)->context());
- }
} else if (context->isWorkerContext()) {
+ ASSERT(!world);
if (WorkerScriptController* script = static_cast<WorkerContext*>(context)->script())
return script->context();
}
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.cpp ('k') | Source/bindings/v8/V8MutationCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698