| 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/Collections.h" | 9 #include "platform/inspector_protocol/Collections.h" |
| 10 #include "platform/inspector_protocol/String16.h" | 10 #include "platform/inspector_protocol/String16.h" |
| 11 #include "platform/inspector_protocol/TypeBuilder.h" | 11 #include "platform/inspector_protocol/TypeBuilder.h" |
| 12 #include "platform/v8_inspector/public/V8InspectorSession.h" | 12 #include "platform/v8_inspector/public/V8InspectorSession.h" |
| 13 #include "platform/v8_inspector/public/V8InspectorSessionClient.h" |
| 13 #include "platform/v8_inspector/public/V8RuntimeAgent.h" | 14 #include "platform/v8_inspector/public/V8RuntimeAgent.h" |
| 14 #include "wtf/PassOwnPtr.h" | 15 #include "wtf/PassOwnPtr.h" |
| 15 | 16 |
| 16 #include <v8.h> | 17 #include <v8.h> |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| 19 | 20 |
| 20 class InjectedScript; | 21 class InjectedScript; |
| 21 class InjectedScriptHost; | 22 class InjectedScriptHost; |
| 22 class RemoteObjectIdBase; | 23 class RemoteObjectIdBase; |
| 23 class V8DebuggerAgentImpl; | 24 class V8DebuggerAgentImpl; |
| 24 class V8DebuggerImpl; | 25 class V8DebuggerImpl; |
| 25 class V8HeapProfilerAgentImpl; | 26 class V8HeapProfilerAgentImpl; |
| 26 class V8ProfilerAgentImpl; | 27 class V8ProfilerAgentImpl; |
| 27 class V8RuntimeAgentImpl; | 28 class V8RuntimeAgentImpl; |
| 28 | 29 |
| 29 class V8InspectorSessionImpl : public V8InspectorSession { | 30 class V8InspectorSessionImpl : public V8InspectorSession { |
| 30 PROTOCOL_DISALLOW_COPY(V8InspectorSessionImpl); | 31 PROTOCOL_DISALLOW_COPY(V8InspectorSessionImpl); |
| 31 public: | 32 public: |
| 32 static PassOwnPtr<V8InspectorSessionImpl> create(V8DebuggerImpl*, int contex
tGroupId); | 33 static PassOwnPtr<V8InspectorSessionImpl> create(V8DebuggerImpl*, int contex
tGroupId); |
| 33 ~V8InspectorSessionImpl(); | 34 ~V8InspectorSessionImpl(); |
| 34 | 35 |
| 35 V8DebuggerImpl* debugger() const { return m_debugger; } | 36 V8DebuggerImpl* debugger() const { return m_debugger; } |
| 37 V8InspectorSessionClient* client() const { return m_client; } |
| 36 V8DebuggerAgentImpl* debuggerAgentImpl() { return m_debuggerAgent.get(); } | 38 V8DebuggerAgentImpl* debuggerAgentImpl() { return m_debuggerAgent.get(); } |
| 37 V8ProfilerAgentImpl* profilerAgentImpl() { return m_profilerAgent.get(); } | 39 V8ProfilerAgentImpl* profilerAgentImpl() { return m_profilerAgent.get(); } |
| 38 V8RuntimeAgentImpl* runtimeAgentImpl() { return m_runtimeAgent.get(); } | 40 V8RuntimeAgentImpl* runtimeAgentImpl() { return m_runtimeAgent.get(); } |
| 39 int contextGroupId() const { return m_contextGroupId; } | 41 int contextGroupId() const { return m_contextGroupId; } |
| 40 | 42 |
| 41 InjectedScript* findInjectedScript(ErrorString*, int contextId); | 43 InjectedScript* findInjectedScript(ErrorString*, int contextId); |
| 42 InjectedScript* findInjectedScript(ErrorString*, RemoteObjectIdBase*); | 44 InjectedScript* findInjectedScript(ErrorString*, RemoteObjectIdBase*); |
| 43 void reset(); | 45 void reset(); |
| 44 void discardInjectedScripts(); | 46 void discardInjectedScripts(); |
| 45 void reportAllContexts(V8RuntimeAgentImpl*); | 47 void reportAllContexts(V8RuntimeAgentImpl*); |
| 46 void addInspectedObject(PassOwnPtr<V8RuntimeAgent::Inspectable>); | 48 void addInspectedObject(PassOwnPtr<V8RuntimeAgent::Inspectable>); |
| 47 void releaseObjectGroup(const String16& objectGroup); | 49 void releaseObjectGroup(const String16& objectGroup); |
| 48 void setCustomObjectFormatterEnabled(bool); | 50 void setCustomObjectFormatterEnabled(bool); |
| 51 void changeInstrumentationCounter(int delta); |
| 49 | 52 |
| 50 // V8InspectorSession implementation. | 53 // V8InspectorSession implementation. |
| 54 void setClient(V8InspectorSessionClient*) override; |
| 51 V8DebuggerAgent* debuggerAgent() override; | 55 V8DebuggerAgent* debuggerAgent() override; |
| 52 V8HeapProfilerAgent* heapProfilerAgent() override; | 56 V8HeapProfilerAgent* heapProfilerAgent() override; |
| 53 V8ProfilerAgent* profilerAgent() override; | 57 V8ProfilerAgent* profilerAgent() override; |
| 54 V8RuntimeAgent* runtimeAgent() override; | 58 V8RuntimeAgent* runtimeAgent() override; |
| 55 | 59 |
| 56 void setClearConsoleCallback(PassOwnPtr<V8RuntimeAgent::ClearConsoleCallback
> callback) { m_clearConsoleCallback = callback; } | 60 void setClearConsoleCallback(PassOwnPtr<V8RuntimeAgent::ClearConsoleCallback
> callback) { m_clearConsoleCallback = callback; } |
| 57 V8RuntimeAgent::ClearConsoleCallback* clearConsoleCallback() { return m_clea
rConsoleCallback.get(); } | 61 V8RuntimeAgent::ClearConsoleCallback* clearConsoleCallback() { return m_clea
rConsoleCallback.get(); } |
| 58 | 62 |
| 59 private: | 63 private: |
| 60 V8InspectorSessionImpl(V8DebuggerImpl*, int contextGroupId); | 64 V8InspectorSessionImpl(V8DebuggerImpl*, int contextGroupId); |
| 61 | 65 |
| 62 int m_contextGroupId; | 66 int m_contextGroupId; |
| 63 V8DebuggerImpl* m_debugger; | 67 V8DebuggerImpl* m_debugger; |
| 68 V8InspectorSessionClient* m_client; |
| 64 OwnPtr<InjectedScriptHost> m_injectedScriptHost; | 69 OwnPtr<InjectedScriptHost> m_injectedScriptHost; |
| 65 bool m_customObjectFormatterEnabled; | 70 bool m_customObjectFormatterEnabled; |
| 71 int m_instrumentationCounter; |
| 66 | 72 |
| 67 OwnPtr<V8RuntimeAgentImpl> m_runtimeAgent; | 73 OwnPtr<V8RuntimeAgentImpl> m_runtimeAgent; |
| 68 OwnPtr<V8DebuggerAgentImpl> m_debuggerAgent; | 74 OwnPtr<V8DebuggerAgentImpl> m_debuggerAgent; |
| 69 OwnPtr<V8HeapProfilerAgentImpl> m_heapProfilerAgent; | 75 OwnPtr<V8HeapProfilerAgentImpl> m_heapProfilerAgent; |
| 70 OwnPtr<V8ProfilerAgentImpl> m_profilerAgent; | 76 OwnPtr<V8ProfilerAgentImpl> m_profilerAgent; |
| 71 | 77 |
| 72 OwnPtr<V8RuntimeAgent::ClearConsoleCallback> m_clearConsoleCallback; | 78 OwnPtr<V8RuntimeAgent::ClearConsoleCallback> m_clearConsoleCallback; |
| 73 }; | 79 }; |
| 74 | 80 |
| 75 } // namespace blink | 81 } // namespace blink |
| 76 | 82 |
| 77 #endif | 83 #endif |
| OLD | NEW |