diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h')
-rw-r--r-- | Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h b/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h index de4524696..4ad6e3201 100644 --- a/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h +++ b/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h @@ -24,29 +24,37 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JSMainThreadExecStateInstrumentation_h -#define JSMainThreadExecStateInstrumentation_h +#pragma once #include "InspectorInstrumentation.h" #include "JSMainThreadExecState.h" -#include <runtime/Executable.h> +#include <runtime/FunctionExecutable.h> namespace WebCore { -inline InspectorInstrumentationCookie JSMainThreadExecState::instrumentFunctionCall(ScriptExecutionContext* context, JSC::CallType callType, const JSC::CallData& callData) +template<typename Type, Type jsType, class DataType> +inline InspectorInstrumentationCookie JSMainThreadExecState::instrumentFunctionInternal(ScriptExecutionContext* context, Type callType, const DataType& callData) { if (!InspectorInstrumentation::timelineAgentEnabled(context)) return InspectorInstrumentationCookie(); String resourceName; int lineNumber = 1; - if (callType == JSC::CallTypeJS) { + if (callType == jsType) { resourceName = callData.js.functionExecutable->sourceURL(); - lineNumber = callData.js.functionExecutable->lineNo(); + lineNumber = callData.js.functionExecutable->firstLine(); } else resourceName = "undefined"; return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber); } -} // namespace WebCore +inline InspectorInstrumentationCookie JSMainThreadExecState::instrumentFunctionCall(ScriptExecutionContext* context, JSC::CallType type, const JSC::CallData& data) +{ + return instrumentFunctionInternal<JSC::CallType, JSC::CallType::JS, JSC::CallData>(context, type, data); +} -#endif // JSMainThreadExecStateInstrumentation_h +inline InspectorInstrumentationCookie JSMainThreadExecState::instrumentFunctionConstruct(ScriptExecutionContext* context, JSC::ConstructType type, const JSC::ConstructData& data) +{ + return instrumentFunctionInternal<JSC::ConstructType, JSC::ConstructType::JS, JSC::ConstructData>(context, type, data); +} + +} // namespace WebCore |