Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class RuntimeAgent final {
* Lifetime of this agent is bound to the lifetime of the Tracing session -
* HostTargetTraceRecording and to the lifetime of the RuntimeTarget.
*/
class RuntimeTracingAgent : tracing::TargetTracingAgent {
class RuntimeTracingAgent : public tracing::TargetTracingAgent {
public:
explicit RuntimeTracingAgent(tracing::TraceRecordingState &state, RuntimeTargetController &targetController);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,6 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis<RuntimeTa
*/
std::shared_ptr<RuntimeTracingAgent> createTracingAgent(tracing::TraceRecordingState &state);

/**
* Start sampling profiler for a particular JavaScript runtime.
*/
void enableSamplingProfiler();
/**
* Stop sampling profiler for a particular JavaScript runtime.
*/
void disableSamplingProfiler();
/**
* Return recorded sampling profile for the previous sampling session.
*/
tracing::RuntimeSamplingProfile collectSamplingProfile();

private:
using Domain = RuntimeTargetController::Domain;

Expand Down Expand Up @@ -275,6 +262,18 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis<RuntimeTa
* session - HostTargetTraceRecording.
*/
std::weak_ptr<RuntimeTracingAgent> tracingAgent_;
/**
* Start sampling profiler for a particular JavaScript runtime.
*/
void enableSamplingProfiler();
/**
* Stop sampling profiler for a particular JavaScript runtime.
*/
void disableSamplingProfiler();
/**
* Return recorded sampling profile for the previous sampling session.
*/
tracing::RuntimeSamplingProfile collectSamplingProfile();

/**
* Adds a function with the given name on the runtime's global object, that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class TargetTracingAgent {
(void)state_;
}

bool isRunningInBackgroundMode()
{
return state_.mode == tracing::Mode::Background;
}

protected:
TraceRecordingState &state_;
};
Expand Down
Loading