d362be5cd9
* chore: bump chromium in DEPS to 37cd06a295cf156cb7658ec5382f5623a05841c6 * update patches * fix: replace NO_TRAFFIC_ANNOTATION_YET with MISSING_TRAFFIC_ANNOTATION Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1653256
51 lines
2.6 KiB
Diff
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 c41afd046ee882cdb4c9f706c4d08cd05bd133ec..a52f1a86e6aeecb0d704b01746de550125e4358f 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 e55ac9152cfdd35e0d5e0cc99ec8d8abe5bac5f1..cb1881473d452e3454977d9277551ad693f3a90c 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
|
|
@@ -867,6 +867,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 043afe0005af3e4271f2b0c8e490e4e4141fc1b5..3a937e1a451ddf1e99ef4322ebc21044d48ad537 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
|
|
@@ -148,6 +148,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;
|