// Copyright © 2010-2015 The CefSharp Project. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "include/cef_v8.h" #include "JavascriptCallbackRegistry.h" #include "JavascriptAsyncMethodCallback.h" namespace CefSharp { ref class CefBrowserWrapper; namespace Internals { namespace Async { class JavascriptAsyncMethodHandler : public virtual CefV8Handler { private: gcroot _callbackRegistry; gcroot^> _methodCallbackSave; CefRefPtr _promiseCreator; int64 _objectId; public: JavascriptAsyncMethodHandler(int64 objectId, JavascriptCallbackRegistry^ callbackRegistry, CefRefPtr promiseCreator, Func^ methodCallbackSave) :_callbackRegistry(callbackRegistry), _objectId(objectId), _promiseCreator(promiseCreator), _methodCallbackSave(methodCallbackSave) { } virtual bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception); IMPLEMENT_REFCOUNTING(JavascriptAsyncMethodHandler) }; } } }