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, |
| 37 bool recurring) = 0; |
| 38 virtual void asyncTaskCanceled(void* task) = 0; |
| 39 virtual void asyncTaskStarted(void* task) = 0; |
| 40 virtual void asyncTaskFinished(void* task) = 0; |
| 41 virtual void allAsyncTasksCanceled() = 0; |
| 42 |
| 43 // Exceptions instrumentation. |
| 44 virtual unsigned exceptionThrown( |
| 45 v8::Local<v8::Context>, const StringView& message, |
| 46 v8::Local<v8::Value> exception, const StringView& detailedMessage, |
| 47 const StringView& url, unsigned lineNumber, unsigned columnNumber, |
| 48 std::unique_ptr<V8StackTrace>, int scriptId) = 0; |
| 49 virtual void exceptionRevoked(v8::Local<v8::Context>, unsigned exceptionId, |
| 50 const StringView& message) = 0; |
| 51 |
| 52 // Connection. |
| 53 class PLATFORM_EXPORT Channel { |
| 54 public: |
| 55 virtual ~Channel() {} |
| 56 virtual void sendProtocolResponse(int callId, |
| 57 const StringView& message) = 0; |
| 58 virtual void sendProtocolNotification(const StringView& message) = 0; |
| 59 virtual void flushProtocolNotifications() = 0; |
| 60 }; |
| 61 virtual std::unique_ptr<V8InspectorSession> connect( |
| 62 int contextGroupId, Channel*, const StringView& state) = 0; |
| 63 |
| 64 // API methods. |
| 65 virtual std::unique_ptr<V8StackTrace> createStackTrace( |
| 66 v8::Local<v8::StackTrace>) = 0; |
| 67 virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0; |
| 68 }; |
| 69 |
| 70 } // namespace v8_inspector |
| 71 |
| 72 #endif // V8_INSPECTOR_PUBLIC_V8INSPECTOR_H_ |
OLD | NEW |