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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.h

Issue 2725993002: Move page closing hang timer duties to its own timer. (Closed)
Patch Set: comment excision 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
OLDNEW
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_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 18 matching lines...) Expand all
29 #include "net/base/load_states.h" 29 #include "net/base/load_states.h"
30 #include "third_party/WebKit/public/web/WebAXEnums.h" 30 #include "third_party/WebKit/public/web/WebAXEnums.h"
31 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 31 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
32 #include "third_party/WebKit/public/web/WebPopupType.h" 32 #include "third_party/WebKit/public/web/WebPopupType.h"
33 #include "third_party/skia/include/core/SkColor.h" 33 #include "third_party/skia/include/core/SkColor.h"
34 #include "ui/base/mojo/window_open_disposition.mojom.h" 34 #include "ui/base/mojo/window_open_disposition.mojom.h"
35 35
36 namespace content { 36 namespace content {
37 37
38 struct FrameReplicationState; 38 struct FrameReplicationState;
39 class TimeoutMonitor;
39 40
40 // This implements the RenderViewHost interface that is exposed to 41 // This implements the RenderViewHost interface that is exposed to
41 // embedders of content, and adds things only visible to content. 42 // embedders of content, and adds things only visible to content.
42 // 43 //
43 // The exact API of this object needs to be more thoroughly designed. Right 44 // The exact API of this object needs to be more thoroughly designed. Right
44 // now it mimics what WebContentsImpl exposed, which is a fairly large API and 45 // now it mimics what WebContentsImpl exposed, which is a fairly large API and
45 // may contain things that are not relevant to a common subset of views. See 46 // may contain things that are not relevant to a common subset of views. See
46 // also the comment in render_view_host_delegate.h about the size and scope of 47 // also the comment in render_view_host_delegate.h about the size and scope of
47 // the delegate API. 48 // the delegate API.
48 // 49 //
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 private: 246 private:
246 // TODO(nasko): Temporarily friend RenderFrameHostImpl, so we don't duplicate 247 // TODO(nasko): Temporarily friend RenderFrameHostImpl, so we don't duplicate
247 // utility functions and state needed in both classes, while we move frame 248 // utility functions and state needed in both classes, while we move frame
248 // specific code away from this class. 249 // specific code away from this class.
249 friend class RenderFrameHostImpl; 250 friend class RenderFrameHostImpl;
250 friend class TestRenderViewHost; 251 friend class TestRenderViewHost;
251 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost); 252 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost);
252 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane); 253 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane);
253 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, 254 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest,
254 CleanUpSwappedOutRVHOnProcessCrash); 255 CleanUpSwappedOutRVHOnProcessCrash);
256 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest,
257 CloseWithPendingWhileUnresponsive);
255 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, 258 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
256 NavigateMainFrameToChildSite); 259 NavigateMainFrameToChildSite);
257 260
258 void RenderViewReady(); 261 void RenderViewReady();
259 262
263 // Called by |close_timeout_| when the page closing timeout fires.
264 void ClosePageTimeout();
265
260 // TODO(creis): Move to a private namespace on RenderFrameHostImpl. 266 // TODO(creis): Move to a private namespace on RenderFrameHostImpl.
261 // Delay to wait on closing the WebContents for a beforeunload/unload handler 267 // Delay to wait on closing the WebContents for a beforeunload/unload handler
262 // to fire. 268 // to fire.
263 static const int64_t kUnloadTimeoutMS; 269 static const int64_t kUnloadTimeoutMS;
264 270
265 // Returns the content specific prefs for this RenderViewHost. 271 // Returns the content specific prefs for this RenderViewHost.
266 // TODO(creis): Move most of this method to RenderProcessHost, since it's 272 // TODO(creis): Move most of this method to RenderProcessHost, since it's
267 // mostly the same across all RVHs in a process. Move the rest to RFH. 273 // mostly the same across all RVHs in a process. Move the rest to RFH.
268 // See https://crbug.com/304341. 274 // See https://crbug.com/304341.
269 WebPreferences ComputeWebkitPrefs(); 275 WebPreferences ComputeWebkitPrefs();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 bool sudden_termination_allowed_; 311 bool sudden_termination_allowed_;
306 312
307 // The termination status of the last render view that terminated. 313 // The termination status of the last render view that terminated.
308 base::TerminationStatus render_view_termination_status_; 314 base::TerminationStatus render_view_termination_status_;
309 315
310 // This is updated every time UpdateWebkitPreferences is called. That method 316 // This is updated every time UpdateWebkitPreferences is called. That method
311 // is in turn called when any of the settings change that the WebPreferences 317 // is in turn called when any of the settings change that the WebPreferences
312 // values depend on. 318 // values depend on.
313 std::unique_ptr<WebPreferences> web_preferences_; 319 std::unique_ptr<WebPreferences> web_preferences_;
314 320
321 std::unique_ptr<TimeoutMonitor> close_timeout_;
Charlie Reis 2017/03/03 01:06:00 nit: Let's add a comment about when this is used (
Avi (use Gerrit) 2017/03/03 01:25:25 Done.
322
315 bool updating_web_preferences_; 323 bool updating_web_preferences_;
316 324
317 bool render_view_ready_on_process_launch_; 325 bool render_view_ready_on_process_launch_;
318 326
319 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; 327 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_;
320 328
321 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); 329 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl);
322 }; 330 };
323 331
324 } // namespace content 332 } // namespace content
325 333
326 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 334 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698