diff --git a/CefSharp.Core/ResourceHandlerWrapper.cpp b/CefSharp.Core/ResourceHandlerWrapper.cpp index a7b04bb1c..7c80cb13c 100644 --- a/CefSharp.Core/ResourceHandlerWrapper.cpp +++ b/CefSharp.Core/ResourceHandlerWrapper.cpp @@ -21,17 +21,17 @@ namespace CefSharp auto schemeResponse = gcnew ResourceHandlerResponse(this); - // If _requestWrapper came from ISchemeHandlerFactory, + // If _request came from ISchemeHandlerFactory, // the request parameter can be ignored since it is the same request. // If ignoring the request parameter isn't good enough then we // should retain references to _requestWrapper and a CefRequestWrapper^ // of the request parameter until CefRequestWrapper is disposed. - if (static_cast(_requestWrapper) == nullptr) + if (static_cast(_request) == nullptr) { - _requestWrapper = gcnew CefRequestWrapper(request); + _request = gcnew CefRequestWrapper(request); } - return _handler->ProcessRequestAsync(_requestWrapper, schemeResponse); + return _handler->ProcessRequestAsync(_request, schemeResponse); } void ResourceHandlerWrapper::ProcessRequestCallback(IResourceHandlerResponse^ response, bool cancel) diff --git a/CefSharp.Core/ResourceHandlerWrapper.h b/CefSharp.Core/ResourceHandlerWrapper.h index 0e8a175ed..9ca937b1f 100644 --- a/CefSharp.Core/ResourceHandlerWrapper.h +++ b/CefSharp.Core/ResourceHandlerWrapper.h @@ -17,7 +17,7 @@ namespace CefSharp public class ResourceHandlerWrapper : public CefResourceHandler { private: - gcroot _requestWrapper; + gcroot _request; gcroot _handler; gcroot _stream; @@ -33,7 +33,6 @@ namespace CefSharp int64 SizeFromStream(); public: - ResourceHandlerWrapper(IResourceHandler^ handler) : ResourceHandlerWrapper(handler, nullptr) { @@ -43,8 +42,8 @@ namespace CefSharp } } - ResourceHandlerWrapper(IResourceHandler^ handler, CefRequestWrapper^ requestWrapper) - : _handler(handler), _requestWrapper(requestWrapper) + ResourceHandlerWrapper(IResourceHandler^ handler, IRequest^ request) + : _handler(handler), _request(request) { } @@ -53,7 +52,7 @@ namespace CefSharp _handler = nullptr; _stream = nullptr; _callback = NULL; - delete _requestWrapper; + delete _request; } virtual bool ProcessRequest(CefRefPtr request, CefRefPtr callback);