OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "content/browser/devtools/devtools_agent_host_impl.h" | 14 #include "content/browser/devtools/devtools_agent_host_impl.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
18 | 18 |
19 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
20 #include "ui/android/view_android.h" | 20 #include "ui/android/view_android.h" |
21 #endif // OS_ANDROID | 21 #endif // OS_ANDROID |
22 | 22 |
23 namespace cc { | 23 namespace cc { |
24 class CompositorFrameMetadata; | 24 class CompositorFrameMetadata; |
25 } | 25 } |
26 | 26 |
27 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
28 namespace device { | 28 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" |
29 class PowerSaveBlocker; | |
30 } // namespace device | |
31 #endif | 29 #endif |
32 | 30 |
33 namespace content { | 31 namespace content { |
34 | 32 |
35 class BrowserContext; | 33 class BrowserContext; |
36 class DevToolsFrameTraceRecorder; | 34 class DevToolsFrameTraceRecorder; |
37 class FrameTreeNode; | 35 class FrameTreeNode; |
38 class NavigationHandle; | 36 class NavigationHandle; |
39 class NavigationThrottle; | 37 class NavigationThrottle; |
40 class RenderFrameHostImpl; | 38 class RenderFrameHostImpl; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void RenderFrameCrashed(); | 143 void RenderFrameCrashed(); |
146 void OnSwapCompositorFrame(const IPC::Message& message); | 144 void OnSwapCompositorFrame(const IPC::Message& message); |
147 void OnDispatchOnInspectorFrontend( | 145 void OnDispatchOnInspectorFrontend( |
148 RenderFrameHost* sender, | 146 RenderFrameHost* sender, |
149 const DevToolsMessageChunk& message); | 147 const DevToolsMessageChunk& message); |
150 void OnRequestNewWindow(RenderFrameHost* sender, int new_routing_id); | 148 void OnRequestNewWindow(RenderFrameHost* sender, int new_routing_id); |
151 void DestroyOnRenderFrameGone(); | 149 void DestroyOnRenderFrameGone(); |
152 | 150 |
153 bool CheckConsistency(); | 151 bool CheckConsistency(); |
154 | 152 |
155 void CreatePowerSaveBlocker(); | 153 #if defined(OS_ANDROID) |
| 154 device::mojom::WakeLockService* GetWakeLockService(); |
| 155 #endif |
156 | 156 |
157 void SynchronousSwapCompositorFrame( | 157 void SynchronousSwapCompositorFrame( |
158 cc::CompositorFrameMetadata frame_metadata); | 158 cc::CompositorFrameMetadata frame_metadata); |
159 | 159 |
160 class FrameHostHolder; | 160 class FrameHostHolder; |
161 | 161 |
162 std::unique_ptr<FrameHostHolder> current_; | 162 std::unique_ptr<FrameHostHolder> current_; |
163 std::unique_ptr<FrameHostHolder> pending_; | 163 std::unique_ptr<FrameHostHolder> pending_; |
164 | 164 |
165 // Stores per-host state between DisconnectWebContents and ConnectWebContents. | 165 // Stores per-host state between DisconnectWebContents and ConnectWebContents. |
166 std::unique_ptr<FrameHostHolder> disconnected_; | 166 std::unique_ptr<FrameHostHolder> disconnected_; |
167 | 167 |
168 std::unique_ptr<DevToolsFrameTraceRecorder> frame_trace_recorder_; | 168 std::unique_ptr<DevToolsFrameTraceRecorder> frame_trace_recorder_; |
169 #if defined(OS_ANDROID) | 169 #if defined(OS_ANDROID) |
170 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; | 170 device::mojom::WakeLockServicePtr wake_lock_; |
171 #endif | 171 #endif |
172 RenderFrameHostImpl* handlers_frame_host_; | 172 RenderFrameHostImpl* handlers_frame_host_; |
173 bool current_frame_crashed_; | 173 bool current_frame_crashed_; |
174 | 174 |
175 // PlzNavigate | 175 // PlzNavigate |
176 | 176 |
177 // Handle that caused the setting of pending_. | 177 // Handle that caused the setting of pending_. |
178 NavigationHandle* pending_handle_; | 178 NavigationHandle* pending_handle_; |
179 | 179 |
180 // List of handles currently navigating. | 180 // List of handles currently navigating. |
181 std::set<NavigationHandle*> navigating_handles_; | 181 std::set<NavigationHandle*> navigating_handles_; |
182 | 182 |
183 struct PendingMessage { | 183 struct PendingMessage { |
184 int session_id; | 184 int session_id; |
185 std::string method; | 185 std::string method; |
186 std::string message; | 186 std::string message; |
187 }; | 187 }; |
188 // <call_id> -> PendingMessage | 188 // <call_id> -> PendingMessage |
189 std::map<int, PendingMessage> in_navigation_protocol_message_buffer_; | 189 std::map<int, PendingMessage> in_navigation_protocol_message_buffer_; |
190 | 190 |
191 // The FrameTreeNode associated with this agent. | 191 // The FrameTreeNode associated with this agent. |
192 FrameTreeNode* frame_tree_node_; | 192 FrameTreeNode* frame_tree_node_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost); | 194 DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost); |
195 }; | 195 }; |
196 | 196 |
197 } // namespace content | 197 } // namespace content |
198 | 198 |
199 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ | 199 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ |
OLD | NEW |