electron/patches/chromium/blink_world_context.patch
Electron Bot 4d23b9e031 chore: bump chromium to 2bbf84f6437b49c70922b65b38bf3 (master) (#19451)
* chore: bump chromium in DEPS to 644eb098aeffb5e799ab3571eac0d35fa24ef641

* chore: update chromium patches

* chore: update v8 patches

* chore: bump chromium in DEPS to 9eecb7a9f652bbf84f6437b49c70922b65b38bf3

* chore: update patches
2019-07-26 12:18:32 -07:00

51 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Anonymous <anonymous@electronjs.org>
Date: Thu, 20 Sep 2018 17:45:11 -0700
Subject: blink_world_context.patch
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index ea92c2747104615ac876b8322bd5e7acf039924d..1a5b6c4945de6e26a163fe653fef65838431d7b0 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -357,6 +357,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
+ virtual v8::Local<v8::Context> WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const = 0;
+
// Executes script in the context of the current page and returns the value
// that the script evaluated to with callback. Script execution can be
// suspend.
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 3215cba24c414f235c3149ffd45e30dfc7979060..752e04d1510d54ae525e4c7d1b5a149cba2b087a 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -868,6 +868,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
+v8::Local<v8::Context> WebLocalFrameImpl::WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const {
+ scoped_refptr<DOMWrapperWorld> world = DOMWrapperWorld::EnsureIsolatedWorld(
+ isolate, world_id);
+ return ToScriptState(GetFrame(), *world)->GetContext();
+}
+
bool WebFrame::ScriptCanAccess(WebFrame* target) {
return BindingSecurity::ShouldAllowAccessToFrame(
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
index c9a5d1d253d7ff16dc88667b07b883842a388c11..ee7079631e3a713f8b001c5d104fc2b1bbe99e8c 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -149,6 +149,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;
+ v8::Local<v8::Context> WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const override;
v8::Local<v8::Object> GlobalProxy() const override;
void StartReload(WebFrameLoadType) override;
void ReloadImage(const WebNode&) override;