| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8Debugger_h | 5 #ifndef V8Debugger_h |
| 6 #define V8Debugger_h | 6 #define V8Debugger_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/inspector_protocol/Frontend.h" | 9 #include "platform/inspector_protocol/Frontend.h" |
| 10 #include "wtf/PassOwnPtr.h" | 10 #include "wtf/PassOwnPtr.h" |
| 11 | 11 |
| 12 #include <v8.h> | 12 #include <v8.h> |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class V8ContextInfo; | 16 class V8ContextInfo; |
| 17 class V8DebuggerClient; | 17 class V8DebuggerClient; |
| 18 class V8InspectorSession; | 18 class V8InspectorSession; |
| 19 class V8InspectorSessionClient; |
| 19 class V8StackTrace; | 20 class V8StackTrace; |
| 20 | 21 |
| 21 namespace protocol { | 22 namespace protocol { |
| 22 class DictionaryValue; | 23 class DictionaryValue; |
| 23 } | 24 } |
| 24 | 25 |
| 25 class PLATFORM_EXPORT V8Debugger { | 26 class PLATFORM_EXPORT V8Debugger { |
| 26 public: | 27 public: |
| 27 template <typename T> | |
| 28 class Agent { | |
| 29 public: | |
| 30 virtual void setInspectorState(protocol::DictionaryValue*) = 0; | |
| 31 virtual void setFrontend(T*) = 0; | |
| 32 virtual void clearFrontend() = 0; | |
| 33 virtual void restore() = 0; | |
| 34 }; | |
| 35 | |
| 36 static PassOwnPtr<V8Debugger> create(v8::Isolate*, V8DebuggerClient*); | 28 static PassOwnPtr<V8Debugger> create(v8::Isolate*, V8DebuggerClient*); |
| 37 virtual ~V8Debugger() { } | 29 virtual ~V8Debugger() { } |
| 38 | 30 |
| 39 // TODO(dgozman): make this non-static? | 31 // TODO(dgozman): make this non-static? |
| 40 static int contextId(v8::Local<v8::Context>); | 32 static int contextId(v8::Local<v8::Context>); |
| 41 | 33 |
| 42 virtual void contextCreated(const V8ContextInfo&) = 0; | 34 virtual void contextCreated(const V8ContextInfo&) = 0; |
| 43 virtual void contextDestroyed(v8::Local<v8::Context>) = 0; | 35 virtual void contextDestroyed(v8::Local<v8::Context>) = 0; |
| 44 // TODO(dgozman): remove this one. | 36 // TODO(dgozman): remove this one. |
| 45 virtual void resetContextGroup(int contextGroupId) = 0; | 37 virtual void resetContextGroup(int contextGroupId) = 0; |
| 46 virtual void willExecuteScript(v8::Local<v8::Context>, int scriptId) = 0; | 38 virtual void willExecuteScript(v8::Local<v8::Context>, int scriptId) = 0; |
| 47 virtual void didExecuteScript(v8::Local<v8::Context>) = 0; | 39 virtual void didExecuteScript(v8::Local<v8::Context>) = 0; |
| 48 virtual void idleStarted() = 0; | 40 virtual void idleStarted() = 0; |
| 49 virtual void idleFinished() = 0; | 41 virtual void idleFinished() = 0; |
| 50 | 42 |
| 51 virtual PassOwnPtr<V8InspectorSession> connect(int contextGroupId) = 0; | 43 virtual PassOwnPtr<V8InspectorSession> connect(int contextGroupId, V8Inspect
orSessionClient*, const String16* state) = 0; |
| 52 virtual bool isPaused() = 0; | 44 virtual bool isPaused() = 0; |
| 53 | 45 |
| 54 static v8::Local<v8::Private> scopeExtensionPrivate(v8::Isolate*); | 46 static v8::Local<v8::Private> scopeExtensionPrivate(v8::Isolate*); |
| 55 static bool isCommandLineAPIMethod(const String16& name); | 47 static bool isCommandLineAPIMethod(const String16& name); |
| 56 static bool isCommandLineAPIGetter(const String16& name); | 48 static bool isCommandLineAPIGetter(const String16& name); |
| 57 | 49 |
| 58 virtual PassOwnPtr<V8StackTrace> createStackTrace(v8::Local<v8::StackTrace>,
size_t maxStackSize) = 0; | 50 virtual PassOwnPtr<V8StackTrace> createStackTrace(v8::Local<v8::StackTrace>,
size_t maxStackSize) = 0; |
| 59 virtual PassOwnPtr<V8StackTrace> captureStackTrace(size_t maxStackSize) = 0; | 51 virtual PassOwnPtr<V8StackTrace> captureStackTrace(size_t maxStackSize) = 0; |
| 60 }; | 52 }; |
| 61 | 53 |
| 62 } // namespace blink | 54 } // namespace blink |
| 63 | 55 |
| 64 | 56 |
| 65 #endif // V8Debugger_h | 57 #endif // V8Debugger_h |
| OLD | NEW |