mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
Change public API to use Continue and Cancel methods - callback is then somewhat more consistent with other callback wrappers
This commit is contained in:
@@ -71,9 +71,14 @@ namespace CefSharp
|
||||
_resourceHandlerWrapper = nullptr;
|
||||
}
|
||||
|
||||
virtual void ProcessRequestCallback(bool cancel)
|
||||
virtual void Continue()
|
||||
{
|
||||
_resourceHandlerWrapper->ProcessRequestCallback(this, cancel);
|
||||
_resourceHandlerWrapper->ProcessRequestCallback(this, false);
|
||||
}
|
||||
|
||||
virtual void Cancel()
|
||||
{
|
||||
_resourceHandlerWrapper->ProcessRequestCallback(this, true);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CefSharp.Example
|
||||
response.ResponseStream = new MemoryStream(bytes);
|
||||
response.MimeType = GetMimeType(fileName);
|
||||
|
||||
response.ProcessRequestCallback(false);
|
||||
response.Continue();
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
@@ -53,7 +53,11 @@ namespace CefSharp
|
||||
/// <summary>
|
||||
/// Execute this method when processing is complete. Can be called on any thread.
|
||||
/// </summary>
|
||||
/// <param name="cancel">True to cancel the request or False to continue.</param>
|
||||
void ProcessRequestCallback(bool cancel);
|
||||
void Continue();
|
||||
|
||||
/// <summary>
|
||||
/// Execute this method to cancel processing. Can be called on any thread.
|
||||
/// </summary>
|
||||
void Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,7 +780,7 @@ namespace CefSharp
|
||||
response.ContentLength = memoryStream.Length;
|
||||
}
|
||||
|
||||
response.ProcessRequestCallback(false);
|
||||
response.Continue();
|
||||
});
|
||||
|
||||
// If we have a MemoryStream (which is likely to be very common),
|
||||
|
||||
Reference in New Issue
Block a user