mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix V8Test.OnUncaughtExceptionDevTools failure (see #3867)
Ignore multiple calls to OnContextCreated when the DevTools window is open. Simplify the related implementation in MessageListenerCallbackImpl (should be a behavioral no-op).
This commit is contained in:
@@ -797,17 +797,26 @@ void MessageListenerCallbackImpl(v8::Handle<v8::Message> message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate();
|
v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate();
|
||||||
CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
|
|
||||||
|
v8::HandleScope handle_scope(isolate);
|
||||||
|
v8::Local<v8::Context> v8Context = isolate->GetCurrentContext();
|
||||||
|
if (v8Context.IsEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefV8ContextImpl> context =
|
||||||
|
new CefV8ContextImpl(isolate, v8Context);
|
||||||
|
|
||||||
v8::Local<v8::StackTrace> v8Stack = message->GetStackTrace();
|
v8::Local<v8::StackTrace> v8Stack = message->GetStackTrace();
|
||||||
CefRefPtr<CefV8StackTrace> stackTrace =
|
CefRefPtr<CefV8StackTrace> stackTrace =
|
||||||
new CefV8StackTraceImpl(isolate, v8Stack);
|
new CefV8StackTraceImpl(isolate, v8Stack);
|
||||||
|
|
||||||
CefRefPtr<CefV8Exception> exception = new CefV8ExceptionImpl(
|
CefRefPtr<CefV8Exception> exception =
|
||||||
static_cast<CefV8ContextImpl*>(context.get())->GetV8Context(), message);
|
new CefV8ExceptionImpl(v8Context, message);
|
||||||
|
|
||||||
CefRefPtr<CefBrowser> browser = context->GetBrowser();
|
CefRefPtr<CefBrowser> browser = context->GetBrowser();
|
||||||
if (browser) {
|
if (browser) {
|
||||||
handler->OnUncaughtException(browser, context->GetFrame(), context,
|
handler->OnUncaughtException(browser, context->GetFrame(), context.get(),
|
||||||
exception, stackTrace);
|
exception, stackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2931,6 +2931,11 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!frame->GetV8Context()->IsSame(context)) {
|
||||||
|
// Only interested in the MainWorld context.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS) {
|
if (test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS) {
|
||||||
if (!browser->IsPopup()) {
|
if (!browser->IsPopup()) {
|
||||||
app_ = app;
|
app_ = app;
|
||||||
|
Reference in New Issue
Block a user