| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 // The timeout monitor that runs from when the page close is started in |
| 322 // ClosePage() until either the render process ACKs the close with an IPC to |
| 323 // OnClosePageACK(), or until the timeout triggers and the page is forcibly |
| 324 // closed. |
| 325 std::unique_ptr<TimeoutMonitor> close_timeout_; |
| 326 |
| 315 bool updating_web_preferences_; | 327 bool updating_web_preferences_; |
| 316 | 328 |
| 317 bool render_view_ready_on_process_launch_; | 329 bool render_view_ready_on_process_launch_; |
| 318 | 330 |
| 319 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; | 331 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; |
| 320 | 332 |
| 321 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 333 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
| 322 }; | 334 }; |
| 323 | 335 |
| 324 } // namespace content | 336 } // namespace content |
| 325 | 337 |
| 326 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 338 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |