mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: use node::tracing::Agent() directly (34-x-y) (#45620)
* refactor: use node::tracing::Agent() * chore: e patches all --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index f58b9b0333e01f95ecf1b1d3fd3e273b675705cc..dae7654fc44e25ddc80dab4732b617f0784b47fc 100644
|
||||
index 469e49a552a2229e8686953d5b10b5d1ac974d4e..01367204ab9d872077547c2b2c33c58d9a1653b9 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9187,6 +9187,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9188,6 +9188,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
|
||||
@@ -10,7 +10,7 @@ an about:blank check to this area.
|
||||
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 8938f2b9d680c1850958b4a0a8794c351f318524..3e23e69b59be317a1a316d562a66d6a7378bf3a9 100644
|
||||
index 2d82c283867cf78fc63275bffbd9eff4d8a606e9..7222a4475e77d4f44ee155825d5cb5238d22e107 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -784,8 +784,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch(
|
||||
|
||||
@@ -15,10 +15,10 @@ Note that we also need to manually update embedder's
|
||||
`api::WebContents::IsFullscreenForTabOrPending` value.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index dae7654fc44e25ddc80dab4732b617f0784b47fc..8938f2b9d680c1850958b4a0a8794c351f318524 100644
|
||||
index 01367204ab9d872077547c2b2c33c58d9a1653b9..2d82c283867cf78fc63275bffbd9eff4d8a606e9 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8294,6 +8294,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -8295,6 +8295,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
expose_get_builtin_module_function.patch
|
||||
build_add_gn_build_files.patch
|
||||
fix_add_default_values_for_variables_in_common_gypi.patch
|
||||
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
|
||||
pass_all_globals_through_require.patch
|
||||
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
|
||||
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
|
||||
|
||||
@@ -52,7 +52,7 @@ index 0df90b176e9b5403efdb1393c0f2f37bb53dc6b2..ece665915ad4d6e02762ec3165cf7b98
|
||||
o['variables']['v8_enable_javascript_promise_hooks'] = 1
|
||||
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 7d9d9afd049237646f82c3e22f5e7a8af7314a84..a941d9987abcbb0f9db3072b8c896a5f328dd027 100644
|
||||
index ec5f6d0d25731dfb5ceeae3cd8749630298a8ba0..30accf975d00bfda5ef0afb8d15041c7e1ba8719 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -22,6 +22,12 @@
|
||||
|
||||
@@ -44,7 +44,7 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480
|
||||
let filename = call.getFileName();
|
||||
const line = call.getLineNumber() - 1;
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index b9098d102b40adad7fafcc331ac62870617019b9..cb9269a31e073caf86164aa39c0640370ade60fd 100644
|
||||
index 66d0a75e90dd11d5d96a738c01939dc1f5703dde..c101c0f314575b489e9ee93281a56b87118ab834 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -244,6 +244,9 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@atlassian.com>
|
||||
Date: Fri, 26 Oct 2018 15:35:13 +1100
|
||||
Subject: fix: expose tracing::Agent and use tracing::TracingController instead
|
||||
of v8::TracingController
|
||||
|
||||
This API is used by Electron to create Node's tracing controller.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 46106fa94b3055648e4f01cd28860d427268a253..e0bf37f09dceb93af58990438ab577a9d4b843e8 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -557,6 +557,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
|
||||
return env->platform();
|
||||
}
|
||||
|
||||
+node::tracing::Agent* CreateAgent() {
|
||||
+ return new node::tracing::Agent();
|
||||
+}
|
||||
+
|
||||
MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
node::tracing::TracingController* tracing_controller) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index ec5f6d0d25731dfb5ceeae3cd8749630298a8ba0..7d9d9afd049237646f82c3e22f5e7a8af7314a84 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -133,6 +133,7 @@ struct SnapshotData;
|
||||
|
||||
namespace tracing {
|
||||
|
||||
+class Agent;
|
||||
class TracingController;
|
||||
|
||||
}
|
||||
@@ -832,6 +833,8 @@ NODE_EXTERN void GetNodeReport(Environment* env,
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
|
||||
|
||||
+NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
+
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
@@ -161,10 +161,10 @@ index a30c25a3a61dfe73944731760404c555f2782d72..6137551bb8168d8fa9a3e6bc79c3d1e7
|
||||
inline MultiIsolatePlatform* platform() const;
|
||||
inline const SnapshotData* snapshot_data() const;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index a941d9987abcbb0f9db3072b8c896a5f328dd027..1a95ac78f7ba6c361db43b1f03c684cbc172de0f 100644
|
||||
index 30accf975d00bfda5ef0afb8d15041c7e1ba8719..232ca3a0dbdf88d03bba1da7dbed2ee5070eefa7 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -1555,24 +1555,14 @@ void RegisterSignalHandler(int signal,
|
||||
@@ -1552,24 +1552,14 @@ void RegisterSignalHandler(int signal,
|
||||
bool reset_handler = false);
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ This refactors several allocators to allocate within the V8 memory cage,
|
||||
allowing them to be compatible with the V8_SANDBOXED_POINTERS feature.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index e0bf37f09dceb93af58990438ab577a9d4b843e8..b9098d102b40adad7fafcc331ac62870617019b9 100644
|
||||
index 46106fa94b3055648e4f01cd28860d427268a253..66d0a75e90dd11d5d96a738c01939dc1f5703dde 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -101,6 +101,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
|
||||
|
||||
@@ -94,7 +94,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
|
||||
|
||||
// The V8Platform of gin relies on Chromium's task schedule, which has not
|
||||
// been started at this point, so we have to rely on Node's V8Platform.
|
||||
auto* tracing_agent = node::CreateAgent();
|
||||
auto* tracing_agent = new node::tracing::Agent();
|
||||
auto* tracing_controller = tracing_agent->GetTracingController();
|
||||
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
|
||||
platform_ = node::MultiIsolatePlatform::Create(
|
||||
|
||||
@@ -92,8 +92,10 @@ void ElectronRendererClient::DidCreateScriptContext(
|
||||
}
|
||||
|
||||
// Setup node tracing controller.
|
||||
if (!node::tracing::TraceEventHelper::GetAgent())
|
||||
node::tracing::TraceEventHelper::SetAgent(node::CreateAgent());
|
||||
if (!node::tracing::TraceEventHelper::GetAgent()) {
|
||||
auto* tracing_agent = new node::tracing::Agent();
|
||||
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
|
||||
}
|
||||
|
||||
// Setup node environment for each window.
|
||||
v8::Maybe<bool> initialized = node::InitializeContext(renderer_context);
|
||||
|
||||
@@ -55,8 +55,10 @@ void WebWorkerObserver::WorkerScriptReadyForEvaluation(
|
||||
node_bindings_->PrepareEmbedThread();
|
||||
|
||||
// Setup node tracing controller.
|
||||
if (!node::tracing::TraceEventHelper::GetAgent())
|
||||
node::tracing::TraceEventHelper::SetAgent(node::CreateAgent());
|
||||
if (!node::tracing::TraceEventHelper::GetAgent()) {
|
||||
auto* tracing_agent = new node::tracing::Agent();
|
||||
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
|
||||
}
|
||||
|
||||
// Setup node environment for each window.
|
||||
v8::Maybe<bool> initialized = node::InitializeContext(worker_context);
|
||||
|
||||
Reference in New Issue
Block a user