OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 unsigned nextExceptionId() { return ++m_lastExceptionId; } | 98 unsigned nextExceptionId() { return ++m_lastExceptionId; } |
99 void enableStackCapturingIfNeeded(); | 99 void enableStackCapturingIfNeeded(); |
100 void disableStackCapturingIfNeeded(); | 100 void disableStackCapturingIfNeeded(); |
101 void muteExceptions(int contextGroupId); | 101 void muteExceptions(int contextGroupId); |
102 void unmuteExceptions(int contextGroupId); | 102 void unmuteExceptions(int contextGroupId); |
103 V8ConsoleMessageStorage* ensureConsoleMessageStorage(int contextGroupId); | 103 V8ConsoleMessageStorage* ensureConsoleMessageStorage(int contextGroupId); |
104 bool hasConsoleMessageStorage(int contextGroupId); | 104 bool hasConsoleMessageStorage(int contextGroupId); |
105 void discardInspectedContext(int contextGroupId, int contextId); | 105 void discardInspectedContext(int contextGroupId, int contextId); |
106 void disconnect(V8InspectorSessionImpl*); | 106 void disconnect(V8InspectorSessionImpl*); |
107 V8InspectorSessionImpl* sessionForContextGroup(int contextGroupId); | 107 V8InspectorSessionImpl* sessionById(int contextGroupId, int sessionId); |
108 V8InspectorSessionImpl* sessionById(int sessionId); | |
109 InspectedContext* getContext(int groupId, int contextId) const; | 108 InspectedContext* getContext(int groupId, int contextId) const; |
110 V8Console* console(); | 109 V8Console* console(); |
111 void forEachContext(int contextGroupId, | 110 void forEachContext(int contextGroupId, |
112 std::function<void(InspectedContext*)> callback); | 111 std::function<void(InspectedContext*)> callback); |
| 112 void forEachSession(int contextGroupId, |
| 113 std::function<void(V8InspectorSessionImpl*)> callback); |
113 | 114 |
114 private: | 115 private: |
115 v8::Isolate* m_isolate; | 116 v8::Isolate* m_isolate; |
116 V8InspectorClient* m_client; | 117 V8InspectorClient* m_client; |
117 std::unique_ptr<V8Debugger> m_debugger; | 118 std::unique_ptr<V8Debugger> m_debugger; |
118 v8::Global<v8::Context> m_regexContext; | 119 v8::Global<v8::Context> m_regexContext; |
119 int m_capturingStackTracesCount; | 120 int m_capturingStackTracesCount; |
120 unsigned m_lastExceptionId; | 121 unsigned m_lastExceptionId; |
121 int m_lastContextId; | 122 int m_lastContextId; |
122 int m_lastSessionId = 0; | 123 int m_lastSessionId = 0; |
123 | 124 |
124 using MuteExceptionsMap = protocol::HashMap<int, int>; | 125 using MuteExceptionsMap = protocol::HashMap<int, int>; |
125 MuteExceptionsMap m_muteExceptionsMap; | 126 MuteExceptionsMap m_muteExceptionsMap; |
126 | 127 |
127 using ContextByIdMap = | 128 using ContextByIdMap = |
128 protocol::HashMap<int, std::unique_ptr<InspectedContext>>; | 129 protocol::HashMap<int, std::unique_ptr<InspectedContext>>; |
129 using ContextsByGroupMap = | 130 using ContextsByGroupMap = |
130 protocol::HashMap<int, std::unique_ptr<ContextByIdMap>>; | 131 protocol::HashMap<int, std::unique_ptr<ContextByIdMap>>; |
131 ContextsByGroupMap m_contexts; | 132 ContextsByGroupMap m_contexts; |
132 | 133 |
133 using SessionMap = protocol::HashMap<int, V8InspectorSessionImpl*>; | 134 // contextGroupId -> sessionId -> session |
134 SessionMap m_sessions; | 135 protocol::HashMap<int, protocol::HashMap<int, V8InspectorSessionImpl*>> |
135 protocol::HashMap<int, V8InspectorSessionImpl*> m_sessionById; | 136 m_sessions; |
136 | 137 |
137 using ConsoleStorageMap = | 138 using ConsoleStorageMap = |
138 protocol::HashMap<int, std::unique_ptr<V8ConsoleMessageStorage>>; | 139 protocol::HashMap<int, std::unique_ptr<V8ConsoleMessageStorage>>; |
139 ConsoleStorageMap m_consoleStorageMap; | 140 ConsoleStorageMap m_consoleStorageMap; |
140 | 141 |
141 protocol::HashMap<int, int> m_contextIdToGroupIdMap; | 142 protocol::HashMap<int, int> m_contextIdToGroupIdMap; |
142 | 143 |
143 std::unique_ptr<V8Console> m_console; | 144 std::unique_ptr<V8Console> m_console; |
144 | 145 |
145 DISALLOW_COPY_AND_ASSIGN(V8InspectorImpl); | 146 DISALLOW_COPY_AND_ASSIGN(V8InspectorImpl); |
146 }; | 147 }; |
147 | 148 |
148 } // namespace v8_inspector | 149 } // namespace v8_inspector |
149 | 150 |
150 #endif // V8_INSPECTOR_V8INSPECTORIMPL_H_ | 151 #endif // V8_INSPECTOR_V8INSPECTORIMPL_H_ |
OLD | NEW |