jscallbackregistry lifecycle is managed by javascriptrootobjectwrapper, async methods too bound by javascriptrootobjectwrapper

This commit is contained in:
cefsharp-ms
2015-07-31 12:22:02 +02:00
parent dbf5e94293
commit c395f03ba2
12 changed files with 132 additions and 268 deletions
@@ -15,7 +15,7 @@ namespace CefSharp
{
namespace Async
{
void JavascriptAsyncObjectWrapper::Bind(const CefRefPtr<CefV8Value> &value)
void JavascriptAsyncObjectWrapper::Bind(const CefRefPtr<CefV8Value> &value, const CefRefPtr<CefV8Value> &promiseCreator)
{
//V8Value that represents this javascript object - only one per complex type, no accessor
auto javascriptObject = CefV8Value::CreateObject(nullptr);
@@ -24,7 +24,7 @@ namespace CefSharp
for each (JavascriptMethod^ method in Enumerable::OfType<JavascriptMethod^>(_object->Methods))
{
auto wrappedMethod = gcnew JavascriptAsyncMethodWrapper(method, _object->Id, CallbackRegistry, PromiseCreator.get(), MethodCallbackSave);
auto wrappedMethod = gcnew JavascriptAsyncMethodWrapper(method, _object->Id, _callbackRegistry, promiseCreator, _methodCallbackSave);
wrappedMethod->Bind(javascriptObject);
_wrappedMethods->Add(wrappedMethod);