From 217258c2aeb2f66cf7fb948624ef35aa798f575a Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 12 Aug 2020 14:16:35 +1000 Subject: [PATCH] Net Core - Make VC++ Methods internal to avoid being included in Ref Assembly --- CefSharp.Core/Internals/CefDragDataWrapper.h | 18 +++++------ CefSharp.Core/PopupFeatures.h | 3 +- CefSharp.Core/PostData.h | 18 +++++------ CefSharp.Core/PostDataElement.h | 18 +++++------ CefSharp.Core/Request.h | 34 ++++++++++---------- CefSharp.Core/WindowInfo.h | 10 +++--- 6 files changed, 51 insertions(+), 50 deletions(-) diff --git a/CefSharp.Core/Internals/CefDragDataWrapper.h b/CefSharp.Core/Internals/CefDragDataWrapper.h index f7fce6fa9..79ad0f21f 100644 --- a/CefSharp.Core/Internals/CefDragDataWrapper.h +++ b/CefSharp.Core/Internals/CefDragDataWrapper.h @@ -47,6 +47,15 @@ namespace CefSharp _disposed = true; } + operator CefRefPtr() + { + if (this == nullptr) + { + return NULL; + } + return _wrappedDragData.get(); + } + public: virtual property bool IsReadOnly; virtual property String^ FileName; @@ -210,15 +219,6 @@ namespace CefSharp auto writer = CefStreamWriter::CreateForHandler(writeHandler); return (Int64)_wrappedDragData->GetFileContents(writer); } - - operator CefRefPtr() - { - if (this == nullptr) - { - return NULL; - } - return _wrappedDragData.get(); - } }; } } diff --git a/CefSharp.Core/PopupFeatures.h b/CefSharp.Core/PopupFeatures.h index 4563761c8..1d585057f 100644 --- a/CefSharp.Core/PopupFeatures.h +++ b/CefSharp.Core/PopupFeatures.h @@ -17,7 +17,7 @@ namespace CefSharp private: const CefPopupFeatures* _popupFeatures; - public: + internal: /// /// Constructor. /// @@ -27,6 +27,7 @@ namespace CefSharp _popupFeatures = popupFeatures; } + public: !PopupFeatures() { _popupFeatures = NULL; diff --git a/CefSharp.Core/PostData.h b/CefSharp.Core/PostData.h index 84d9809b7..9ef820e3f 100644 --- a/CefSharp.Core/PostData.h +++ b/CefSharp.Core/PostData.h @@ -74,6 +74,15 @@ namespace CefSharp } } + operator CefRefPtr() + { + if (this == nullptr) + { + return NULL; + } + return _postData.get(); + } + public: /// /// Default constructor. @@ -221,14 +230,5 @@ namespace CefSharp return _postData->HasExcludedElements(); } } - - operator CefRefPtr() - { - if (this == nullptr) - { - return NULL; - } - return _postData.get(); - } }; } diff --git a/CefSharp.Core/PostDataElement.h b/CefSharp.Core/PostDataElement.h index c6acce972..696f27309 100644 --- a/CefSharp.Core/PostDataElement.h +++ b/CefSharp.Core/PostDataElement.h @@ -36,6 +36,15 @@ namespace CefSharp _disposed = true; } + operator CefRefPtr() + { + if (this == nullptr) + { + return NULL; + } + return _postDataElement.get(); + } + public: PostDataElement() { @@ -112,14 +121,5 @@ namespace CefSharp _postDataElement->SetToBytes(val->Length, static_cast(src)); } } - - operator CefRefPtr() - { - if (this == nullptr) - { - return NULL; - } - return _postDataElement.get(); - } }; } diff --git a/CefSharp.Core/Request.h b/CefSharp.Core/Request.h index ab1f7c0ec..40e8d500c 100644 --- a/CefSharp.Core/Request.h +++ b/CefSharp.Core/Request.h @@ -37,6 +37,23 @@ namespace CefSharp _disposed = true; } + operator CefRefPtr() + { + if (this == nullptr) + { + return NULL; + } + return _request.get(); + } + + void ThrowIfReadOnly() + { + if (_request->IsReadOnly()) + { + throw gcnew NotSupportedException("IRequest is read-only and cannot be modified. Check IRequest.IsReadOnly to guard against this exception."); + } + } + public: Request() { @@ -59,22 +76,5 @@ namespace CefSharp virtual String^ GetHeaderByName(String^ name); virtual void SetHeaderByName(String^ name, String^ value, bool overwrite); - - operator CefRefPtr() - { - if (this == nullptr) - { - return NULL; - } - return _request.get(); - } - - void ThrowIfReadOnly() - { - if (_request->IsReadOnly()) - { - throw gcnew NotSupportedException("IRequest is read-only and cannot be modified. Check IRequest.IsReadOnly to guard against this exception."); - } - } }; } diff --git a/CefSharp.Core/WindowInfo.h b/CefSharp.Core/WindowInfo.h index 43be42b9c..f155fb6de 100644 --- a/CefSharp.Core/WindowInfo.h +++ b/CefSharp.Core/WindowInfo.h @@ -22,6 +22,11 @@ namespace CefSharp } + CefWindowInfo* GetWindowInfo() + { + return _windowInfo; + } + public: WindowInfo() : _windowInfo(new CefWindowInfo()) { @@ -203,10 +208,5 @@ namespace CefSharp { _windowInfo->SetAsWindowless((HWND)parentHandle.ToPointer()); } - - CefWindowInfo* GetWindowInfo() - { - return _windowInfo; - } }; }