Skip to content

Commit 389edb6

Browse files
Hugo Manozcbenz
authored andcommitted
Add webFrame.setIsolatedWorldHumanReadableName
1 parent f74f113 commit 389edb6

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

atom/renderer/api/atom_api_web_frame.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,13 @@ void WebFrame::ExecuteJavaScriptInIsolatedWorld(int world_id,
277277
void WebFrame::SetIsolatedWorldContentSecurityPolicy(int world_id,
278278
const std::string& security_policy) {
279279
web_frame_->SetIsolatedWorldContentSecurityPolicy(
280-
world_id,
281-
blink::WebString::FromUTF8(security_policy));
280+
world_id, blink::WebString::FromUTF8(security_policy));
281+
}
282+
283+
void WebFrame::SetIsolatedWorldHumanReadableName(int world_id,
284+
const std::string& name) {
285+
web_frame_->SetIsolatedWorldHumanReadableName(
286+
world_id, blink::WebString::FromUTF8(name));
282287
}
283288

284289
// static
@@ -334,6 +339,8 @@ void WebFrame::BuildPrototype(
334339
&WebFrame::ExecuteJavaScriptInIsolatedWorld)
335340
.SetMethod("setIsolatedWorldContentSecurityPolicy",
336341
&WebFrame::SetIsolatedWorldContentSecurityPolicy)
342+
.SetMethod("setIsolatedWorldHumanReadableName",
343+
&WebFrame::SetIsolatedWorldHumanReadableName)
337344
.SetMethod("getResourceUsage", &WebFrame::GetResourceUsage)
338345
.SetMethod("clearCache", &WebFrame::ClearCache)
339346
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings

atom/renderer/api/atom_api_web_frame.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class WebFrame : public mate::Wrappable<WebFrame> {
8181
void SetIsolatedWorldContentSecurityPolicy(int world_id,
8282
const std::string& security_policy);
8383

84+
void SetIsolatedWorldHumanReadableName(int world_id,
85+
const std::string& name);
86+
8487
// Resource related methods
8588
blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
8689
void ClearCache(v8::Isolate* isolate);

0 commit comments

Comments
 (0)