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/InspectorProtocol.h" | 8 #include "platform/v8_inspector/protocol/InspectorProtocol.h" |
9 #include "platform/v8_inspector/protocol/Runtime.h" | 9 #include "platform/v8_inspector/protocol/Runtime.h" |
10 #include "platform/v8_inspector/public/V8InspectorSession.h" | 10 #include "platform/v8_inspector/public/V8InspectorSession.h" |
11 | 11 |
12 #include <v8.h> | 12 #include <v8.h> |
13 | |
14 #include <vector> | 13 #include <vector> |
15 | 14 |
16 namespace v8_inspector { | 15 namespace v8_inspector { |
17 | 16 |
18 class InjectedScript; | 17 class InjectedScript; |
19 class RemoteObjectIdBase; | 18 class RemoteObjectIdBase; |
20 class V8ConsoleAgentImpl; | 19 class V8ConsoleAgentImpl; |
21 class V8DebuggerAgentImpl; | 20 class V8DebuggerAgentImpl; |
22 class V8InspectorImpl; | 21 class V8InspectorImpl; |
23 class V8HeapProfilerAgentImpl; | 22 class V8HeapProfilerAgentImpl; |
24 class V8ProfilerAgentImpl; | 23 class V8ProfilerAgentImpl; |
25 class V8RuntimeAgentImpl; | 24 class V8RuntimeAgentImpl; |
26 | 25 |
27 namespace protocol = blink::protocol; | 26 using protocol::ErrorString; |
28 | 27 |
29 class V8InspectorSessionImpl : public V8InspectorSession { | 28 class V8InspectorSessionImpl : public V8InspectorSession { |
30 PROTOCOL_DISALLOW_COPY(V8InspectorSessionImpl); | 29 PROTOCOL_DISALLOW_COPY(V8InspectorSessionImpl); |
31 public: | 30 public: |
32 static std::unique_ptr<V8InspectorSessionImpl> create(V8InspectorImpl*, int
contextGroupId, protocol::FrontendChannel*, const String16* state); | 31 static std::unique_ptr<V8InspectorSessionImpl> create(V8InspectorImpl*, int
contextGroupId, protocol::FrontendChannel*, const String16* state); |
33 ~V8InspectorSessionImpl(); | 32 ~V8InspectorSessionImpl(); |
34 | 33 |
35 V8InspectorImpl* inspector() const { return m_inspector; } | 34 V8InspectorImpl* inspector() const { return m_inspector; } |
36 V8ConsoleAgentImpl* consoleAgent() { return m_consoleAgent.get(); } | 35 V8ConsoleAgentImpl* consoleAgent() { return m_consoleAgent.get(); } |
37 V8DebuggerAgentImpl* debuggerAgent() { return m_debuggerAgent.get(); } | 36 V8DebuggerAgentImpl* debuggerAgent() { return m_debuggerAgent.get(); } |
(...skipping 13 matching lines...) Expand all Loading... |
51 // V8InspectorSession implementation. | 50 // V8InspectorSession implementation. |
52 void dispatchProtocolMessage(const String16& message) override; | 51 void dispatchProtocolMessage(const String16& message) override; |
53 String16 stateJSON() override; | 52 String16 stateJSON() override; |
54 void addInspectedObject(std::unique_ptr<V8InspectorSession::Inspectable>) ov
erride; | 53 void addInspectedObject(std::unique_ptr<V8InspectorSession::Inspectable>) ov
erride; |
55 void schedulePauseOnNextStatement(const String16& breakReason, const String1
6& breakDetails) override; | 54 void schedulePauseOnNextStatement(const String16& breakReason, const String1
6& breakDetails) override; |
56 void cancelPauseOnNextStatement() override; | 55 void cancelPauseOnNextStatement() override; |
57 void breakProgram(const String16& breakReason, const String16& breakDetails)
override; | 56 void breakProgram(const String16& breakReason, const String16& breakDetails)
override; |
58 void setSkipAllPauses(bool) override; | 57 void setSkipAllPauses(bool) override; |
59 void resume() override; | 58 void resume() override; |
60 void stepOver() override; | 59 void stepOver() override; |
61 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> searc
hInTextByLines(const String16& text, const String16& query, bool caseSensitive,
bool isRegex) override; | 60 std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>> searchInT
extByLines(const String16& text, const String16& query, bool caseSensitive, bool
isRegex) override; |
62 void releaseObjectGroup(const String16& objectGroup) override; | 61 void releaseObjectGroup(const String16& objectGroup) override; |
63 bool unwrapObject(ErrorString*, const String16& objectId, v8::Local<v8::Valu
e>*, v8::Local<v8::Context>*, String16* objectGroup) override; | 62 bool unwrapObject(ErrorString*, const String16& objectId, v8::Local<v8::Valu
e>*, v8::Local<v8::Context>*, String16* objectGroup) override; |
64 std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(v8::Local<v
8::Context>, v8::Local<v8::Value>, const String16& groupName) override; | 63 std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(v8::Local<v
8::Context>, v8::Local<v8::Value>, const String16& groupName) override; |
65 | 64 |
66 V8InspectorSession::Inspectable* inspectedObject(unsigned num); | 65 V8InspectorSession::Inspectable* inspectedObject(unsigned num); |
67 static const unsigned kInspectedObjectBufferSize = 5; | 66 static const unsigned kInspectedObjectBufferSize = 5; |
68 | 67 |
69 private: | 68 private: |
70 V8InspectorSessionImpl(V8InspectorImpl*, int contextGroupId, protocol::Front
endChannel*, const String16* state); | 69 V8InspectorSessionImpl(V8InspectorImpl*, int contextGroupId, protocol::Front
endChannel*, const String16* state); |
71 protocol::DictionaryValue* agentState(const String16& name); | 70 protocol::DictionaryValue* agentState(const String16& name); |
72 | 71 |
73 int m_contextGroupId; | 72 int m_contextGroupId; |
74 V8InspectorImpl* m_inspector; | 73 V8InspectorImpl* m_inspector; |
75 bool m_customObjectFormatterEnabled; | 74 bool m_customObjectFormatterEnabled; |
76 | 75 |
77 protocol::UberDispatcher m_dispatcher; | 76 protocol::UberDispatcher m_dispatcher; |
78 std::unique_ptr<protocol::DictionaryValue> m_state; | 77 std::unique_ptr<protocol::DictionaryValue> m_state; |
79 | 78 |
80 std::unique_ptr<V8RuntimeAgentImpl> m_runtimeAgent; | 79 std::unique_ptr<V8RuntimeAgentImpl> m_runtimeAgent; |
81 std::unique_ptr<V8DebuggerAgentImpl> m_debuggerAgent; | 80 std::unique_ptr<V8DebuggerAgentImpl> m_debuggerAgent; |
82 std::unique_ptr<V8HeapProfilerAgentImpl> m_heapProfilerAgent; | 81 std::unique_ptr<V8HeapProfilerAgentImpl> m_heapProfilerAgent; |
83 std::unique_ptr<V8ProfilerAgentImpl> m_profilerAgent; | 82 std::unique_ptr<V8ProfilerAgentImpl> m_profilerAgent; |
84 std::unique_ptr<V8ConsoleAgentImpl> m_consoleAgent; | 83 std::unique_ptr<V8ConsoleAgentImpl> m_consoleAgent; |
85 std::vector<std::unique_ptr<V8InspectorSession::Inspectable>> m_inspectedObj
ects; | 84 std::vector<std::unique_ptr<V8InspectorSession::Inspectable>> m_inspectedObj
ects; |
86 }; | 85 }; |
87 | 86 |
88 } // namespace v8_inspector | 87 } // namespace v8_inspector |
89 | 88 |
90 #endif | 89 #endif |
OLD | NEW |