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

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

Issue 2474073005: DevTools: add the logging aspect into the PerformanceMonitor (Closed)
Patch Set: test fixed Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 throwScriptForbiddenException(isolate); 517 throwScriptForbiddenException(isolate);
518 return v8::MaybeLocal<v8::Value>(); 518 return v8::MaybeLocal<v8::Value>();
519 } 519 }
520 v8::MicrotasksScope microtasksScope(isolate, 520 v8::MicrotasksScope microtasksScope(isolate,
521 v8::MicrotasksScope::kRunMicrotasks); 521 v8::MicrotasksScope::kRunMicrotasks);
522 PerformanceMonitor::willExecuteScript(context); 522 PerformanceMonitor::willExecuteScript(context);
523 ThreadDebugger::willExecuteScript(isolate, 523 ThreadDebugger::willExecuteScript(isolate,
524 script->GetUnboundScript()->GetId()); 524 script->GetUnboundScript()->GetId());
525 result = script->Run(isolate->GetCurrentContext()); 525 result = script->Run(isolate->GetCurrentContext());
526 ThreadDebugger::didExecuteScript(isolate); 526 ThreadDebugger::didExecuteScript(isolate);
527 PerformanceMonitor::didExecuteScript(context);
527 } 528 }
528 529
529 crashIfIsolateIsDead(isolate); 530 crashIfIsolateIsDead(isolate);
530 return result; 531 return result;
531 } 532 }
532 533
533 v8::MaybeLocal<v8::Value> V8ScriptRunner::compileAndRunInternalScript( 534 v8::MaybeLocal<v8::Value> V8ScriptRunner::compileAndRunInternalScript(
534 v8::Local<v8::String> source, 535 v8::Local<v8::String> source,
535 v8::Isolate* isolate, 536 v8::Isolate* isolate,
536 const String& fileName, 537 const String& fileName,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 InspectorFunctionCallEvent::data(context, function)); 631 InspectorFunctionCallEvent::data(context, function));
631 632
632 v8::MicrotasksScope microtasksScope(isolate, 633 v8::MicrotasksScope microtasksScope(isolate,
633 v8::MicrotasksScope::kRunMicrotasks); 634 v8::MicrotasksScope::kRunMicrotasks);
634 PerformanceMonitor::willExecuteScript(context); 635 PerformanceMonitor::willExecuteScript(context);
635 ThreadDebugger::willExecuteScript(isolate, function->ScriptId()); 636 ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
636 v8::MaybeLocal<v8::Value> result = 637 v8::MaybeLocal<v8::Value> result =
637 function->Call(isolate->GetCurrentContext(), receiver, argc, args); 638 function->Call(isolate->GetCurrentContext(), receiver, argc, args);
638 crashIfIsolateIsDead(isolate); 639 crashIfIsolateIsDead(isolate);
639 ThreadDebugger::didExecuteScript(isolate); 640 ThreadDebugger::didExecuteScript(isolate);
641 PerformanceMonitor::didExecuteScript(context);
640 if (!depth) 642 if (!depth)
641 TRACE_EVENT_END0("devtools.timeline", "FunctionCall"); 643 TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
642 return result; 644 return result;
643 } 645 }
644 646
645 v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction( 647 v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction(
646 v8::Local<v8::Function> function, 648 v8::Local<v8::Function> function,
647 v8::Local<v8::Value> receiver, 649 v8::Local<v8::Value> receiver,
648 int argc, 650 int argc,
649 v8::Local<v8::Value> args[], 651 v8::Local<v8::Value> args[],
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 v8AtomicString(isolate, "((e) => { throw e; })"), origin) 744 v8AtomicString(isolate, "((e) => { throw e; })"), origin)
743 .ToLocalChecked(); 745 .ToLocalChecked();
744 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script) 746 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script)
745 .ToLocalChecked() 747 .ToLocalChecked()
746 .As<v8::Function>(); 748 .As<v8::Function>();
747 v8::Local<v8::Value> args[] = {exception}; 749 v8::Local<v8::Value> args[] = {exception};
748 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); 750 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate);
749 } 751 }
750 752
751 } // namespace blink 753 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/input-event-warning.html ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698