Skip to content

Commit 7bba36a

Browse files
chore: add TRACE calls for heavy ctx bridge methods (electron#23501)
1 parent 34da3bc commit 7bba36a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

shell/renderer/api/electron_api_context_bridge.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
149149
context_bridge::ObjectCache* object_cache,
150150
bool support_dynamic_properties,
151151
int recursion_depth) {
152+
TRACE_EVENT0("electron", "ContextBridge::PassValueToOtherContext");
152153
if (recursion_depth >= kMaxRecursion) {
153154
v8::Context::Scope source_scope(source_context);
154155
source_context->GetIsolate()->ThrowException(v8::Exception::TypeError(
@@ -338,6 +339,7 @@ v8::Local<v8::Value> ProxyFunctionWrapper(
338339
size_t func_id,
339340
bool support_dynamic_properties,
340341
gin_helper::Arguments* args) {
342+
TRACE_EVENT0("electron", "ContextBridge::ProxyFunctionWrapper");
341343
// Context the proxy function was called from
342344
v8::Local<v8::Context> calling_context = args->isolate()->GetCurrentContext();
343345
// Context the function was created in
@@ -506,6 +508,7 @@ gin_helper::Dictionary DebugGC(gin_helper::Dictionary empty) {
506508
void ExposeAPIInMainWorld(const std::string& key,
507509
v8::Local<v8::Object> api_object,
508510
gin_helper::Arguments* args) {
511+
TRACE_EVENT1("electron", "ContextBridge::ExposeAPIInMainWorld", "key", key);
509512
auto* render_frame = GetRenderFrame(api_object);
510513
CHECK(render_frame);
511514
context_bridge::RenderFrameFunctionStore* store =

0 commit comments

Comments
 (0)