Chromium Code Reviews| 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 // TODO(fdegans): Move these values to the implementation when the relevant | |
| 101 // IPCs are moved from WebContentsImpl to RFHI. | |
| 102 static const double kLoadingProgressNotStarted; | |
| 103 static const double kLoadingProgressMinimum; | |
| 104 static const double kLoadingProgressDone; | |
| 105 | |
| 97 // Keeps track of the state of the RenderFrameHostImpl, particularly with | 106 // Keeps track of the state of the RenderFrameHostImpl, particularly with |
| 98 // respect to swap out. | 107 // respect to swap out. |
| 99 enum RenderFrameHostImplState { | 108 enum RenderFrameHostImplState { |
| 100 // The standard state for a RFH handling the communication with an active | 109 // The standard state for a RFH handling the communication with an active |
| 101 // RenderFrame. | 110 // RenderFrame. |
| 102 STATE_DEFAULT = 0, | 111 STATE_DEFAULT = 0, |
| 103 // The RFH has not received the SwapOutACK yet, but the new page has | 112 // 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 | 113 // 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 | 114 // 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. | 115 // 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 | 205 |
| 197 int routing_id() const { return routing_id_; } | 206 int routing_id() const { return routing_id_; } |
| 198 void OnCreateChildFrame(int new_routing_id, | 207 void OnCreateChildFrame(int new_routing_id, |
| 199 const std::string& frame_name, | 208 const std::string& frame_name, |
| 200 SandboxFlags sandbox_flags); | 209 SandboxFlags sandbox_flags); |
| 201 | 210 |
| 202 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 211 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
| 203 RenderFrameHostDelegate* delegate() { return delegate_; } | 212 RenderFrameHostDelegate* delegate() { return delegate_; } |
| 204 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } | 213 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
| 205 | 214 |
| 215 void set_is_loading(bool is_loading) { | |
|
Charlie Reis
2015/03/03 06:32:22
Please document these, since it's unclear whether
Fabrice (no longer in Chrome)
2015/03/03 13:12:17
Done.
I clarified the loading progress too.
| |
| 216 is_loading_ = is_loading; | |
| 217 } | |
| 218 bool is_loading() const { return is_loading_; } | |
| 219 | |
| 220 void set_loading_progress(double loading_progress) { | |
| 221 loading_progress_ = loading_progress; | |
| 222 } | |
| 223 double loading_progress() const { return loading_progress_; } | |
| 224 | |
| 206 // This returns the RenderFrameHost's owned RenderWidgetHost if it has one, | 225 // This returns the RenderFrameHost's owned RenderWidgetHost if it has one, |
| 207 // or else it returns nullptr. | 226 // or else it returns nullptr. |
| 208 // If the RenderFrameHost is the page's main frame, this returns instead a | 227 // If the RenderFrameHost is the page's main frame, this returns instead a |
| 209 // pointer to the RenderViewHost (which inherits RenderWidgetHost). | 228 // pointer to the RenderViewHost (which inherits RenderWidgetHost). |
| 210 RenderWidgetHostImpl* GetRenderWidgetHost(); | 229 RenderWidgetHostImpl* GetRenderWidgetHost(); |
| 211 | 230 |
| 212 // This returns the RenderWidgetHostView that can be used to control | 231 // This returns the RenderWidgetHostView that can be used to control |
| 213 // focus and visibility for this frame. | 232 // focus and visibility for this frame. |
| 214 RenderWidgetHostView* GetView(); | 233 RenderWidgetHostView* GetView(); |
| 215 | 234 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 657 bool is_waiting_for_beforeunload_ack_; | 676 bool is_waiting_for_beforeunload_ack_; |
| 658 | 677 |
| 659 // Valid only when is_waiting_for_beforeunload_ack_ or | 678 // Valid only when is_waiting_for_beforeunload_ack_ or |
| 660 // IsWaitingForUnloadACK is true. This tells us if the unload request | 679 // IsWaitingForUnloadACK is true. This tells us if the unload request |
| 661 // is for closing the entire tab ( = false), or only this RenderFrameHost in | 680 // is for closing the entire tab ( = false), or only this RenderFrameHost in |
| 662 // the case of a navigation ( = true). Currently only cross-site navigations | 681 // the case of a navigation ( = true). Currently only cross-site navigations |
| 663 // require a beforeUnload/unload ACK. | 682 // require a beforeUnload/unload ACK. |
| 664 // PlzNavigate: all navigations require a beforeUnload ACK. | 683 // PlzNavigate: all navigations require a beforeUnload ACK. |
| 665 bool unload_ack_is_for_navigation_; | 684 bool unload_ack_is_for_navigation_; |
| 666 | 685 |
| 686 // Indicates whether this RenderFrameHost is in the process of loading a | |
| 687 // document or not. | |
| 688 bool is_loading_; | |
| 689 | |
| 690 // Used to represent this RenderFrameHost loading progress (from 0 to 1). | |
| 691 double loading_progress_; | |
| 692 | |
| 667 // Used to swap out or shut down this RFH when the unload event is taking too | 693 // Used to swap out or shut down this RFH when the unload event is taking too |
| 668 // long to execute, depending on the number of active frames in the | 694 // long to execute, depending on the number of active frames in the |
| 669 // SiteInstance. | 695 // SiteInstance. |
| 670 scoped_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; | 696 scoped_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; |
| 671 | 697 |
| 672 scoped_ptr<ServiceRegistryImpl> service_registry_; | 698 scoped_ptr<ServiceRegistryImpl> service_registry_; |
| 673 | 699 |
| 674 #if defined(OS_ANDROID) | 700 #if defined(OS_ANDROID) |
| 675 scoped_ptr<ServiceRegistryAndroid> service_registry_android_; | 701 scoped_ptr<ServiceRegistryAndroid> service_registry_android_; |
| 676 #endif | 702 #endif |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 704 | 730 |
| 705 // NOTE: This must be the last member. | 731 // NOTE: This must be the last member. |
| 706 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 732 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 707 | 733 |
| 708 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 734 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 709 }; | 735 }; |
| 710 | 736 |
| 711 } // namespace content | 737 } // namespace content |
| 712 | 738 |
| 713 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 739 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |