mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-03 23:12:42 +00:00
431cb511c3
* Remove DisposableResources from ManagedCefBrowserAdapter * Improve disposing of CefRequestWrapper * Have callbacks dispose themselves. * Allow the Application exit handler shutdown CEF from the Winforms example application.
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
// 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 "Stdafx.h"
|
|
#include "include/cef_v8.h"
|
|
|
|
using namespace CefSharp::Internals;
|
|
|
|
namespace CefSharp
|
|
{
|
|
public ref class JavascriptPropertyWrapper
|
|
{
|
|
private:
|
|
JavascriptProperty^ _javascriptProperty;
|
|
int64 _ownerId;
|
|
IBrowserProcess^ _browserProcess;
|
|
//TODO: Strongly type this variable - currently trying to include JavascriptObjectWrapper.h creates a circular reference, so won't compile
|
|
Object^ _javascriptObjectWrapper;
|
|
internal:
|
|
MCefRefPtr<CefV8Value> V8Value;
|
|
|
|
public:
|
|
JavascriptPropertyWrapper(JavascriptProperty^ javascriptProperty, int64 ownerId, IBrowserProcess^ browserProcess)
|
|
{
|
|
_javascriptProperty = javascriptProperty;
|
|
_ownerId = ownerId;
|
|
_browserProcess = browserProcess;
|
|
}
|
|
|
|
!JavascriptPropertyWrapper()
|
|
{
|
|
V8Value = nullptr;
|
|
}
|
|
|
|
~JavascriptPropertyWrapper()
|
|
{
|
|
this->!JavascriptPropertyWrapper();
|
|
if (_javascriptObjectWrapper != nullptr)
|
|
{
|
|
delete _javascriptObjectWrapper;
|
|
_javascriptObjectWrapper = nullptr;
|
|
}
|
|
_javascriptProperty = nullptr;
|
|
}
|
|
|
|
void Bind();
|
|
};
|
|
} |