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

Unified Diff: third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.h

Issue 1405823002: DevTools: extract Blink-independent part of CPU profiler into V8ProfilerAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check if client is present before calling its methods Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.h
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.h b/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ba14e0b17b5d10f5dbea513268a92de32f43c93
--- /dev/null
+++ b/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.h
@@ -0,0 +1,62 @@
+// Copyright 2015 The Chromium 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 V8ProfilerAgentImpl_h
+#define V8ProfilerAgentImpl_h
+
+#include "core/CoreExport.h"
+#include "core/InspectorFrontend.h"
+#include "core/inspector/v8/V8ProfilerAgent.h"
+#include "wtf/Forward.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class CORE_EXPORT V8ProfilerAgentImpl : public V8ProfilerAgent {
+ WTF_MAKE_NONCOPYABLE(V8ProfilerAgentImpl);
+public:
+ explicit V8ProfilerAgentImpl(v8::Isolate*);
+ ~V8ProfilerAgentImpl() override;
+
+ void setInspectorState(InspectorState* state) override { m_state = state; }
+ void setFrontend(InspectorFrontend::Profiler* frontend) override { m_frontend = frontend; }
+ void clearFrontend() override;
+ void restore() override;
+
+ void enable(ErrorString*) override;
+ void disable(ErrorString*) override;
+ void setSamplingInterval(ErrorString*, int) override;
+ void start(ErrorString*) override;
+ void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>&) override;
+
+ void consoleProfile(const String& title) override;
+ void consoleProfileEnd(const String& title) override;
+
+ void idleStarted();
+ void idleFinished();
+
+private:
+ void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>*);
+ String nextProfileId();
+
+ void startProfiling(const String& title);
+ PassRefPtr<TypeBuilder::Profiler::CPUProfile> stopProfiling(const String& title, bool serialize);
+
+ bool isRecording() const;
+
+ v8::Isolate* m_isolate;
+ InspectorState* m_state;
+ InspectorFrontend::Profiler* m_frontend;
+ bool m_enabled;
+ bool m_recordingCPUProfile;
+ class ProfileDescriptor;
+ Vector<ProfileDescriptor> m_startedProfiles;
+ String m_frontendInitiatedProfileId;
+};
+
+} // namespace blink
+
+
+#endif // !defined(V8ProfilerAgentImpl_h)

Powered by Google App Engine
This is Rietveld 408576698