Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2727253005: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: timeout values Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 #include "content/common/ax_content_node_data.h" 31 #include "content/common/ax_content_node_data.h"
32 #include "content/common/content_export.h" 32 #include "content/common/content_export.h"
33 #include "content/common/content_security_policy/content_security_policy.h" 33 #include "content/common/content_security_policy/content_security_policy.h"
34 #include "content/common/download/mhtml_save_status.h" 34 #include "content/common/download/mhtml_save_status.h"
35 #include "content/common/frame.mojom.h" 35 #include "content/common/frame.mojom.h"
36 #include "content/common/frame_message_enums.h" 36 #include "content/common/frame_message_enums.h"
37 #include "content/common/frame_replication_state.h" 37 #include "content/common/frame_replication_state.h"
38 #include "content/common/image_downloader/image_downloader.mojom.h" 38 #include "content/common/image_downloader/image_downloader.mojom.h"
39 #include "content/common/navigation_params.h" 39 #include "content/common/navigation_params.h"
40 #include "content/public/browser/render_frame_host.h" 40 #include "content/public/browser/render_frame_host.h"
41 #include "content/public/browser/renderer_unresponsive_type.h"
41 #include "content/public/common/javascript_dialog_type.h" 42 #include "content/public/common/javascript_dialog_type.h"
42 #include "content/public/common/previews_state.h" 43 #include "content/public/common/previews_state.h"
43 #include "media/mojo/interfaces/interface_factory.mojom.h" 44 #include "media/mojo/interfaces/interface_factory.mojom.h"
44 #include "net/http/http_response_headers.h" 45 #include "net/http/http_response_headers.h"
45 #include "services/service_manager/public/cpp/interface_factory.h" 46 #include "services/service_manager/public/cpp/interface_factory.h"
46 #include "services/service_manager/public/cpp/interface_registry.h" 47 #include "services/service_manager/public/cpp/interface_registry.h"
47 #include "third_party/WebKit/public/platform/WebFocusType.h" 48 #include "third_party/WebKit/public/platform/WebFocusType.h"
48 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" 49 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h"
49 #include "third_party/WebKit/public/web/WebTextDirection.h" 50 #include "third_party/WebKit/public/web/WebTextDirection.h"
50 #include "third_party/WebKit/public/web/WebTreeScopeType.h" 51 #include "third_party/WebKit/public/web/WebTreeScopeType.h"
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 873
873 void SendJavaScriptDialogReply(IPC::Message* reply_msg, 874 void SendJavaScriptDialogReply(IPC::Message* reply_msg,
874 bool success, 875 bool success,
875 const base::string16& user_input); 876 const base::string16& user_input);
876 877
877 // Returns ownership of the NavigationHandle associated with a navigation that 878 // Returns ownership of the NavigationHandle associated with a navigation that
878 // just committed. 879 // just committed.
879 std::unique_ptr<NavigationHandleImpl> TakeNavigationHandleForCommit( 880 std::unique_ptr<NavigationHandleImpl> TakeNavigationHandleForCommit(
880 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); 881 const FrameHostMsg_DidCommitProvisionalLoad_Params& params);
881 882
883 // Called by |beforeunload_timeout_| when the beforeunload timeout fires.
884 void BeforeUnloadTimeout();
885
882 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a 886 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
883 // refcount that calls Shutdown when it reaches zero. This allows each 887 // refcount that calls Shutdown when it reaches zero. This allows each
884 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring 888 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
885 // we have a RenderViewHost for each RenderFrameHost. 889 // we have a RenderViewHost for each RenderFrameHost.
886 // TODO(creis): RenderViewHost will eventually go away and be replaced with 890 // TODO(creis): RenderViewHost will eventually go away and be replaced with
887 // some form of page context. 891 // some form of page context.
888 RenderViewHostImpl* render_view_host_; 892 RenderViewHostImpl* render_view_host_;
889 893
890 RenderFrameHostDelegate* delegate_; 894 RenderFrameHostDelegate* delegate_;
891 895
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 bool is_waiting_for_beforeunload_ack_; 980 bool is_waiting_for_beforeunload_ack_;
977 981
978 // Valid only when is_waiting_for_beforeunload_ack_ or 982 // Valid only when is_waiting_for_beforeunload_ack_ or
979 // IsWaitingForUnloadACK is true. This tells us if the unload request 983 // IsWaitingForUnloadACK is true. This tells us if the unload request
980 // is for closing the entire tab ( = false), or only this RenderFrameHost in 984 // is for closing the entire tab ( = false), or only this RenderFrameHost in
981 // the case of a navigation ( = true). Currently only cross-site navigations 985 // the case of a navigation ( = true). Currently only cross-site navigations
982 // require a beforeUnload/unload ACK. 986 // require a beforeUnload/unload ACK.
983 // PlzNavigate: all navigations require a beforeUnload ACK. 987 // PlzNavigate: all navigations require a beforeUnload ACK.
984 bool unload_ack_is_for_navigation_; 988 bool unload_ack_is_for_navigation_;
985 989
990 // The timeout monitor that runs from when the beforeunload is started in
991 // DispatchBeforeUnload() until either the render process ACKs it with an IPC
992 // to OnBeforeUnloadACK(), or until the timeout triggers.
993 std::unique_ptr<TimeoutMonitor> beforeunload_timeout_;
994
995 // If beforeunload_timeout_ is active, the type of the timeout.
996 RendererUnresponsiveType beforeunload_timeout_type_;
997
986 // Indicates whether this RenderFrameHost is in the process of loading a 998 // Indicates whether this RenderFrameHost is in the process of loading a
987 // document or not. 999 // document or not.
988 bool is_loading_; 1000 bool is_loading_;
989 1001
990 // PlzNavigate 1002 // PlzNavigate
991 // Used to track whether a commit is expected in this frame. Only used in 1003 // Used to track whether a commit is expected in this frame. Only used in
992 // tests. 1004 // tests.
993 bool pending_commit_; 1005 bool pending_commit_;
994 1006
995 // The unique ID of the latest NavigationEntry that this RenderFrameHost is 1007 // The unique ID of the latest NavigationEntry that this RenderFrameHost is
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 1141
1130 // NOTE: This must be the last member. 1142 // NOTE: This must be the last member.
1131 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 1143 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
1132 1144
1133 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 1145 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
1134 }; 1146 };
1135 1147
1136 } // namespace content 1148 } // namespace content
1137 1149
1138 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 1150 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698