- Add CefPostData::HasExcludedElements which returns true if the underlying

POST data includes elements that are not represented (issue #1761).
- Add CefRequest::SetReferrer and CefRequest::GetReferrer[URL|Policy]. The
  Referer value will no longer be stored in the header map.
- Move request-related conversion logic to CefRequestImpl and standardize the
  implementation.
This commit is contained in:
Marshall Greenblatt
2015-12-01 13:22:28 -05:00
parent 2a658c414b
commit 9bc8da1e02
18 changed files with 793 additions and 348 deletions

View File

@ -53,6 +53,7 @@ class CefPostDataElement;
class CefRequest : public virtual CefBase {
public:
typedef std::multimap<CefString, CefString> HeaderMap;
typedef cef_referrer_policy_t ReferrerPolicy;
typedef cef_resource_type_t ResourceType;
typedef cef_transition_type_t TransitionType;
@ -93,6 +94,27 @@ class CefRequest : public virtual CefBase {
/*--cef()--*/
virtual void SetMethod(const CefString& method) =0;
///
// Set the referrer URL and policy. If non-empty the referrer URL must be
// fully qualified with an HTTP or HTTPS scheme component. Any username,
// password or ref component will be removed.
///
/*--cef()--*/
virtual void SetReferrer(const CefString& referrer_url,
ReferrerPolicy policy) =0;
///
// Get the referrer URL.
///
/*--cef()--*/
virtual CefString GetReferrerURL() =0;
///
// Get the referrer policy.
///
/*--cef(default_retval=REFERRER_POLICY_DEFAULT)--*/
virtual ReferrerPolicy GetReferrerPolicy() =0;
///
// Get the post data.
///
@ -106,13 +128,14 @@ class CefRequest : public virtual CefBase {
virtual void SetPostData(CefRefPtr<CefPostData> postData) =0;
///
// Get the header values.
// Get the header values. Will not include the Referer value if any.
///
/*--cef()--*/
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
///
// Set the header values.
// Set the header values. If a Referer value exists in the header map it will
// be removed and ignored.
///
/*--cef()--*/
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
@ -200,6 +223,15 @@ class CefPostData : public virtual CefBase {
/*--cef()--*/
virtual bool IsReadOnly() =0;
///
// Returns true if the underlying POST data includes elements that are not
// represented by this CefPostData object (for example, multi-part file upload
// data). Modifying CefPostData objects with excluded elements may result in
// the request failing.
///
/*--cef()--*/
virtual bool HasExcludedElements() = 0;
///
// Returns the number of existing post data elements.
///