Make the |target_domain| parameter to CefAddCrossOriginWhitelistEntry and CefRemoveCrossOriginWhitelistEntry optional.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@667 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-06-04 18:44:14 +00:00
parent b8a3120222
commit 8403acb14b
4 changed files with 16 additions and 22 deletions

View File

@ -67,8 +67,11 @@ extern "C" {
// the same-origin policy. Scripts hosted underneath the fully qualified // the same-origin policy. Scripts hosted underneath the fully qualified
// |source_origin| URL (like http://www.example.com) will be allowed access to // |source_origin| URL (like http://www.example.com) will be allowed access to
// all resources hosted on the specified |target_protocol| and |target_domain|. // all resources hosted on the specified |target_protocol| and |target_domain|.
// If |allow_target_subdomains| is true (1) access will also be allowed to all // If |target_domain| is non-NULL and |allow_target_subdomains| if false (0)
// subdomains of the target domain. // only exact domain matches will be allowed. If |target_domain| is non-NULL and
// |allow_target_subdomains| is true (1) sub-domain matches will be allowed. If
// |target_domain| is NULL and |allow_target_subdomains| if true (1) all domains
// and IP addresses will be allowed.
// //
// This function cannot be used to bypass the restrictions on local or display // This function cannot be used to bypass the restrictions on local or display
// isolated schemes. See the comments on CefRegisterCustomScheme for more // isolated schemes. See the comments on CefRegisterCustomScheme for more

View File

@ -63,8 +63,11 @@
// the same-origin policy. Scripts hosted underneath the fully qualified // the same-origin policy. Scripts hosted underneath the fully qualified
// |source_origin| URL (like http://www.example.com) will be allowed access to // |source_origin| URL (like http://www.example.com) will be allowed access to
// all resources hosted on the specified |target_protocol| and |target_domain|. // all resources hosted on the specified |target_protocol| and |target_domain|.
// If |allow_target_subdomains| is true access will also be allowed to all // If |target_domain| is non-empty and |allow_target_subdomains| if false only
// subdomains of the target domain. // exact domain matches will be allowed. If |target_domain| is non-empty and
// |allow_target_subdomains| is true sub-domain matches will be allowed. If
// |target_domain| is empty and |allow_target_subdomains| if true all domains
// and IP addresses will be allowed.
// //
// This method cannot be used to bypass the restrictions on local or display // This method cannot be used to bypass the restrictions on local or display
// isolated schemes. See the comments on CefRegisterCustomScheme for more // isolated schemes. See the comments on CefRegisterCustomScheme for more
@ -73,7 +76,7 @@
// This function may be called on any thread. Returns false if |source_origin| // This function may be called on any thread. Returns false if |source_origin|
// is invalid or the whitelist cannot be accessed. // is invalid or the whitelist cannot be accessed.
/// ///
/*--cef()--*/ /*--cef(optional_param=target_domain)--*/
bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
const CefString& target_protocol, const CefString& target_protocol,
const CefString& target_domain, const CefString& target_domain,
@ -83,7 +86,7 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
// Remove an entry from the cross-origin access whitelist. Returns false if // Remove an entry from the cross-origin access whitelist. Returns false if
// |source_origin| is invalid or the whitelist cannot be accessed. // |source_origin| is invalid or the whitelist cannot be accessed.
/// ///
/*--cef()--*/ /*--cef(optional_param=target_domain)--*/
bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
const CefString& target_protocol, const CefString& target_protocol,
const CefString& target_domain, const CefString& target_domain,

View File

@ -198,10 +198,7 @@ CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
DCHECK(target_protocol); DCHECK(target_protocol);
if (!target_protocol) if (!target_protocol)
return 0; return 0;
// Verify param: target_domain; type: string_byref_const // Unverified params: target_domain
DCHECK(target_domain);
if (!target_domain)
return 0;
// Execute // Execute
bool _retval = CefAddCrossOriginWhitelistEntry( bool _retval = CefAddCrossOriginWhitelistEntry(
@ -227,10 +224,7 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
DCHECK(target_protocol); DCHECK(target_protocol);
if (!target_protocol) if (!target_protocol)
return 0; return 0;
// Verify param: target_domain; type: string_byref_const // Unverified params: target_domain
DCHECK(target_domain);
if (!target_domain)
return 0;
// Execute // Execute
bool _retval = CefRemoveCrossOriginWhitelistEntry( bool _retval = CefRemoveCrossOriginWhitelistEntry(

View File

@ -200,10 +200,7 @@ CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
DCHECK(!target_protocol.empty()); DCHECK(!target_protocol.empty());
if (target_protocol.empty()) if (target_protocol.empty())
return false; return false;
// Verify param: target_domain; type: string_byref_const // Unverified params: target_domain
DCHECK(!target_domain.empty());
if (target_domain.empty())
return false;
// Execute // Execute
int _retval = cef_add_cross_origin_whitelist_entry( int _retval = cef_add_cross_origin_whitelist_entry(
@ -229,10 +226,7 @@ CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry(
DCHECK(!target_protocol.empty()); DCHECK(!target_protocol.empty());
if (target_protocol.empty()) if (target_protocol.empty())
return false; return false;
// Verify param: target_domain; type: string_byref_const // Unverified params: target_domain
DCHECK(!target_domain.empty());
if (target_domain.empty())
return false;
// Execute // Execute
int _retval = cef_remove_cross_origin_whitelist_entry( int _retval = cef_remove_cross_origin_whitelist_entry(