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

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

Issue 182903003: Make DOMWrapperWorld::current() callable from workers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
Index: Source/bindings/v8/PageScriptDebugServer.cpp
diff --git a/Source/bindings/v8/PageScriptDebugServer.cpp b/Source/bindings/v8/PageScriptDebugServer.cpp
index 5965d7f0fc6f7561a3b48ee9ec10e0ae21c3119f..2439091abd14d1e76d7b8e8e48908061f5ca337a 100644
--- a/Source/bindings/v8/PageScriptDebugServer.cpp
+++ b/Source/bindings/v8/PageScriptDebugServer.cpp
@@ -33,6 +33,7 @@
#include "V8Window.h"
+#include "bindings/v8/DOMWrapperWorld.h"
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/ScriptSourceCode.h"
#include "bindings/v8/V8Binding.h"
@@ -56,8 +57,13 @@ static LocalFrame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> co
if (context.IsEmpty())
return 0;
- // Test that context has associated global dom window object.
- if (!V8WindowShell::contextHasCorrectPrototype(context))
+ // FIXME: This is a temporary hack for crbug.com/345014.
+ // Currently it's possible that V8 can trigger Debugger::ProcessDebugEvent for a context
+ // that is being initialized (i.e., inside Context::New() of the context).
+ // We should fix the V8 side so that it won't trigger the event for a half-baked context
+ // because there is no way in the embedder side to check if the context is half-baked or not.
+ ASSERT(isMainThread());
+ if (DOMWrapperWorld::windowIsBeingInitialized())
return 0;
v8::Handle<v8::Value> global = V8Window::findInstanceInPrototypeChain(context->Global(), context->GetIsolate());

Powered by Google App Engine
This is Rietveld 408576698