Add cancel param to ProcessRequestCallback - previously only able to call the Continue() method on the callback

This commit is contained in:
amaitland
2015-06-05 12:12:33 +10:00
parent 54790a94c4
commit c8d73574da
6 changed files with 16 additions and 8 deletions
+9 -2
View File
@@ -25,7 +25,7 @@ namespace CefSharp
return _handler->ProcessRequestAsync(requestWrapper, schemeResponse);
}
void ResourceHandlerWrapper::ProcessRequestCallback(IResourceHandlerResponse^ response)
void ResourceHandlerWrapper::ProcessRequestCallback(IResourceHandlerResponse^ response, bool cancel)
{
_mime_type = StringUtils::ToNative(response->MimeType);
_stream = response->ResponseStream;
@@ -40,7 +40,14 @@ namespace CefSharp
// If CEF has cancelled the initial request, throw away a response that comes afterwards.
if (_callback != nullptr)
{
_callback->Continue();
if(cancel)
{
_callback->Cancel();
}
else
{
_callback->Continue();
}
}
// Must be done AFTER CEF has been allowed to consume the headers etc. After this call is made, the SchemeHandlerWrapper