Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: third_party/WebKit/Source/web/WebDevToolsAgentImpl.h

Issue 1967933002: [DevTools] Dispatch messages to V8InspectorSession directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1936593002
Patch Set: rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebDevToolsAgentImpl_h 31 #ifndef WebDevToolsAgentImpl_h
32 #define WebDevToolsAgentImpl_h 32 #define WebDevToolsAgentImpl_h
33 33
34 #include "core/inspector/InspectorPageAgent.h" 34 #include "core/inspector/InspectorPageAgent.h"
35 #include "core/inspector/InspectorRuntimeAgent.h"
36 #include "core/inspector/InspectorSession.h" 35 #include "core/inspector/InspectorSession.h"
37 #include "core/inspector/InspectorTracingAgent.h" 36 #include "core/inspector/InspectorTracingAgent.h"
38 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
39 #include "public/platform/WebSize.h" 38 #include "public/platform/WebSize.h"
40 #include "public/platform/WebThread.h" 39 #include "public/platform/WebThread.h"
41 #include "public/web/WebDevToolsAgent.h" 40 #include "public/web/WebDevToolsAgent.h"
42 #include "web/InspectorEmulationAgent.h" 41 #include "web/InspectorEmulationAgent.h"
43 #include "wtf/Forward.h" 42 #include "wtf/Forward.h"
44 #include "wtf/OwnPtr.h" 43 #include "wtf/OwnPtr.h"
45 #include "wtf/Vector.h" 44 #include "wtf/Vector.h"
46 45
47 namespace blink { 46 namespace blink {
48 47
49 class GraphicsLayer; 48 class GraphicsLayer;
50 class InspectedFrames; 49 class InspectedFrames;
51 class InspectorOverlay; 50 class InspectorOverlay;
52 class InspectorResourceContainer; 51 class InspectorResourceContainer;
53 class InspectorResourceContentLoader; 52 class InspectorResourceContentLoader;
54 class LocalFrame; 53 class LocalFrame;
55 class Page; 54 class Page;
56 class PlatformGestureEvent; 55 class PlatformGestureEvent;
57 class PlatformKeyboardEvent; 56 class PlatformKeyboardEvent;
58 class PlatformMouseEvent; 57 class PlatformMouseEvent;
59 class PlatformTouchEvent; 58 class PlatformTouchEvent;
60 class V8InspectorSession;
61 class WebDevToolsAgentClient; 59 class WebDevToolsAgentClient;
62 class WebFrameWidgetImpl; 60 class WebFrameWidgetImpl;
63 class WebInputEvent; 61 class WebInputEvent;
64 class WebLayerTreeView; 62 class WebLayerTreeView;
65 class WebLocalFrameImpl; 63 class WebLocalFrameImpl;
66 class WebString; 64 class WebString;
67 class WebViewImpl; 65 class WebViewImpl;
68 66
69 namespace protocol { 67 namespace protocol {
70 class Value; 68 class Value;
71 } 69 }
72 70
73 class WebDevToolsAgentImpl final 71 class WebDevToolsAgentImpl final
74 : public GarbageCollectedFinalized<WebDevToolsAgentImpl> 72 : public GarbageCollectedFinalized<WebDevToolsAgentImpl>
75 , public WebDevToolsAgent 73 , public WebDevToolsAgent
76 , public InspectorEmulationAgent::Client 74 , public InspectorEmulationAgent::Client
77 , public InspectorTracingAgent::Client 75 , public InspectorTracingAgent::Client
78 , public InspectorPageAgent::Client 76 , public InspectorPageAgent::Client
79 , public InspectorSession::Client 77 , public InspectorSession::Client
80 , private WebThread::TaskObserver { 78 , private WebThread::TaskObserver {
81 public: 79 public:
82 static WebDevToolsAgentImpl* create(WebLocalFrameImpl*, WebDevToolsAgentClie nt*); 80 static WebDevToolsAgentImpl* create(WebLocalFrameImpl*, WebDevToolsAgentClie nt*);
83 ~WebDevToolsAgentImpl() override; 81 ~WebDevToolsAgentImpl() override;
84 void dispose(); 82 void dispose();
85 DECLARE_VIRTUAL_TRACE(); 83 DECLARE_VIRTUAL_TRACE();
86 84
87 void willBeDestroyed(); 85 void willBeDestroyed();
88 WebDevToolsAgentClient* client() { return m_client; } 86 WebDevToolsAgentClient* client() { return m_client; }
89 InspectorOverlay* overlay() const { return m_overlay.get(); } 87 InspectorOverlay* overlay() const { return m_overlay.get(); }
90 void flushPendingProtocolNotifications(); 88 void flushProtocolNotifications();
91 void dispatchMessageFromFrontend(int sessionId, const String& message);
92 static void webViewImplClosed(WebViewImpl*); 89 static void webViewImplClosed(WebViewImpl*);
93 static void webFrameWidgetImplClosed(WebFrameWidgetImpl*); 90 static void webFrameWidgetImplClosed(WebFrameWidgetImpl*);
94 91
95 // Instrumentation from web/ layer. 92 // Instrumentation from web/ layer.
96 void didCommitLoadForLocalFrame(LocalFrame*); 93 void didCommitLoadForLocalFrame(LocalFrame*);
97 bool screencastEnabled(); 94 bool screencastEnabled();
98 void willAddPageOverlay(const GraphicsLayer*); 95 void willAddPageOverlay(const GraphicsLayer*);
99 void didRemovePageOverlay(const GraphicsLayer*); 96 void didRemovePageOverlay(const GraphicsLayer*);
100 void layerTreeViewChanged(WebLayerTreeView*); 97 void layerTreeViewChanged(WebLayerTreeView*);
101 98
(...skipping 25 matching lines...) Expand all
127 // InspectorSession::Client implementation. 124 // InspectorSession::Client implementation.
128 void sendProtocolMessage(int sessionId, int callId, const String& response, const String& state) override; 125 void sendProtocolMessage(int sessionId, int callId, const String& response, const String& state) override;
129 void resumeStartup() override; 126 void resumeStartup() override;
130 void profilingStarted() override; 127 void profilingStarted() override;
131 void profilingStopped() override; 128 void profilingStopped() override;
132 129
133 // WebThread::TaskObserver implementation. 130 // WebThread::TaskObserver implementation.
134 void willProcessTask() override; 131 void willProcessTask() override;
135 void didProcessTask() override; 132 void didProcessTask() override;
136 133
137 void initializeSession(int sessionId, const String& hostId); 134 void initializeSession(int sessionId, const String& hostId, String* state);
138 void destroySession(); 135 void destroySession();
136 void dispatchMessageFromFrontend(int sessionId, const String& method, const String& message);
139 137
140 friend class WebDevToolsAgent; 138 friend class WebDevToolsAgent;
141 static void runDebuggerTask(int sessionId, PassOwnPtr<WebDevToolsAgent::Mess ageDescriptor>); 139 static void runDebuggerTask(int sessionId, PassOwnPtr<WebDevToolsAgent::Mess ageDescriptor>);
142 140
143 bool attached() const { return m_session.get(); } 141 bool attached() const { return m_session.get(); }
144 142
145 WebDevToolsAgentClient* m_client; 143 WebDevToolsAgentClient* m_client;
146 Member<WebLocalFrameImpl> m_webLocalFrameImpl; 144 Member<WebLocalFrameImpl> m_webLocalFrameImpl;
147 #if DCHECK_IS_ON() 145 #if DCHECK_IS_ON()
148 bool m_hasBeenDisposed; 146 bool m_hasBeenDisposed;
149 #endif 147 #endif
150 148
151 Member<InstrumentingAgents> m_instrumentingAgents; 149 Member<InstrumentingAgents> m_instrumentingAgents;
152 Member<InspectorResourceContentLoader> m_resourceContentLoader; 150 Member<InspectorResourceContentLoader> m_resourceContentLoader;
153 Member<InspectorOverlay> m_overlay; 151 Member<InspectorOverlay> m_overlay;
154 Member<InspectedFrames> m_inspectedFrames; 152 Member<InspectedFrames> m_inspectedFrames;
155 Member<InspectorResourceContainer> m_resourceContainer; 153 Member<InspectorResourceContainer> m_resourceContainer;
156 OwnPtr<V8InspectorSession> m_v8Session;
157 154
158 Member<InspectorDOMAgent> m_domAgent; 155 Member<InspectorDOMAgent> m_domAgent;
159 Member<InspectorPageAgent> m_pageAgent; 156 Member<InspectorPageAgent> m_pageAgent;
160 Member<InspectorResourceAgent> m_resourceAgent; 157 Member<InspectorResourceAgent> m_resourceAgent;
161 Member<InspectorLayerTreeAgent> m_layerTreeAgent; 158 Member<InspectorLayerTreeAgent> m_layerTreeAgent;
162 Member<InspectorTracingAgent> m_tracingAgent; 159 Member<InspectorTracingAgent> m_tracingAgent;
163 160
164 Member<InspectorSession> m_session; 161 Member<InspectorSession> m_session;
165 bool m_includeViewAgents; 162 bool m_includeViewAgents;
166 int m_layerTreeId; 163 int m_layerTreeId;
167 }; 164 };
168 165
169 } // namespace blink 166 } // namespace blink
170 167
171 #endif 168 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698