OLD | NEW |
| (Empty) |
1 // Copyright 2015 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef V8_INSPECTOR_PUBLIC_V8INSPECTOR_H_ | |
6 #define V8_INSPECTOR_PUBLIC_V8INSPECTOR_H_ | |
7 | |
8 #include "src/inspector/public/StringView.h" | |
9 #include "src/inspector/public/V8ContextInfo.h" | |
10 | |
11 #include <v8.h> | |
12 | |
13 namespace v8_inspector { | |
14 | |
15 class V8InspectorClient; | |
16 class V8InspectorSession; | |
17 class V8StackTrace; | |
18 | |
19 class PLATFORM_EXPORT V8Inspector { | |
20 public: | |
21 static std::unique_ptr<V8Inspector> create(v8::Isolate*, V8InspectorClient*)
; | |
22 virtual ~V8Inspector() { } | |
23 | |
24 // Contexts instrumentation. | |
25 virtual void contextCreated(const V8ContextInfo&) = 0; | |
26 virtual void contextDestroyed(v8::Local<v8::Context>) = 0; | |
27 virtual void resetContextGroup(int contextGroupId) = 0; | |
28 | |
29 // Various instrumentation. | |
30 virtual void willExecuteScript(v8::Local<v8::Context>, int scriptId) = 0; | |
31 virtual void didExecuteScript(v8::Local<v8::Context>) = 0; | |
32 virtual void idleStarted() = 0; | |
33 virtual void idleFinished() = 0; | |
34 | |
35 // Async stack traces instrumentation. | |
36 virtual void asyncTaskScheduled(const StringView& taskName, void* task, bool
recurring) = 0; | |
37 virtual void asyncTaskCanceled(void* task) = 0; | |
38 virtual void asyncTaskStarted(void* task) = 0; | |
39 virtual void asyncTaskFinished(void* task) = 0; | |
40 virtual void allAsyncTasksCanceled() = 0; | |
41 | |
42 // Exceptions instrumentation. | |
43 virtual unsigned exceptionThrown(v8::Local<v8::Context>, const StringView& m
essage, v8::Local<v8::Value> exception, const StringView& detailedMessage, const
StringView& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8
StackTrace>, int scriptId) = 0; | |
44 virtual void exceptionRevoked(v8::Local<v8::Context>, unsigned exceptionId,
const StringView& message) = 0; | |
45 | |
46 // Connection. | |
47 class PLATFORM_EXPORT Channel { | |
48 public: | |
49 virtual ~Channel() { } | |
50 virtual void sendProtocolResponse(int callId, const StringView& message)
= 0; | |
51 virtual void sendProtocolNotification(const StringView& message) = 0; | |
52 virtual void flushProtocolNotifications() = 0; | |
53 }; | |
54 virtual std::unique_ptr<V8InspectorSession> connect(int contextGroupId, Chan
nel*, const StringView& state) = 0; | |
55 | |
56 // API methods. | |
57 virtual std::unique_ptr<V8StackTrace> createStackTrace(v8::Local<v8::StackTr
ace>) = 0; | |
58 virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0; | |
59 }; | |
60 | |
61 } // namespace v8_inspector | |
62 | |
63 | |
64 #endif // V8_INSPECTOR_PUBLIC_V8INSPECTOR_H_ | |
OLD | NEW |