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:
amaitland
2018-05-15 15:05:29 +10:00
parent 3f9272ac35
commit 930846eb52
6 changed files with 13 additions and 12 deletions
@@ -15,7 +15,7 @@ namespace CefSharp
{
namespace Async
{
void JavascriptAsyncObjectWrapper::Bind(JavascriptObject^ object, const CefRefPtr<CefV8Value> &value, const CefRefPtr<CefV8Value> &promiseCreator)
void JavascriptAsyncObjectWrapper::Bind(JavascriptObject^ object, const CefRefPtr<CefV8Value> &value)
{
//V8Value that represents this javascript object - only one per complex type, no accessor
auto javascriptObject = CefV8Value::CreateObject(nullptr, nullptr);
@@ -24,7 +24,7 @@ namespace CefSharp
for each (JavascriptMethod^ method in Enumerable::OfType<JavascriptMethod^>(object->Methods))
{
auto wrappedMethod = gcnew JavascriptAsyncMethodWrapper(object->Id, _callbackRegistry, promiseCreator, _methodCallbackSave);
auto wrappedMethod = gcnew JavascriptAsyncMethodWrapper(object->Id, _callbackRegistry, _methodCallbackSave);
wrappedMethod->Bind(method, javascriptObject);
_wrappedMethods->Add(wrappedMethod);