summaryrefslogtreecommitdiff
path: root/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h')
-rw-r--r--Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h24
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