Sha256: 506f7c3f1731edf7df1662e7f6e8232ffbc7f1cdfdf835a1cfc80f6c84e98fc6

Contents?: true

Size: 1.92 KB

Versions: 4

Compression:

Stored size: 1.92 KB

Contents

// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_INSPECTOR_V8PROFILERAGENTIMPL_H_
#define V8_INSPECTOR_V8PROFILERAGENTIMPL_H_

#include <vector>

#include "src/base/macros.h"
#include "src/inspector/protocol/Forward.h"
#include "src/inspector/protocol/Profiler.h"

namespace v8 {
class CpuProfiler;
class Isolate;
}

namespace v8_inspector {

class V8InspectorSessionImpl;

using protocol::ErrorString;

class V8ProfilerAgentImpl : public protocol::Profiler::Backend {
 public:
  V8ProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
                      protocol::DictionaryValue* state);
  ~V8ProfilerAgentImpl() override;

  bool enabled() const { return m_enabled; }
  void restore();

  void enable(ErrorString*) override;
  void disable(ErrorString*) override;
  void setSamplingInterval(ErrorString*, int) override;
  void start(ErrorString*) override;
  void stop(ErrorString*,
            std::unique_ptr<protocol::Profiler::Profile>*) override;

  void consoleProfile(const String16& title);
  void consoleProfileEnd(const String16& title);

  bool idleStarted();
  bool idleFinished();

  void collectSample();

 private:
  String16 nextProfileId();

  void startProfiling(const String16& title);
  std::unique_ptr<protocol::Profiler::Profile> stopProfiling(
      const String16& title, bool serialize);

  bool isRecording() const;

  V8InspectorSessionImpl* m_session;
  v8::Isolate* m_isolate;
  v8::CpuProfiler* m_profiler;
  protocol::DictionaryValue* m_state;
  protocol::Profiler::Frontend m_frontend;
  bool m_enabled;
  bool m_recordingCPUProfile;
  class ProfileDescriptor;
  std::vector<ProfileDescriptor> m_startedProfiles;
  String16 m_frontendInitiatedProfileId;

  DISALLOW_COPY_AND_ASSIGN(V8ProfilerAgentImpl);
};

}  // namespace v8_inspector

#endif  // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/v8_inspector/src/inspector/v8-profiler-agent-impl.h
node-compiler-0.9.0 vendor/node-v7.2.1/deps/v8_inspector/src/inspector/v8-profiler-agent-impl.h
node-compiler-0.8.0 vendor/node-v7.2.0/deps/v8_inspector/src/inspector/v8-profiler-agent-impl.h
node-compiler-0.7.0 vendor/node-v7.1.0/deps/v8_inspector/src/inspector/v8-profiler-agent-impl.h