Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 2064073002: Add origin information to trace events for runCompiledScript and callFunction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index 2eee4629034ffe67c7656d0092d67e5dde55812e..cf961a5f032ef6913fcecf6a26c64afdfe0b983f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -395,7 +395,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate
{
ASSERT(!script.IsEmpty());
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Value(script->GetUnboundScript()->GetScriptName())));
+ bool isCrossOrigin = context->isDocument() && toDocument(context)->frame()->isCrossOrigin();
+ TRACE_EVENT2("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Value(script->GetUnboundScript()->GetScriptName())), "origin", (isCrossOrigin ? "cross-origin" : "same-origin"));
if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
return throwStackOverflowExceptionIfNeeded(isolate);
@@ -486,7 +487,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callAsConstructor(v8::Isolate* isolate
v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> function, ExecutionContext* context, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> args[], v8::Isolate* isolate)
{
ScopedFrameBlamer frameBlamer(context->isDocument() ? toDocument(context)->frame() : nullptr);
- TRACE_EVENT0("v8", "v8.callFunction");
+ bool isCrossOrigin = context->isDocument() && toDocument(context)->frame()->isCrossOrigin();
Sami 2016/06/14 22:36:10 Doesn't frameblamer already give us this? The scop
+ TRACE_EVENT1("v8", "v8.callFunction", "origin", (isCrossOrigin ? "cross-origin" : "same-origin"));
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
int depth = v8::MicrotasksScope::GetCurrentDepth(isolate);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698