Commit 5c97e304 authored by haraken@chromium.org's avatar haraken@chromium.org

Ignore V8's message handler that is invoked while we're initializing a window

messageHandlerInMainThread can be invoked while we're initializing a window (See stack traces in the bugs). In that half-baked situation, we don't have a valid context nor a valid world, so we should return immediately.

BUG=345014,352179
NOTRY=true

Review URL: https://codereview.chromium.org/203123006

git-svn-id: svn://svn.chromium.org/blink/trunk@169518 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4c597c73
...@@ -85,6 +85,13 @@ static void reportFatalErrorInMainThread(const char* location, const char* messa ...@@ -85,6 +85,13 @@ static void reportFatalErrorInMainThread(const char* location, const char* messa
static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data) static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data)
{ {
ASSERT(isMainThread());
// It's possible that messageHandlerInMainThread() is invoked while we're initializing a window.
// In that half-baked situation, we don't have a valid context nor a valid world,
// so just return immediately.
if (DOMWrapperWorld::windowIsBeingInitialized())
return;
v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Isolate* isolate = v8::Isolate::GetCurrent();
// If called during context initialization, there will be no entered window. // If called during context initialization, there will be no entered window.
DOMWindow* enteredWindow = enteredDOMWindow(isolate); DOMWindow* enteredWindow = enteredDOMWindow(isolate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment