Add webFrame.setIsolatedWorldContentSecurityPolicy
This commit is contained in:
parent
936d8c1117
commit
f74f113d23
2 changed files with 13 additions and 1 deletions
|
@ -274,6 +274,13 @@ void WebFrame::ExecuteJavaScriptInIsolatedWorld(int world_id,
|
||||||
scriptExecutionType, callback.release());
|
scriptExecutionType, callback.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebFrame::SetIsolatedWorldContentSecurityPolicy(int world_id,
|
||||||
|
const std::string& security_policy) {
|
||||||
|
web_frame_->SetIsolatedWorldContentSecurityPolicy(
|
||||||
|
world_id,
|
||||||
|
blink::WebString::FromUTF8(security_policy));
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
mate::Handle<WebFrame> WebFrame::Create(v8::Isolate* isolate) {
|
mate::Handle<WebFrame> WebFrame::Create(v8::Isolate* isolate) {
|
||||||
return mate::CreateHandle(isolate, new WebFrame(isolate));
|
return mate::CreateHandle(isolate, new WebFrame(isolate));
|
||||||
|
@ -325,6 +332,8 @@ void WebFrame::BuildPrototype(
|
||||||
.SetMethod("executeJavaScript", &WebFrame::ExecuteJavaScript)
|
.SetMethod("executeJavaScript", &WebFrame::ExecuteJavaScript)
|
||||||
.SetMethod("executeJavaScriptInIsolatedWorld",
|
.SetMethod("executeJavaScriptInIsolatedWorld",
|
||||||
&WebFrame::ExecuteJavaScriptInIsolatedWorld)
|
&WebFrame::ExecuteJavaScriptInIsolatedWorld)
|
||||||
|
.SetMethod("setIsolatedWorldContentSecurityPolicy",
|
||||||
|
&WebFrame::SetIsolatedWorldContentSecurityPolicy)
|
||||||
.SetMethod("getResourceUsage", &WebFrame::GetResourceUsage)
|
.SetMethod("getResourceUsage", &WebFrame::GetResourceUsage)
|
||||||
.SetMethod("clearCache", &WebFrame::ClearCache)
|
.SetMethod("clearCache", &WebFrame::ClearCache)
|
||||||
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
|
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
|
||||||
|
|
|
@ -78,6 +78,9 @@ class WebFrame : public mate::Wrappable<WebFrame> {
|
||||||
const base::string16& code,
|
const base::string16& code,
|
||||||
mate::Arguments* args);
|
mate::Arguments* args);
|
||||||
|
|
||||||
|
void SetIsolatedWorldContentSecurityPolicy(int world_id,
|
||||||
|
const std::string& security_policy);
|
||||||
|
|
||||||
// Resource related methods
|
// Resource related methods
|
||||||
blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
|
blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
|
||||||
void ClearCache(v8::Isolate* isolate);
|
void ClearCache(v8::Isolate* isolate);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue