Add webFrame.setIsolatedWorldHumanReadableName

This commit is contained in:
Hugo Mano 2017-11-15 10:35:04 +01:00 committed by Cheng Zhao
parent f74f113d23
commit 389edb6229
2 changed files with 12 additions and 2 deletions

View file

@ -277,8 +277,13 @@ void WebFrame::ExecuteJavaScriptInIsolatedWorld(int world_id,
void WebFrame::SetIsolatedWorldContentSecurityPolicy(int world_id,
const std::string& security_policy) {
web_frame_->SetIsolatedWorldContentSecurityPolicy(
world_id,
blink::WebString::FromUTF8(security_policy));
world_id, blink::WebString::FromUTF8(security_policy));
}
void WebFrame::SetIsolatedWorldHumanReadableName(int world_id,
const std::string& name) {
web_frame_->SetIsolatedWorldHumanReadableName(
world_id, blink::WebString::FromUTF8(name));
}
// static
@ -334,6 +339,8 @@ void WebFrame::BuildPrototype(
&WebFrame::ExecuteJavaScriptInIsolatedWorld)
.SetMethod("setIsolatedWorldContentSecurityPolicy",
&WebFrame::SetIsolatedWorldContentSecurityPolicy)
.SetMethod("setIsolatedWorldHumanReadableName",
&WebFrame::SetIsolatedWorldHumanReadableName)
.SetMethod("getResourceUsage", &WebFrame::GetResourceUsage)
.SetMethod("clearCache", &WebFrame::ClearCache)
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings

View file

@ -81,6 +81,9 @@ class WebFrame : public mate::Wrappable<WebFrame> {
void SetIsolatedWorldContentSecurityPolicy(int world_id,
const std::string& security_policy);
void SetIsolatedWorldHumanReadableName(int world_id,
const std::string& name);
// Resource related methods
blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
void ClearCache(v8::Isolate* isolate);