mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 20:19:41 +00:00
Core - Cancel pending tasks when browser crashed or v8 context gets released (#5145)
* Core - Cancel pending tasks when browser crashed or v8 context gets released * Use TrySetCanceled to cancel pending tasks * Adjust test to use chrome://crash for simulating a crash * Add tests for javascript callbacks * Rename tests and add tests for calling Execute multiple times * Move FramePendingTaskRepository to its own file * Rename test to ShouldCancelAfterV8ContextChange * Fix compile error on .NET Framework * adjust ShouldTimeoutIfNavigationOccurs test which now throws a TaskCanceledException on navigation
This commit is contained in:
@@ -237,7 +237,7 @@ Task<JavascriptResponse^>^ CefFrameWrapper::EvaluateScriptAsync(String^ script,
|
||||
//If we're unable to get the underlying browser/browserhost then return null
|
||||
if (!browser.get() || !host.get())
|
||||
{
|
||||
return nullptr;
|
||||
return Task::FromException<JavascriptResponse^>(gcnew InvalidOperationException("Browser host not available"));
|
||||
}
|
||||
|
||||
auto client = static_cast<ClientAdapter*>(host->GetClient().get());
|
||||
@@ -245,7 +245,7 @@ Task<JavascriptResponse^>^ CefFrameWrapper::EvaluateScriptAsync(String^ script,
|
||||
auto pendingTaskRepository = client->GetPendingTaskRepository();
|
||||
|
||||
//create a new taskcompletionsource
|
||||
auto idAndComplectionSource = pendingTaskRepository->CreatePendingTask(timeout);
|
||||
auto idAndComplectionSource = pendingTaskRepository->CreatePendingTask(Identifier, timeout);
|
||||
|
||||
if (useImmediatelyInvokedFuncExpression)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user