Chromium Code Reviews| 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 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 class CONTENT_EXPORT RenderFrameDevToolsAgentHost | 48 class CONTENT_EXPORT RenderFrameDevToolsAgentHost |
| 49 : public DevToolsAgentHostImpl, | 49 : public DevToolsAgentHostImpl, |
| 50 private WebContentsObserver { | 50 private WebContentsObserver { |
| 51 public: | 51 public: |
| 52 static void AddAllAgentHosts(DevToolsAgentHost::List* result); | 52 static void AddAllAgentHosts(DevToolsAgentHost::List* result); |
| 53 | 53 |
| 54 static void OnCancelPendingNavigation(RenderFrameHost* pending, | 54 static void OnCancelPendingNavigation(RenderFrameHost* pending, |
| 55 RenderFrameHost* current); | 55 RenderFrameHost* current); |
| 56 static void OnBeforeNavigation(RenderFrameHost* current, | 56 static void OnBeforeNavigation(RenderFrameHost* current, |
| 57 RenderFrameHost* pending); | 57 RenderFrameHost* pending); |
| 58 static void OnBeforeNavigation(NavigationHandle* navigation_handle); | |
|
dgozman
2016/02/24 19:05:45
I don't really like this. We hoped to move away fr
clamy
2016/02/25 14:24:15
The content policy is not to add methods to the co
| |
| 58 | 59 |
| 59 void SynchronousSwapCompositorFrame( | 60 void SynchronousSwapCompositorFrame( |
| 60 const cc::CompositorFrameMetadata& frame_metadata); | 61 const cc::CompositorFrameMetadata& frame_metadata); |
| 61 | 62 |
| 62 bool HasRenderFrameHost(RenderFrameHost* host); | 63 bool HasRenderFrameHost(RenderFrameHost* host); |
| 63 | 64 |
| 64 // DevTooolsAgentHost overrides. | 65 // DevTooolsAgentHost overrides. |
| 65 void DisconnectWebContents() override; | 66 void DisconnectWebContents() override; |
| 66 void ConnectWebContents(WebContents* web_contents) override; | 67 void ConnectWebContents(WebContents* web_contents) override; |
| 67 BrowserContext* GetBrowserContext() override; | 68 BrowserContext* GetBrowserContext() override; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 83 static void AppendAgentHostForFrameIfApplicable( | 84 static void AppendAgentHostForFrameIfApplicable( |
| 84 DevToolsAgentHost::List* result, | 85 DevToolsAgentHost::List* result, |
| 85 RenderFrameHost* host); | 86 RenderFrameHost* host); |
| 86 | 87 |
| 87 // DevToolsAgentHostImpl overrides. | 88 // DevToolsAgentHostImpl overrides. |
| 88 void Attach() override; | 89 void Attach() override; |
| 89 void Detach() override; | 90 void Detach() override; |
| 90 void InspectElement(int x, int y) override; | 91 void InspectElement(int x, int y) override; |
| 91 | 92 |
| 92 // WebContentsObserver overrides. | 93 // WebContentsObserver overrides. |
| 93 void DidStartNavigation(NavigationHandle* navigation_handle) override; | |
| 94 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; | 94 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; |
| 95 void DidFinishNavigation(NavigationHandle* navigation_handle) override; | 95 void DidFinishNavigation(NavigationHandle* navigation_handle) override; |
| 96 void RenderFrameHostChanged(RenderFrameHost* old_host, | 96 void RenderFrameHostChanged(RenderFrameHost* old_host, |
| 97 RenderFrameHost* new_host) override; | 97 RenderFrameHost* new_host) override; |
| 98 void FrameDeleted(RenderFrameHost* rfh) override; | 98 void FrameDeleted(RenderFrameHost* rfh) override; |
| 99 void RenderFrameDeleted(RenderFrameHost* rfh) override; | 99 void RenderFrameDeleted(RenderFrameHost* rfh) override; |
| 100 void RenderProcessGone(base::TerminationStatus status) override; | 100 void RenderProcessGone(base::TerminationStatus status) override; |
| 101 bool OnMessageReceived(const IPC::Message& message, | 101 bool OnMessageReceived(const IPC::Message& message, |
| 102 RenderFrameHost* render_frame_host) override; | 102 RenderFrameHost* render_frame_host) override; |
| 103 bool OnMessageReceived(const IPC::Message& message) override; | 103 bool OnMessageReceived(const IPC::Message& message) override; |
| 104 void DidAttachInterstitialPage() override; | 104 void DidAttachInterstitialPage() override; |
| 105 void DidDetachInterstitialPage() override; | 105 void DidDetachInterstitialPage() override; |
| 106 void DidCommitProvisionalLoadForFrame( | 106 void DidCommitProvisionalLoadForFrame( |
| 107 RenderFrameHost* render_frame_host, | 107 RenderFrameHost* render_frame_host, |
| 108 const GURL& url, | 108 const GURL& url, |
| 109 ui::PageTransition transition_type) override; | 109 ui::PageTransition transition_type) override; |
| 110 void DidFailProvisionalLoad( | 110 void DidFailProvisionalLoad( |
| 111 RenderFrameHost* render_frame_host, | 111 RenderFrameHost* render_frame_host, |
| 112 const GURL& validated_url, | 112 const GURL& validated_url, |
| 113 int error_code, | 113 int error_code, |
| 114 const base::string16& error_description, | 114 const base::string16& error_description, |
| 115 bool was_ignored_by_handler) override; | 115 bool was_ignored_by_handler) override; |
| 116 | 116 |
| 117 void AboutToNavigateRenderFrame(RenderFrameHost* old_host, | 117 void AboutToNavigateRenderFrame(RenderFrameHost* old_host, |
| 118 RenderFrameHost* new_host); | 118 RenderFrameHost* new_host); |
| 119 void WillStartRequest(NavigationHandle* navigation_handle); | |
|
dgozman
2016/02/24 19:05:45
This is a strange name. Perhaps, |AboutToNavigate|
clamy
2016/02/25 14:24:15
Done.
| |
| 119 | 120 |
| 120 void DispatchBufferedProtocolMessagesIfNecessary(); | 121 void DispatchBufferedProtocolMessagesIfNecessary(); |
| 121 | 122 |
| 122 void SetPending(RenderFrameHostImpl* host); | 123 void SetPending(RenderFrameHostImpl* host); |
| 123 void CommitPending(); | 124 void CommitPending(); |
| 124 void DiscardPending(); | 125 void DiscardPending(); |
| 125 void UpdateProtocolHandlers(RenderFrameHostImpl* host); | 126 void UpdateProtocolHandlers(RenderFrameHostImpl* host); |
| 126 | 127 |
| 127 bool IsChildFrame(); | 128 bool IsChildFrame(); |
| 128 | 129 |
| 129 void OnClientAttached(); | 130 void OnClientAttached(); |
| 130 void OnClientDetached(); | 131 void OnClientDetached(); |
| 131 | 132 |
| 132 void RenderFrameCrashed(); | 133 void RenderFrameCrashed(); |
| 133 void OnSwapCompositorFrame(const IPC::Message& message); | 134 void OnSwapCompositorFrame(const IPC::Message& message); |
| 134 void OnDispatchOnInspectorFrontend( | 135 void OnDispatchOnInspectorFrontend( |
| 135 RenderFrameHost* sender, | 136 RenderFrameHost* sender, |
| 136 const DevToolsMessageChunk& message); | 137 const DevToolsMessageChunk& message); |
| 137 void OnRequestNewWindow(RenderFrameHost* sender, int new_routing_id); | 138 void OnRequestNewWindow(RenderFrameHost* sender, int new_routing_id); |
| 138 void DestroyOnRenderFrameGone(); | 139 void DestroyOnRenderFrameGone(); |
| 139 | 140 |
| 140 bool MatchesMyTreeNode(NavigationHandle* navigation_handle); | |
| 141 | |
| 142 class FrameHostHolder; | 141 class FrameHostHolder; |
| 143 | 142 |
| 144 scoped_ptr<FrameHostHolder> current_; | 143 scoped_ptr<FrameHostHolder> current_; |
| 145 scoped_ptr<FrameHostHolder> pending_; | 144 scoped_ptr<FrameHostHolder> pending_; |
| 146 | 145 |
| 147 // Stores per-host state between DisconnectWebContents and ConnectWebContents. | 146 // Stores per-host state between DisconnectWebContents and ConnectWebContents. |
| 148 scoped_ptr<FrameHostHolder> disconnected_; | 147 scoped_ptr<FrameHostHolder> disconnected_; |
| 149 | 148 |
| 150 scoped_ptr<devtools::dom::DOMHandler> dom_handler_; | 149 scoped_ptr<devtools::dom::DOMHandler> dom_handler_; |
| 151 scoped_ptr<devtools::input::InputHandler> input_handler_; | 150 scoped_ptr<devtools::input::InputHandler> input_handler_; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 163 scoped_ptr<PowerSaveBlockerImpl> power_save_blocker_; | 162 scoped_ptr<PowerSaveBlockerImpl> power_save_blocker_; |
| 164 #endif | 163 #endif |
| 165 scoped_ptr<DevToolsProtocolHandler> protocol_handler_; | 164 scoped_ptr<DevToolsProtocolHandler> protocol_handler_; |
| 166 bool current_frame_crashed_; | 165 bool current_frame_crashed_; |
| 167 | 166 |
| 168 // PlzNavigate | 167 // PlzNavigate |
| 169 | 168 |
| 170 // Handle that caused the setting of pending_. | 169 // Handle that caused the setting of pending_. |
| 171 NavigationHandle* pending_handle_; | 170 NavigationHandle* pending_handle_; |
| 172 | 171 |
| 173 // Navigation counter and queue for buffering protocol messages during a | 172 // List of handles currently navigating. |
| 174 // navigation. | 173 std::set<NavigationHandle*> navigating_handles_; |
| 175 int in_navigation_; | |
| 176 | 174 |
| 177 // <call_id> -> <session_id, message> | 175 // <call_id> -> <session_id, message> |
| 178 std::map<int, std::pair<int, std::string>> | 176 std::map<int, std::pair<int, std::string>> |
| 179 in_navigation_protocol_message_buffer_; | 177 in_navigation_protocol_message_buffer_; |
| 180 | 178 |
| 181 // The FrameTreeNode associated with this agent. | 179 // The FrameTreeNode associated with this agent. |
| 182 FrameTreeNode* frame_tree_node_; | 180 FrameTreeNode* frame_tree_node_; |
| 183 | 181 |
| 184 DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost); | 182 DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost); |
| 185 }; | 183 }; |
| 186 | 184 |
| 187 } // namespace content | 185 } // namespace content |
| 188 | 186 |
| 189 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ | 187 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |