mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
JavascriptAsyncMethodHandler - Obtain Promise from context on Execute
Previously the promise reference was passed into the handler, now we obtain the reference on demand
This commit is contained in:
@@ -17,14 +17,13 @@ namespace CefSharp
|
||||
if (objects->Count > 0)
|
||||
{
|
||||
auto saveMethod = gcnew Func<JavascriptAsyncMethodCallback^, int64>(this, &JavascriptRootObjectWrapper::SaveMethodCallback);
|
||||
auto promiseCreator = v8Value->GetValue(CefAppUnmanagedWrapper::kPromiseCreatorFunction);
|
||||
|
||||
for each (JavascriptObject^ obj in Enumerable::OfType<JavascriptObject^>(objects))
|
||||
{
|
||||
if (obj->IsAsync)
|
||||
{
|
||||
auto wrapperObject = gcnew JavascriptAsyncObjectWrapper(_callbackRegistry, saveMethod);
|
||||
wrapperObject->Bind(obj, v8Value, promiseCreator);
|
||||
wrapperObject->Bind(obj, v8Value);
|
||||
|
||||
_wrappedAsyncObjects->Add(wrapperObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user