mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- 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:
@@ -44,6 +44,20 @@ bool CefPostDataCToCpp::IsReadOnly() {
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefPostDataCToCpp::HasExcludedElements() {
|
||||
cef_post_data_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, has_excluded_elements))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->has_excluded_elements(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
size_t CefPostDataCToCpp::GetElementCount() {
|
||||
cef_post_data_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_element_count))
|
||||
|
@@ -31,6 +31,7 @@ class CefPostDataCToCpp
|
||||
|
||||
// CefPostData methods.
|
||||
bool IsReadOnly() OVERRIDE;
|
||||
bool HasExcludedElements() OVERRIDE;
|
||||
size_t GetElementCount() OVERRIDE;
|
||||
void GetElements(ElementVector& elements) OVERRIDE;
|
||||
bool RemoveElement(CefRefPtr<CefPostDataElement> element) OVERRIDE;
|
||||
|
@@ -110,6 +110,55 @@ void CefRequestCToCpp::SetMethod(const CefString& method) {
|
||||
method.GetStruct());
|
||||
}
|
||||
|
||||
void CefRequestCToCpp::SetReferrer(const CefString& referrer_url,
|
||||
ReferrerPolicy policy) {
|
||||
cef_request_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, set_referrer))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: referrer_url; type: string_byref_const
|
||||
DCHECK(!referrer_url.empty());
|
||||
if (referrer_url.empty())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->set_referrer(_struct,
|
||||
referrer_url.GetStruct(),
|
||||
policy);
|
||||
}
|
||||
|
||||
CefString CefRequestCToCpp::GetReferrerURL() {
|
||||
cef_request_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_referrer_url))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_referrer_url(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefRequest::ReferrerPolicy CefRequestCToCpp::GetReferrerPolicy() {
|
||||
cef_request_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_referrer_policy))
|
||||
return REFERRER_POLICY_DEFAULT;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_referrer_policy_t _retval = _struct->get_referrer_policy(_struct);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefRefPtr<CefPostData> CefRequestCToCpp::GetPostData() {
|
||||
cef_request_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_post_data))
|
||||
|
@@ -35,6 +35,10 @@ class CefRequestCToCpp
|
||||
void SetURL(const CefString& url) OVERRIDE;
|
||||
CefString GetMethod() OVERRIDE;
|
||||
void SetMethod(const CefString& method) OVERRIDE;
|
||||
void SetReferrer(const CefString& referrer_url,
|
||||
ReferrerPolicy policy) OVERRIDE;
|
||||
CefString GetReferrerURL() OVERRIDE;
|
||||
ReferrerPolicy GetReferrerPolicy() OVERRIDE;
|
||||
CefRefPtr<CefPostData> GetPostData() OVERRIDE;
|
||||
void SetPostData(CefRefPtr<CefPostData> postData) OVERRIDE;
|
||||
void GetHeaderMap(HeaderMap& headerMap) OVERRIDE;
|
||||
|
Reference in New Issue
Block a user