| 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 V8InspectorSessionImpl_h | 5 #ifndef V8InspectorSessionImpl_h |
| 6 #define V8InspectorSessionImpl_h | 6 #define V8InspectorSessionImpl_h |
| 7 | 7 |
| 8 #include "platform/inspector_protocol/Allocator.h" | 8 #include "platform/inspector_protocol/Allocator.h" |
| 9 #include "platform/inspector_protocol/DispatcherBase.h" | 9 #include "platform/inspector_protocol/DispatcherBase.h" |
| 10 #include "platform/inspector_protocol/Platform.h" | 10 #include "platform/inspector_protocol/Platform.h" |
| 11 #include "platform/inspector_protocol/String16.h" | 11 #include "platform/inspector_protocol/String16.h" |
| 12 #include "platform/v8_inspector/protocol/Runtime.h" | 12 #include "platform/v8_inspector/protocol/Runtime.h" |
| 13 #include "platform/v8_inspector/public/V8InspectorSession.h" | 13 #include "platform/v8_inspector/public/V8InspectorSession.h" |
| 14 #include "platform/v8_inspector/public/V8InspectorSessionClient.h" | |
| 15 | 14 |
| 16 #include <v8.h> | 15 #include <v8.h> |
| 17 | 16 |
| 18 #include <vector> | 17 #include <vector> |
| 19 | 18 |
| 20 namespace blink { | 19 namespace blink { |
| 21 | 20 |
| 22 class InjectedScript; | 21 class InjectedScript; |
| 23 class RemoteObjectIdBase; | 22 class RemoteObjectIdBase; |
| 24 class V8ConsoleAgentImpl; | 23 class V8ConsoleAgentImpl; |
| 25 class V8DebuggerAgentImpl; | 24 class V8DebuggerAgentImpl; |
| 26 class V8InspectorImpl; | 25 class V8InspectorImpl; |
| 27 class V8HeapProfilerAgentImpl; | 26 class V8HeapProfilerAgentImpl; |
| 28 class V8ProfilerAgentImpl; | 27 class V8ProfilerAgentImpl; |
| 29 class V8RuntimeAgentImpl; | 28 class V8RuntimeAgentImpl; |
| 30 | 29 |
| 31 class V8InspectorSessionImpl : public V8InspectorSession { | 30 class V8InspectorSessionImpl : public V8InspectorSession { |
| 32 PROTOCOL_DISALLOW_COPY(V8InspectorSessionImpl); | 31 PROTOCOL_DISALLOW_COPY(V8InspectorSessionImpl); |
| 33 public: | 32 public: |
| 34 static std::unique_ptr<V8InspectorSessionImpl> create(V8InspectorImpl*, int
contextGroupId, protocol::FrontendChannel*, V8InspectorSessionClient*, const Str
ing16* state); | 33 static std::unique_ptr<V8InspectorSessionImpl> create(V8InspectorImpl*, int
contextGroupId, protocol::FrontendChannel*, const String16* state); |
| 35 ~V8InspectorSessionImpl(); | 34 ~V8InspectorSessionImpl(); |
| 36 | 35 |
| 37 V8InspectorImpl* inspector() const { return m_inspector; } | 36 V8InspectorImpl* inspector() const { return m_inspector; } |
| 38 V8InspectorSessionClient* client() const { return m_client; } | |
| 39 V8ConsoleAgentImpl* consoleAgent() { return m_consoleAgent.get(); } | 37 V8ConsoleAgentImpl* consoleAgent() { return m_consoleAgent.get(); } |
| 40 V8DebuggerAgentImpl* debuggerAgent() { return m_debuggerAgent.get(); } | 38 V8DebuggerAgentImpl* debuggerAgent() { return m_debuggerAgent.get(); } |
| 41 V8ProfilerAgentImpl* profilerAgent() { return m_profilerAgent.get(); } | 39 V8ProfilerAgentImpl* profilerAgent() { return m_profilerAgent.get(); } |
| 42 V8RuntimeAgentImpl* runtimeAgent() { return m_runtimeAgent.get(); } | 40 V8RuntimeAgentImpl* runtimeAgent() { return m_runtimeAgent.get(); } |
| 43 int contextGroupId() const { return m_contextGroupId; } | 41 int contextGroupId() const { return m_contextGroupId; } |
| 44 | 42 |
| 45 InjectedScript* findInjectedScript(ErrorString*, int contextId); | 43 InjectedScript* findInjectedScript(ErrorString*, int contextId); |
| 46 InjectedScript* findInjectedScript(ErrorString*, RemoteObjectIdBase*); | 44 InjectedScript* findInjectedScript(ErrorString*, RemoteObjectIdBase*); |
| 47 void reset(); | 45 void reset(); |
| 48 void discardInjectedScripts(); | 46 void discardInjectedScripts(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 void stepOver() override; | 61 void stepOver() override; |
| 64 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> searc
hInTextByLines(const String16& text, const String16& query, bool caseSensitive,
bool isRegex) override; | 62 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> searc
hInTextByLines(const String16& text, const String16& query, bool caseSensitive,
bool isRegex) override; |
| 65 void releaseObjectGroup(const String16& objectGroup) override; | 63 void releaseObjectGroup(const String16& objectGroup) override; |
| 66 bool unwrapObject(ErrorString*, const String16& objectId, v8::Local<v8::Valu
e>*, v8::Local<v8::Context>*, String16* objectGroup) override; | 64 bool unwrapObject(ErrorString*, const String16& objectId, v8::Local<v8::Valu
e>*, v8::Local<v8::Context>*, String16* objectGroup) override; |
| 67 std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(v8::Local<v
8::Context>, v8::Local<v8::Value>, const String16& groupName) override; | 65 std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(v8::Local<v
8::Context>, v8::Local<v8::Value>, const String16& groupName) override; |
| 68 | 66 |
| 69 V8InspectorSession::Inspectable* inspectedObject(unsigned num); | 67 V8InspectorSession::Inspectable* inspectedObject(unsigned num); |
| 70 static const unsigned kInspectedObjectBufferSize = 5; | 68 static const unsigned kInspectedObjectBufferSize = 5; |
| 71 | 69 |
| 72 private: | 70 private: |
| 73 V8InspectorSessionImpl(V8InspectorImpl*, int contextGroupId, protocol::Front
endChannel*, V8InspectorSessionClient*, const String16* state); | 71 V8InspectorSessionImpl(V8InspectorImpl*, int contextGroupId, protocol::Front
endChannel*, const String16* state); |
| 74 protocol::DictionaryValue* agentState(const String16& name); | 72 protocol::DictionaryValue* agentState(const String16& name); |
| 75 | 73 |
| 76 int m_contextGroupId; | 74 int m_contextGroupId; |
| 77 V8InspectorImpl* m_inspector; | 75 V8InspectorImpl* m_inspector; |
| 78 V8InspectorSessionClient* m_client; | |
| 79 bool m_customObjectFormatterEnabled; | 76 bool m_customObjectFormatterEnabled; |
| 80 | 77 |
| 81 protocol::UberDispatcher m_dispatcher; | 78 protocol::UberDispatcher m_dispatcher; |
| 82 std::unique_ptr<protocol::DictionaryValue> m_state; | 79 std::unique_ptr<protocol::DictionaryValue> m_state; |
| 83 | 80 |
| 84 std::unique_ptr<V8RuntimeAgentImpl> m_runtimeAgent; | 81 std::unique_ptr<V8RuntimeAgentImpl> m_runtimeAgent; |
| 85 std::unique_ptr<V8DebuggerAgentImpl> m_debuggerAgent; | 82 std::unique_ptr<V8DebuggerAgentImpl> m_debuggerAgent; |
| 86 std::unique_ptr<V8HeapProfilerAgentImpl> m_heapProfilerAgent; | 83 std::unique_ptr<V8HeapProfilerAgentImpl> m_heapProfilerAgent; |
| 87 std::unique_ptr<V8ProfilerAgentImpl> m_profilerAgent; | 84 std::unique_ptr<V8ProfilerAgentImpl> m_profilerAgent; |
| 88 std::unique_ptr<V8ConsoleAgentImpl> m_consoleAgent; | 85 std::unique_ptr<V8ConsoleAgentImpl> m_consoleAgent; |
| 89 std::vector<std::unique_ptr<V8InspectorSession::Inspectable>> m_inspectedObj
ects; | 86 std::vector<std::unique_ptr<V8InspectorSession::Inspectable>> m_inspectedObj
ects; |
| 90 }; | 87 }; |
| 91 | 88 |
| 92 } // namespace blink | 89 } // namespace blink |
| 93 | 90 |
| 94 #endif | 91 #endif |
| OLD | NEW |