mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
added callback capability for async bound method with promises
This commit is contained in:
committed by
cefsharp-ms cefsharp-github@morganstanley.com
parent
a8db666642
commit
fc85d90877
@@ -0,0 +1,47 @@
|
||||
// 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"
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
namespace Internals
|
||||
{
|
||||
namespace Async
|
||||
{
|
||||
private ref class JavascriptAsyncMethodCallback
|
||||
{
|
||||
private:
|
||||
MCefRefPtr<CefV8Context> _context;
|
||||
MCefRefPtr<CefV8Value> _resolve;
|
||||
MCefRefPtr<CefV8Value> _reject;
|
||||
|
||||
public:
|
||||
JavascriptAsyncMethodCallback(CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Value> resolve, CefRefPtr<CefV8Value> reject)
|
||||
:_context(context), _resolve(resolve.get()), _reject(reject.get())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
!JavascriptAsyncMethodCallback()
|
||||
{
|
||||
_resolve = nullptr;
|
||||
_reject = nullptr;
|
||||
_context = nullptr;
|
||||
}
|
||||
|
||||
~JavascriptAsyncMethodCallback()
|
||||
{
|
||||
this->!JavascriptAsyncMethodCallback();
|
||||
}
|
||||
|
||||
void Success(CefRefPtr<CefV8Value> result);
|
||||
|
||||
void Fail(CefString exception);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user