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 <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // The RenderFrameHost will have a new RenderWidgetHost created and | 87 // The RenderFrameHost will have a new RenderWidgetHost created and |
88 // attached to it. This is used when the RenderFrameHost is in a different | 88 // attached to it. This is used when the RenderFrameHost is in a different |
89 // process from its parent frame. | 89 // process from its parent frame. |
90 CREATE_RF_NEEDS_RENDER_WIDGET_HOST = 1 << 3 | 90 CREATE_RF_NEEDS_RENDER_WIDGET_HOST = 1 << 3 |
91 }; | 91 }; |
92 | 92 |
93 class CONTENT_EXPORT RenderFrameHostImpl | 93 class CONTENT_EXPORT RenderFrameHostImpl |
94 : public RenderFrameHost, | 94 : public RenderFrameHost, |
95 public BrowserAccessibilityDelegate { | 95 public BrowserAccessibilityDelegate { |
96 public: | 96 public: |
| 97 // These values indicate the loading progress status. The minimum progress |
| 98 // value matches what Blink's ProgressTracker has traditionally used for a |
| 99 // minimum progress value. |
| 100 static const double kLoadingProgressNotStarted; |
| 101 static const double kLoadingProgressMinimum; |
| 102 static const double kLoadingProgressDone; |
| 103 |
97 // Keeps track of the state of the RenderFrameHostImpl, particularly with | 104 // Keeps track of the state of the RenderFrameHostImpl, particularly with |
98 // respect to swap out. | 105 // respect to swap out. |
99 enum RenderFrameHostImplState { | 106 enum RenderFrameHostImplState { |
100 // The standard state for a RFH handling the communication with an active | 107 // The standard state for a RFH handling the communication with an active |
101 // RenderFrame. | 108 // RenderFrame. |
102 STATE_DEFAULT = 0, | 109 STATE_DEFAULT = 0, |
103 // The RFH has not received the SwapOutACK yet, but the new page has | 110 // The RFH has not received the SwapOutACK yet, but the new page has |
104 // committed in a different RFH. Upon reception of the SwapOutACK, the RFH | 111 // committed in a different RFH. Upon reception of the SwapOutACK, the RFH |
105 // will either enter STATE_SWAPPED_OUT (if it is a main frame and there are | 112 // will either enter STATE_SWAPPED_OUT (if it is a main frame and there are |
106 // other active frames in its SiteInstance) or it will be deleted. | 113 // other active frames in its SiteInstance) or it will be deleted. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 203 |
197 int routing_id() const { return routing_id_; } | 204 int routing_id() const { return routing_id_; } |
198 void OnCreateChildFrame(int new_routing_id, | 205 void OnCreateChildFrame(int new_routing_id, |
199 const std::string& frame_name, | 206 const std::string& frame_name, |
200 SandboxFlags sandbox_flags); | 207 SandboxFlags sandbox_flags); |
201 | 208 |
202 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 209 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
203 RenderFrameHostDelegate* delegate() { return delegate_; } | 210 RenderFrameHostDelegate* delegate() { return delegate_; } |
204 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } | 211 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
205 | 212 |
| 213 void set_is_loading(bool is_loading) { |
| 214 is_loading_ = is_loading; |
| 215 } |
| 216 bool is_loading() const { return is_loading_; } |
| 217 |
| 218 void set_loading_progress(double loading_progress) { |
| 219 loading_progress_ = loading_progress; |
| 220 } |
| 221 double loading_progress() const { return loading_progress_; } |
| 222 |
206 // This returns the RenderFrameHost's owned RenderWidgetHost if it has one, | 223 // This returns the RenderFrameHost's owned RenderWidgetHost if it has one, |
207 // or else it returns nullptr. | 224 // or else it returns nullptr. |
208 // If the RenderFrameHost is the page's main frame, this returns instead a | 225 // If the RenderFrameHost is the page's main frame, this returns instead a |
209 // pointer to the RenderViewHost (which inherits RenderWidgetHost). | 226 // pointer to the RenderViewHost (which inherits RenderWidgetHost). |
210 RenderWidgetHostImpl* GetRenderWidgetHost(); | 227 RenderWidgetHostImpl* GetRenderWidgetHost(); |
211 | 228 |
212 // This returns the RenderWidgetHostView that can be used to control | 229 // This returns the RenderWidgetHostView that can be used to control |
213 // focus and visibility for this frame. | 230 // focus and visibility for this frame. |
214 RenderWidgetHostView* GetView(); | 231 RenderWidgetHostView* GetView(); |
215 | 232 |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 bool is_waiting_for_beforeunload_ack_; | 673 bool is_waiting_for_beforeunload_ack_; |
657 | 674 |
658 // Valid only when is_waiting_for_beforeunload_ack_ or | 675 // Valid only when is_waiting_for_beforeunload_ack_ or |
659 // IsWaitingForUnloadACK is true. This tells us if the unload request | 676 // IsWaitingForUnloadACK is true. This tells us if the unload request |
660 // is for closing the entire tab ( = false), or only this RenderFrameHost in | 677 // is for closing the entire tab ( = false), or only this RenderFrameHost in |
661 // the case of a navigation ( = true). Currently only cross-site navigations | 678 // the case of a navigation ( = true). Currently only cross-site navigations |
662 // require a beforeUnload/unload ACK. | 679 // require a beforeUnload/unload ACK. |
663 // PlzNavigate: all navigations require a beforeUnload ACK. | 680 // PlzNavigate: all navigations require a beforeUnload ACK. |
664 bool unload_ack_is_for_navigation_; | 681 bool unload_ack_is_for_navigation_; |
665 | 682 |
| 683 // Boolean value indicating whether this RFH in the process of loading a |
| 684 // document or not. |
| 685 bool is_loading_; |
| 686 |
| 687 // Double value representing this RFH's loading progress (from 0 to 1). |
| 688 double loading_progress_; |
| 689 |
666 // Used to swap out or shut down this RFH when the unload event is taking too | 690 // Used to swap out or shut down this RFH when the unload event is taking too |
667 // long to execute, depending on the number of active frames in the | 691 // long to execute, depending on the number of active frames in the |
668 // SiteInstance. | 692 // SiteInstance. |
669 scoped_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; | 693 scoped_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; |
670 | 694 |
671 scoped_ptr<ServiceRegistryImpl> service_registry_; | 695 scoped_ptr<ServiceRegistryImpl> service_registry_; |
672 | 696 |
673 #if defined(OS_ANDROID) | 697 #if defined(OS_ANDROID) |
674 scoped_ptr<ServiceRegistryAndroid> service_registry_android_; | 698 scoped_ptr<ServiceRegistryAndroid> service_registry_android_; |
675 #endif | 699 #endif |
(...skipping 27 matching lines...) Expand all Loading... |
703 | 727 |
704 // NOTE: This must be the last member. | 728 // NOTE: This must be the last member. |
705 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 729 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
706 | 730 |
707 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 731 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
708 }; | 732 }; |
709 | 733 |
710 } // namespace content | 734 } // namespace content |
711 | 735 |
712 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 736 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |