From 389edb6229b034e773e24ef3a535010fa7db91be Mon Sep 17 00:00:00 2001 From: Hugo Mano Date: Wed, 15 Nov 2017 10:35:04 +0100 Subject: [PATCH] Add webFrame.setIsolatedWorldHumanReadableName --- atom/renderer/api/atom_api_web_frame.cc | 11 +++++++++-- atom/renderer/api/atom_api_web_frame.h | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index 331085cf4d..be4b5f215c 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -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 diff --git a/atom/renderer/api/atom_api_web_frame.h b/atom/renderer/api/atom_api_web_frame.h index f28c9de9db..0c3cb414cf 100644 --- a/atom/renderer/api/atom_api_web_frame.h +++ b/atom/renderer/api/atom_api_web_frame.h @@ -81,6 +81,9 @@ class WebFrame : public mate::Wrappable { 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);