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 InspectorSession_h | 5 #ifndef InspectorSession_h |
6 #define InspectorSession_h | 6 #define InspectorSession_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/inspector/protocol/Forward.h" | 9 #include "core/inspector/protocol/Forward.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
14 | 14 |
15 #include <v8-inspector-protocol.h> | 15 #include <v8-inspector-protocol.h> |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class InspectorAgent; | 19 class InspectorAgent; |
20 class InstrumentingAgents; | 20 class InspectorInstrumentationAgents; |
21 class LocalFrame; | 21 class LocalFrame; |
22 | 22 |
23 class CORE_EXPORT InspectorSession | 23 class CORE_EXPORT InspectorSession |
24 : public GarbageCollectedFinalized<InspectorSession>, | 24 : public GarbageCollectedFinalized<InspectorSession>, |
25 public protocol::FrontendChannel, | 25 public protocol::FrontendChannel, |
26 public v8_inspector::V8Inspector::Channel { | 26 public v8_inspector::V8Inspector::Channel { |
27 WTF_MAKE_NONCOPYABLE(InspectorSession); | 27 WTF_MAKE_NONCOPYABLE(InspectorSession); |
28 | 28 |
29 public: | 29 public: |
30 class Client { | 30 class Client { |
31 public: | 31 public: |
32 virtual void sendProtocolMessage(int sessionId, | 32 virtual void sendProtocolMessage(int sessionId, |
33 int callId, | 33 int callId, |
34 const String& response, | 34 const String& response, |
35 const String& state) = 0; | 35 const String& state) = 0; |
36 virtual ~Client() {} | 36 virtual ~Client() {} |
37 }; | 37 }; |
38 | 38 |
39 InspectorSession(Client*, | 39 InspectorSession(Client*, |
40 InstrumentingAgents*, | 40 InspectorInstrumentationAgents*, |
41 int sessionId, | 41 int sessionId, |
42 v8_inspector::V8Inspector*, | 42 v8_inspector::V8Inspector*, |
43 int contextGroupId, | 43 int contextGroupId, |
44 const String* savedState); | 44 const String* savedState); |
45 ~InspectorSession() override; | 45 ~InspectorSession() override; |
46 int sessionId() { return m_sessionId; } | 46 int sessionId() { return m_sessionId; } |
47 v8_inspector::V8InspectorSession* v8Session() { return m_v8Session.get(); } | 47 v8_inspector::V8InspectorSession* v8Session() { return m_v8Session.get(); } |
48 | 48 |
49 void append(InspectorAgent*); | 49 void append(InspectorAgent*); |
50 void restore(); | 50 void restore(); |
(...skipping 22 matching lines...) Expand all Loading... |
73 void sendProtocolResponse(int callId, | 73 void sendProtocolResponse(int callId, |
74 const v8_inspector::StringView& message) {} | 74 const v8_inspector::StringView& message) {} |
75 void sendProtocolNotification(const v8_inspector::StringView& message) {} | 75 void sendProtocolNotification(const v8_inspector::StringView& message) {} |
76 | 76 |
77 void sendProtocolResponse(int callId, const String& message); | 77 void sendProtocolResponse(int callId, const String& message); |
78 | 78 |
79 Client* m_client; | 79 Client* m_client; |
80 std::unique_ptr<v8_inspector::V8InspectorSession> m_v8Session; | 80 std::unique_ptr<v8_inspector::V8InspectorSession> m_v8Session; |
81 int m_sessionId; | 81 int m_sessionId; |
82 bool m_disposed; | 82 bool m_disposed; |
83 Member<InstrumentingAgents> m_instrumentingAgents; | 83 Member<InspectorInstrumentationAgents> m_instrumentingAgents; |
84 std::unique_ptr<protocol::UberDispatcher> m_inspectorBackendDispatcher; | 84 std::unique_ptr<protocol::UberDispatcher> m_inspectorBackendDispatcher; |
85 std::unique_ptr<protocol::DictionaryValue> m_state; | 85 std::unique_ptr<protocol::DictionaryValue> m_state; |
86 HeapVector<Member<InspectorAgent>> m_agents; | 86 HeapVector<Member<InspectorAgent>> m_agents; |
87 class Notification; | 87 class Notification; |
88 Vector<std::unique_ptr<Notification>> m_notificationQueue; | 88 Vector<std::unique_ptr<Notification>> m_notificationQueue; |
89 String m_lastSentState; | 89 String m_lastSentState; |
90 }; | 90 }; |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
93 | 93 |
94 #endif // !defined(InspectorSession_h) | 94 #endif // !defined(InspectorSession_h) |
OLD | NEW |