2018-09-10 02:41:13 +02:00
|
|
|
// Copyright © 2015 The CefSharp Authors. All rights reserved.
|
2015-03-08 13:11:09 +01:00
|
|
|
//
|
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-07-09 10:55:12 +10:00
|
|
|
#include "include\cef_v8.h"
|
2015-03-08 13:11:09 +01:00
|
|
|
|
|
|
|
|
namespace CefSharp
|
|
|
|
|
{
|
2021-02-27 12:11:35 +10:00
|
|
|
namespace BrowserSubprocess
|
2015-03-08 13:11:09 +01:00
|
|
|
{
|
2015-03-09 20:23:13 +01:00
|
|
|
private ref class JavascriptCallbackWrapper
|
2015-03-08 13:11:09 +01:00
|
|
|
{
|
|
|
|
|
private:
|
2015-07-09 10:46:37 +10:00
|
|
|
MCefRefPtr<CefV8Value> _value;
|
|
|
|
|
MCefRefPtr<CefV8Context> _context;
|
2015-07-07 08:12:04 +02:00
|
|
|
|
|
|
|
|
internal:
|
2015-09-24 19:00:26 +10:00
|
|
|
CefRefPtr<CefV8Value> GetValue()
|
|
|
|
|
{
|
|
|
|
|
return _value.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CefRefPtr<CefV8Context> GetContext()
|
|
|
|
|
{
|
|
|
|
|
return _context.get();
|
|
|
|
|
}
|
2015-07-07 08:12:04 +02:00
|
|
|
|
2015-03-08 13:11:09 +01:00
|
|
|
public:
|
|
|
|
|
JavascriptCallbackWrapper(CefRefPtr<CefV8Value> value, CefRefPtr<CefV8Context> context)
|
2018-09-10 02:41:13 +02:00
|
|
|
: _value(value), _context(context)
|
2015-06-13 10:32:15 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-09 10:55:12 +10:00
|
|
|
!JavascriptCallbackWrapper()
|
|
|
|
|
{
|
|
|
|
|
_value = nullptr;
|
|
|
|
|
_context = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~JavascriptCallbackWrapper()
|
|
|
|
|
{
|
|
|
|
|
this->!JavascriptCallbackWrapper();
|
|
|
|
|
}
|
2015-03-08 13:11:09 +01:00
|
|
|
};
|
|
|
|
|
}
|
2021-02-27 12:11:35 +10:00
|
|
|
}
|