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

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

Issue 2713553010: Migrate performance monitor to inspector instrumentation. (Closed)
Patch Set: Introduce progress monitor Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
28 #include "bindings/core/v8/BindingSecurity.h" 28 #include "bindings/core/v8/BindingSecurity.h"
29 #include "bindings/core/v8/ScriptSourceCode.h" 29 #include "bindings/core/v8/ScriptSourceCode.h"
30 #include "bindings/core/v8/ScriptStreamer.h" 30 #include "bindings/core/v8/ScriptStreamer.h"
31 #include "bindings/core/v8/V8Binding.h" 31 #include "bindings/core/v8/V8Binding.h"
32 #include "bindings/core/v8/V8GCController.h" 32 #include "bindings/core/v8/V8GCController.h"
33 #include "bindings/core/v8/V8ThrowException.h" 33 #include "bindings/core/v8/V8ThrowException.h"
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/dom/ExecutionContext.h" 35 #include "core/dom/ExecutionContext.h"
36 #include "core/frame/LocalDOMWindow.h" 36 #include "core/frame/LocalDOMWindow.h"
37 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/frame/PerformanceMonitor.h" 38 #include "core/inspector/InspectorInstrumentation.h"
39 #include "core/inspector/InspectorTraceEvents.h" 39 #include "core/inspector/InspectorTraceEvents.h"
40 #include "core/inspector/ThreadDebugger.h" 40 #include "core/inspector/ThreadDebugger.h"
41 #include "core/loader/resource/ScriptResource.h" 41 #include "core/loader/resource/ScriptResource.h"
42 #include "platform/Histogram.h" 42 #include "platform/Histogram.h"
43 #include "platform/ScriptForbiddenScope.h" 43 #include "platform/ScriptForbiddenScope.h"
44 #include "platform/instrumentation/tracing/TraceEvent.h" 44 #include "platform/instrumentation/tracing/TraceEvent.h"
45 #include "platform/loader/fetch/CachedMetadata.h" 45 #include "platform/loader/fetch/CachedMetadata.h"
46 #include "public/platform/Platform.h" 46 #include "public/platform/Platform.h"
47 #include "wtf/CurrentTime.h" 47 #include "wtf/CurrentTime.h"
48 48
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 533
534 // Run the script and keep track of the current recursion depth. 534 // Run the script and keep track of the current recursion depth.
535 v8::MaybeLocal<v8::Value> result; 535 v8::MaybeLocal<v8::Value> result;
536 { 536 {
537 if (ScriptForbiddenScope::isScriptForbidden()) { 537 if (ScriptForbiddenScope::isScriptForbidden()) {
538 throwScriptForbiddenException(isolate); 538 throwScriptForbiddenException(isolate);
539 return v8::MaybeLocal<v8::Value>(); 539 return v8::MaybeLocal<v8::Value>();
540 } 540 }
541 v8::MicrotasksScope microtasksScope(isolate, 541 v8::MicrotasksScope microtasksScope(isolate,
542 v8::MicrotasksScope::kRunMicrotasks); 542 v8::MicrotasksScope::kRunMicrotasks);
543 PerformanceMonitor::willExecuteScript(context); 543 InspectorInstrumentation::willExecuteScript(context);
544 ThreadDebugger::willExecuteScript(isolate, 544 ThreadDebugger::willExecuteScript(isolate,
545 script->GetUnboundScript()->GetId()); 545 script->GetUnboundScript()->GetId());
546 result = script->Run(isolate->GetCurrentContext()); 546 result = script->Run(isolate->GetCurrentContext());
547 ThreadDebugger::didExecuteScript(isolate); 547 ThreadDebugger::didExecuteScript(isolate);
548 PerformanceMonitor::didExecuteScript(context); 548 InspectorInstrumentation::didExecuteScript(context);
549 } 549 }
550 550
551 CHECK(!isolate->IsDead()); 551 CHECK(!isolate->IsDead());
552 return result; 552 return result;
553 } 553 }
554 554
555 v8::MaybeLocal<v8::Value> V8ScriptRunner::compileAndRunInternalScript( 555 v8::MaybeLocal<v8::Value> V8ScriptRunner::compileAndRunInternalScript(
556 v8::Local<v8::String> source, 556 v8::Local<v8::String> source,
557 v8::Isolate* isolate, 557 v8::Isolate* isolate,
558 const String& fileName, 558 const String& fileName,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", 652 TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data",
653 InspectorFunctionCallEvent::data(context, function)); 653 InspectorFunctionCallEvent::data(context, function));
654 654
655 DCHECK(!frame || 655 DCHECK(!frame ||
656 BindingSecurity::shouldAllowAccessToFrame( 656 BindingSecurity::shouldAllowAccessToFrame(
657 toDOMWindow(function->CreationContext())->toLocalDOMWindow(), 657 toDOMWindow(function->CreationContext())->toLocalDOMWindow(),
658 frame, BindingSecurity::ErrorReportOption::DoNotReport)); 658 frame, BindingSecurity::ErrorReportOption::DoNotReport));
659 CHECK(!ThreadState::current()->isWrapperTracingForbidden()); 659 CHECK(!ThreadState::current()->isWrapperTracingForbidden());
660 v8::MicrotasksScope microtasksScope(isolate, 660 v8::MicrotasksScope microtasksScope(isolate,
661 v8::MicrotasksScope::kRunMicrotasks); 661 v8::MicrotasksScope::kRunMicrotasks);
662 PerformanceMonitor::willCallFunction(context); 662 InspectorInstrumentation::willCallFunction(context);
663 ThreadDebugger::willExecuteScript(isolate, function->ScriptId()); 663 ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
664 v8::MaybeLocal<v8::Value> result = 664 v8::MaybeLocal<v8::Value> result =
665 function->Call(isolate->GetCurrentContext(), receiver, argc, args); 665 function->Call(isolate->GetCurrentContext(), receiver, argc, args);
666 CHECK(!isolate->IsDead()); 666 CHECK(!isolate->IsDead());
667 ThreadDebugger::didExecuteScript(isolate); 667 ThreadDebugger::didExecuteScript(isolate);
668 PerformanceMonitor::didCallFunction(context, function); 668 InspectorInstrumentation::didCallFunction(context, function);
669 if (!depth) 669 if (!depth)
670 TRACE_EVENT_END0("devtools.timeline", "FunctionCall"); 670 TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
671 return result; 671 return result;
672 } 672 }
673 673
674 v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction( 674 v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction(
675 v8::Local<v8::Function> function, 675 v8::Local<v8::Function> function,
676 v8::Local<v8::Value> receiver, 676 v8::Local<v8::Value> receiver,
677 int argc, 677 int argc,
678 v8::Local<v8::Value> args[], 678 v8::Local<v8::Value> args[],
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 v8AtomicString(isolate, "((e) => { throw e; })"), origin) 735 v8AtomicString(isolate, "((e) => { throw e; })"), origin)
736 .ToLocalChecked(); 736 .ToLocalChecked();
737 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script) 737 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script)
738 .ToLocalChecked() 738 .ToLocalChecked()
739 .As<v8::Function>(); 739 .As<v8::Function>();
740 v8::Local<v8::Value> args[] = {exception}; 740 v8::Local<v8::Value> args[] = {exception};
741 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); 741 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate);
742 } 742 }
743 743
744 } // namespace blink 744 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698