Allow CefV8Context::Eval to bypass CSP (issue #2024)

This commit is contained in:
Marshall Greenblatt
2016-10-27 12:34:19 -04:00
parent f7a4102978
commit 0e97c527ae
14 changed files with 274 additions and 52 deletions

View File

@ -172,7 +172,8 @@ bool CefV8ContextCToCpp::IsSame(CefRefPtr<CefV8Context> that) {
}
bool CefV8ContextCToCpp::Eval(const CefString& code,
CefRefPtr<CefV8Value>& retval, CefRefPtr<CefV8Exception>& exception) {
const CefString& script_url, int start_line, CefRefPtr<CefV8Value>& retval,
CefRefPtr<CefV8Exception>& exception) {
cef_v8context_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, eval))
return false;
@ -183,6 +184,7 @@ bool CefV8ContextCToCpp::Eval(const CefString& code,
DCHECK(!code.empty());
if (code.empty())
return false;
// Unverified params: script_url
// Translate param: retval; type: refptr_same_byref
cef_v8value_t* retvalStruct = NULL;
@ -198,6 +200,8 @@ bool CefV8ContextCToCpp::Eval(const CefString& code,
// Execute
int _retval = _struct->eval(_struct,
code.GetStruct(),
script_url.GetStruct(),
start_line,
&retvalStruct,
&exceptionStruct);