OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 int GetRoutingID() override; | 128 int GetRoutingID() override; |
129 AXTreeIDRegistry::AXTreeID GetAXTreeID() override; | 129 AXTreeIDRegistry::AXTreeID GetAXTreeID() override; |
130 SiteInstanceImpl* GetSiteInstance() override; | 130 SiteInstanceImpl* GetSiteInstance() override; |
131 RenderProcessHost* GetProcess() override; | 131 RenderProcessHost* GetProcess() override; |
132 RenderWidgetHostView* GetView() override; | 132 RenderWidgetHostView* GetView() override; |
133 RenderFrameHostImpl* GetParent() override; | 133 RenderFrameHostImpl* GetParent() override; |
134 int GetFrameTreeNodeId() override; | 134 int GetFrameTreeNodeId() override; |
135 const std::string& GetFrameName() override; | 135 const std::string& GetFrameName() override; |
136 bool IsCrossProcessSubframe() override; | 136 bool IsCrossProcessSubframe() override; |
137 const GURL& GetLastCommittedURL() override; | 137 const GURL& GetLastCommittedURL() override; |
138 url::Origin GetLastCommittedOrigin() override; | 138 const url::Origin& GetLastCommittedOrigin() override; |
Charlie Reis
2016/12/08 19:51:47
Good catch.
| |
139 gfx::NativeView GetNativeView() override; | 139 gfx::NativeView GetNativeView() override; |
140 void AddMessageToConsole(ConsoleMessageLevel level, | 140 void AddMessageToConsole(ConsoleMessageLevel level, |
141 const std::string& message) override; | 141 const std::string& message) override; |
142 void ExecuteJavaScript(const base::string16& javascript) override; | 142 void ExecuteJavaScript(const base::string16& javascript) override; |
143 void ExecuteJavaScript(const base::string16& javascript, | 143 void ExecuteJavaScript(const base::string16& javascript, |
144 const JavaScriptResultCallback& callback) override; | 144 const JavaScriptResultCallback& callback) override; |
145 void ExecuteJavaScriptInIsolatedWorld( | 145 void ExecuteJavaScriptInIsolatedWorld( |
146 const base::string16& javascript, | 146 const base::string16& javascript, |
147 const JavaScriptResultCallback& callback, | 147 const JavaScriptResultCallback& callback, |
148 int world_id) override; | 148 int world_id) override; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 last_committed_url_ = url; | 233 last_committed_url_ = url; |
234 } | 234 } |
235 | 235 |
236 // The most recent non-net-error URL to commit in this frame. In almost all | 236 // The most recent non-net-error URL to commit in this frame. In almost all |
237 // cases, use GetLastCommittedURL instead. | 237 // cases, use GetLastCommittedURL instead. |
238 const GURL& last_successful_url() { return last_successful_url_; } | 238 const GURL& last_successful_url() { return last_successful_url_; } |
239 void set_last_successful_url(const GURL& url) { | 239 void set_last_successful_url(const GURL& url) { |
240 last_successful_url_ = url; | 240 last_successful_url_ = url; |
241 } | 241 } |
242 | 242 |
243 // Update this frame's last committed origin. | |
244 void set_last_committed_origin(const url::Origin& origin) { | |
245 last_committed_origin_ = origin; | |
246 } | |
247 | |
243 // Returns the associated WebUI or null if none applies. | 248 // Returns the associated WebUI or null if none applies. |
244 WebUIImpl* web_ui() const { return web_ui_.get(); } | 249 WebUIImpl* web_ui() const { return web_ui_.get(); } |
245 | 250 |
246 // Returns the pending WebUI, or null if none applies. | 251 // Returns the pending WebUI, or null if none applies. |
247 WebUIImpl* pending_web_ui() const { | 252 WebUIImpl* pending_web_ui() const { |
248 return should_reuse_web_ui_ ? web_ui_.get() : pending_web_ui_.get(); | 253 return should_reuse_web_ui_ ? web_ui_.get() : pending_web_ui_.get(); |
249 } | 254 } |
250 | 255 |
251 // Returns this RenderFrameHost's loading state. This method is only used by | 256 // Returns this RenderFrameHost's loading state. This method is only used by |
252 // FrameTreeNode. The proper way to check whether a frame is loading is to | 257 // FrameTreeNode. The proper way to check whether a frame is loading is to |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
600 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, | 605 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
601 RestoreFileAccessForHistoryNavigation); | 606 RestoreFileAccessForHistoryNavigation); |
602 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, | 607 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
603 RestoreSubframeFileAccessForHistoryNavigation); | 608 RestoreSubframeFileAccessForHistoryNavigation); |
604 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, | 609 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
605 RenderViewInitAfterNewProxyAndProcessKill); | 610 RenderViewInitAfterNewProxyAndProcessKill); |
606 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, | 611 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
607 UnloadPushStateOnCrossProcessNavigation); | 612 UnloadPushStateOnCrossProcessNavigation); |
608 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, | 613 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
609 WebUIJavascriptDisallowedAfterSwapOut); | 614 WebUIJavascriptDisallowedAfterSwapOut); |
615 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, LastCommittedOrigin); | |
610 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrashSubframe); | 616 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrashSubframe); |
611 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 617 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
612 RenderViewHostIsNotReusedAfterDelayedSwapOutACK); | 618 RenderViewHostIsNotReusedAfterDelayedSwapOutACK); |
613 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 619 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
614 LoadEventForwardingWhilePendingDeletion); | 620 LoadEventForwardingWhilePendingDeletion); |
615 | 621 |
616 // IPC Message handlers. | 622 // IPC Message handlers. |
617 void OnDidAddMessageToConsole(int32_t level, | 623 void OnDidAddMessageToConsole(int32_t level, |
618 const base::string16& message, | 624 const base::string16& message, |
619 int32_t line_no, | 625 int32_t line_no, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
871 | 877 |
872 // The active parent RenderFrameHost for this frame, if it is a subframe. | 878 // The active parent RenderFrameHost for this frame, if it is a subframe. |
873 // Null for the main frame. This is cached because the parent FrameTreeNode | 879 // Null for the main frame. This is cached because the parent FrameTreeNode |
874 // may change its current RenderFrameHost while this child is pending | 880 // may change its current RenderFrameHost while this child is pending |
875 // deletion, and GetParent() should never return a different value. | 881 // deletion, and GetParent() should never return a different value. |
876 RenderFrameHostImpl* parent_; | 882 RenderFrameHostImpl* parent_; |
877 | 883 |
878 // Track this frame's last committed URL. | 884 // Track this frame's last committed URL. |
879 GURL last_committed_url_; | 885 GURL last_committed_url_; |
880 | 886 |
887 // Track this frame's last committed origin. | |
888 url::Origin last_committed_origin_; | |
889 | |
881 // The most recent non-error URL to commit in this frame. Remove this in | 890 // The most recent non-error URL to commit in this frame. Remove this in |
882 // favor of GetLastCommittedURL() once PlzNavigate is enabled or cross-process | 891 // favor of GetLastCommittedURL() once PlzNavigate is enabled or cross-process |
883 // transfers work for net errors. See https://crbug.com/588314. | 892 // transfers work for net errors. See https://crbug.com/588314. |
884 GURL last_successful_url_; | 893 GURL last_successful_url_; |
885 | 894 |
886 // The mapping of pending JavaScript calls created by | 895 // The mapping of pending JavaScript calls created by |
887 // ExecuteJavaScript and their corresponding callbacks. | 896 // ExecuteJavaScript and their corresponding callbacks. |
888 std::map<int, JavaScriptResultCallback> javascript_callbacks_; | 897 std::map<int, JavaScriptResultCallback> javascript_callbacks_; |
889 std::map<uint64_t, VisualStateCallback> visual_state_callbacks_; | 898 std::map<uint64_t, VisualStateCallback> visual_state_callbacks_; |
890 | 899 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1081 remote_associated_interfaces_; | 1090 remote_associated_interfaces_; |
1082 // NOTE: This must be the last member. | 1091 // NOTE: This must be the last member. |
1083 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1092 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
1084 | 1093 |
1085 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1094 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
1086 }; | 1095 }; |
1087 | 1096 |
1088 } // namespace content | 1097 } // namespace content |
1089 | 1098 |
1090 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1099 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |