| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 V8InspectorSession_h | 5 #ifndef V8InspectorSession_h |
| 6 #define V8InspectorSession_h | 6 #define V8InspectorSession_h |
| 7 | 7 |
| 8 #include "platform/inspector_protocol/Platform.h" | 8 #include "platform/inspector_protocol/Platform.h" |
| 9 #include "platform/v8_inspector/protocol/Runtime.h" | 9 #include "platform/v8_inspector/protocol/Runtime.h" |
| 10 | 10 |
| 11 #include <v8.h> | 11 #include <v8.h> |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class V8DebuggerAgent; | |
| 16 class V8HeapProfilerAgent; | |
| 17 class V8InspectorSessionClient; | |
| 18 class V8ProfilerAgent; | |
| 19 class V8RuntimeAgent; | |
| 20 | |
| 21 class PLATFORM_EXPORT V8InspectorSession { | 15 class PLATFORM_EXPORT V8InspectorSession { |
| 22 public: | 16 public: |
| 23 static const char backtraceObjectGroup[]; | 17 virtual ~V8InspectorSession() { } |
| 24 | 18 |
| 25 // Cross-context inspectable values (DOM nodes in different worlds, etc.). | 19 // Cross-context inspectable values (DOM nodes in different worlds, etc.). |
| 26 class Inspectable { | 20 class Inspectable { |
| 27 public: | 21 public: |
| 28 virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0; | 22 virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0; |
| 29 virtual ~Inspectable() { } | 23 virtual ~Inspectable() { } |
| 30 }; | 24 }; |
| 25 virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0; |
| 31 | 26 |
| 32 virtual ~V8InspectorSession() { } | 27 // Dispatching protocol messages. |
| 33 | 28 // TODO(dgozman): generate this one. |
| 34 static bool isV8ProtocolMethod(const String16& method); | 29 static bool isV8ProtocolMethod(const String16& method); |
| 35 virtual void dispatchProtocolMessage(const String16& message) = 0; | 30 virtual void dispatchProtocolMessage(const String16& message) = 0; |
| 36 virtual String16 stateJSON() = 0; | 31 virtual String16 stateJSON() = 0; |
| 37 virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0; | |
| 38 | 32 |
| 39 // API for the embedder to report native activities. | 33 // Debugger actions. |
| 40 virtual void schedulePauseOnNextStatement(const String16& breakReason, std::
unique_ptr<protocol::DictionaryValue> data) = 0; | 34 virtual void schedulePauseOnNextStatement(const String16& breakReason, std::
unique_ptr<protocol::DictionaryValue> data) = 0; |
| 41 virtual void cancelPauseOnNextStatement() = 0; | 35 virtual void cancelPauseOnNextStatement() = 0; |
| 42 virtual void breakProgram(const String16& breakReason, std::unique_ptr<proto
col::DictionaryValue> data) = 0; | 36 virtual void breakProgram(const String16& breakReason, std::unique_ptr<proto
col::DictionaryValue> data) = 0; |
| 43 virtual void setSkipAllPauses(bool) = 0; | 37 virtual void setSkipAllPauses(bool) = 0; |
| 44 virtual void resume() = 0; | 38 virtual void resume() = 0; |
| 45 virtual void stepOver() = 0; | 39 virtual void stepOver() = 0; |
| 46 | 40 |
| 47 // API to work with remote objects. | 41 // Remote objects. |
| 48 virtual std::unique_ptr<protocol::Runtime::RemoteObject> wrapObject(v8::Loca
l<v8::Context>, v8::Local<v8::Value>, const String16& groupName, bool generatePr
eview = false) = 0; | 42 static const char backtraceObjectGroup[]; |
| 49 // FIXME: remove when InspectorConsoleAgent moves into V8 inspector. | 43 virtual std::unique_ptr<protocol::Runtime::RemoteObject> wrapObject(v8::Loca
l<v8::Context>, v8::Local<v8::Value>, const String16& groupName, bool generatePr
eview) = 0; |
| 50 virtual std::unique_ptr<protocol::Runtime::RemoteObject> wrapTable(v8::Local
<v8::Context>, v8::Local<v8::Value> table, v8::Local<v8::Value> columns) = 0; | |
| 51 virtual v8::Local<v8::Value> findObject(ErrorString*, const String16& object
Id, v8::Local<v8::Context>* = nullptr, String16* objectGroup = nullptr) = 0; | 44 virtual v8::Local<v8::Value> findObject(ErrorString*, const String16& object
Id, v8::Local<v8::Context>* = nullptr, String16* objectGroup = nullptr) = 0; |
| 52 virtual void releaseObjectGroup(const String16&) = 0; | 45 virtual void releaseObjectGroup(const String16&) = 0; |
| 53 }; | 46 }; |
| 54 | 47 |
| 55 } // namespace blink | 48 } // namespace blink |
| 56 | 49 |
| 57 #endif // V8InspectorSession_h | 50 #endif // V8InspectorSession_h |
| OLD | NEW |