Change public API to use Continue and Cancel methods - callback is then somewhat more consistent with other callback wrappers

This commit is contained in:
amaitland
2015-06-05 12:17:12 +10:00
parent c8d73574da
commit c193020c72
4 changed files with 15 additions and 6 deletions
+7 -2
View File
@@ -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);
}
};
};
+1 -1
View File
@@ -51,7 +51,7 @@ namespace CefSharp.Example
response.ResponseStream = new MemoryStream(bytes);
response.MimeType = GetMimeType(fileName);
response.ProcessRequestCallback(false);
response.Continue();
});
return true;
+6 -2
View File
@@ -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();
}
}
+1 -1
View File
@@ -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),