Add Identifer and IsReadOnly to IRequest

Resolves #1605
This commit is contained in:
amaitland
2016-03-07 08:39:45 +10:00
parent 651a288a8f
commit ebccd68004
3 changed files with 40 additions and 0 deletions
@@ -51,6 +51,13 @@ namespace CefSharp
_wrappedRequest->SetMethod(StringUtils::ToNative(method));
}
UInt64 CefRequestWrapper::Identifier::get()
{
ThrowIfDisposed();
return _wrappedRequest->GetIdentifier();
}
void CefRequestWrapper::SetReferrer(String^ referrerUrl, CefSharp::ReferrerPolicy policy)
{
ThrowIfDisposed();
@@ -139,6 +146,13 @@ namespace CefSharp
return _postData;
}
bool CefRequestWrapper::IsReadOnly::get()
{
ThrowIfDisposed();
return _wrappedRequest->IsReadOnly();
}
void CefRequestWrapper::InitializePostData()
{
ThrowIfDisposed();
@@ -42,6 +42,7 @@ namespace CefSharp
public:
virtual property String^ Url { String^ get(); void set(String^ url); }
virtual property String^ Method { String^ get(); void set(String^ method); }
virtual property UInt64 Identifier { UInt64 get(); }
virtual void SetReferrer(String^ referrerUrl, CefSharp::ReferrerPolicy policy);
virtual property String^ ReferrerUrl { String^ get(); }
virtual property ResourceType ResourceType { CefSharp::ResourceType get(); }
@@ -49,6 +50,7 @@ namespace CefSharp
virtual property NameValueCollection^ Headers { NameValueCollection^ get(); void set(NameValueCollection^ url); }
virtual property TransitionType TransitionType { CefSharp::TransitionType get(); }
virtual property IPostData^ PostData { IPostData^ get(); }
virtual property bool IsReadOnly { bool get(); }
virtual void InitializePostData();
operator CefRefPtr<CefRequest>()
+24
View File
@@ -9,11 +9,30 @@ namespace CefSharp
{
public interface IRequest : IDisposable
{
/// <summary>
/// Get/Set the Url to the first party for cookies used in combination with CefURLRequest.
/// </summary>
/// Note: If we every implment CefURLRequest then this will need to be added
//string FirstPartyForCookies { get; set; }
/// <summary>
/// Get the flags used in combination with CefURLRequest. See cef_urlrequest_flags_t for supported values.
/// </summary>
/// Note: If we every implment CefURLRequest then this will need to be added
//int Flags { get; set; }
/// <summary>
/// Request Url
/// </summary>
string Url { get; set; }
/// <summary>
/// Returns the globally unique identifier for this request or 0 if not specified.
/// Can be used by <see cref="IRequestHandler"/> implementations in the browser process to track a
/// single request across multiple callbacks.
/// </summary>
ulong Identifier { get; }
/// <summary>
/// Request Method GET/POST etc
/// </summary>
@@ -66,6 +85,11 @@ namespace CefSharp
/// </summary>
bool IsDisposed { get; }
/// <summary>
/// Returns true if this object is read-only.
/// </summary>
bool IsReadOnly { get; }
/// <summary>
/// Initialize a new instance of <see cref="IPostData"/>.
/// Make sure to check if the <see cref="PostData"/> is null