| 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 #include <unordered_set> | |
| 11 | 10 |
| 12 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/containers/flat_set.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/browser/devtools/devtools_agent_host_impl.h" | 15 #include "content/browser/devtools/devtools_agent_host_impl.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
| 18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 19 | 19 |
| 20 #if defined(OS_ANDROID) | 20 #if defined(OS_ANDROID) |
| 21 #include "ui/android/view_android.h" | 21 #include "ui/android/view_android.h" |
| 22 #endif // OS_ANDROID | 22 #endif // OS_ANDROID |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 #if defined(OS_ANDROID) | 164 #if defined(OS_ANDROID) |
| 165 device::mojom::WakeLockPtr wake_lock_; | 165 device::mojom::WakeLockPtr wake_lock_; |
| 166 #endif | 166 #endif |
| 167 RenderFrameHostImpl* handlers_frame_host_; | 167 RenderFrameHostImpl* handlers_frame_host_; |
| 168 bool current_frame_crashed_; | 168 bool current_frame_crashed_; |
| 169 | 169 |
| 170 // PlzNavigate | 170 // PlzNavigate |
| 171 | 171 |
| 172 // The active host we are talking to. | 172 // The active host we are talking to. |
| 173 RenderFrameHostImpl* frame_host_ = nullptr; | 173 RenderFrameHostImpl* frame_host_ = nullptr; |
| 174 base::flat_set<NavigationHandleImpl*> navigation_handles_; |
| 175 bool render_frame_alive_ = false; |
| 176 |
| 177 // These messages were queued after suspending, not sent to the agent, |
| 178 // and will be sent after resuming. |
| 174 struct Message { | 179 struct Message { |
| 175 int session_id; | 180 int session_id; |
| 181 int call_id; |
| 176 std::string method; | 182 std::string method; |
| 177 std::string message; | 183 std::string message; |
| 178 }; | 184 }; |
| 179 // Chunk processor's state cookie always corresponds to a state before | 185 std::vector<Message> suspended_messages_; |
| 180 // any of the suspended or waiting for response messages have been handled. | |
| 181 DevToolsMessageChunkProcessor chunk_processor_; | |
| 182 std::unordered_set<NavigationHandleImpl*> navigation_handles_; | |
| 183 bool render_frame_alive_ = false; | |
| 184 // These messages were sent before suspending, but their result have not been | |
| 185 // received yet, and state cookie has not been updated. | |
| 186 std::map<int, Message> waiting_for_response_messages_; | |
| 187 // These messages were queued after suspending, not sent to the agent, | |
| 188 // and will be sent after resuming. | |
| 189 std::map<int, Message> suspended_messages_; | |
| 190 | 186 |
| 191 // The FrameTreeNode associated with this agent. | 187 // The FrameTreeNode associated with this agent. |
| 192 FrameTreeNode* frame_tree_node_; | 188 FrameTreeNode* frame_tree_node_; |
| 193 | 189 |
| 194 DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost); | 190 DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost); |
| 195 }; | 191 }; |
| 196 | 192 |
| 197 } // namespace content | 193 } // namespace content |
| 198 | 194 |
| 199 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ | 195 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |