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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
16 #include "content/browser/renderer_host/render_widget_host_impl.h" | 17 #include "content/browser/renderer_host/render_widget_host_impl.h" |
17 #include "content/browser/site_instance_impl.h" | 18 #include "content/browser/site_instance_impl.h" |
18 #include "content/common/drag_event_source_info.h" | 19 #include "content/common/drag_event_source_info.h" |
19 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
21 #include "content/public/common/javascript_message_type.h" | 22 #include "content/public/common/javascript_message_type.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 | 58 |
58 namespace content { | 59 namespace content { |
59 | 60 |
60 class BrowserMediaPlayerManager; | 61 class BrowserMediaPlayerManager; |
61 class ChildProcessSecurityPolicyImpl; | 62 class ChildProcessSecurityPolicyImpl; |
62 class PageState; | 63 class PageState; |
63 class RenderWidgetHostDelegate; | 64 class RenderWidgetHostDelegate; |
64 class SessionStorageNamespace; | 65 class SessionStorageNamespace; |
65 class SessionStorageNamespaceImpl; | 66 class SessionStorageNamespaceImpl; |
66 class TestRenderViewHost; | 67 class TestRenderViewHost; |
68 class TimeoutMonitor; | |
67 struct ContextMenuParams; | 69 struct ContextMenuParams; |
68 struct FileChooserParams; | 70 struct FileChooserParams; |
69 struct Referrer; | 71 struct Referrer; |
70 struct ShowDesktopNotificationHostMsgParams; | 72 struct ShowDesktopNotificationHostMsgParams; |
71 | 73 |
72 #if defined(COMPILER_MSVC) | 74 #if defined(COMPILER_MSVC) |
73 // RenderViewHostImpl is the bottom of a diamond-shaped hierarchy, | 75 // RenderViewHostImpl is the bottom of a diamond-shaped hierarchy, |
74 // with RenderWidgetHost at the root. VS warns when methods from the | 76 // with RenderWidgetHost at the root. VS warns when methods from the |
75 // root are overridden in only one of the base classes and not both | 77 // root are overridden in only one of the base classes and not both |
76 // (in this case, RenderWidgetHostImpl provides implementations of | 78 // (in this case, RenderWidgetHostImpl provides implementations of |
(...skipping 15 matching lines...) Expand all Loading... | |
92 // | 94 // |
93 // Right now, the concept of page navigation (both top level and frame) exists | 95 // Right now, the concept of page navigation (both top level and frame) exists |
94 // in the WebContentsImpl still, so if you instantiate one of these elsewhere, | 96 // in the WebContentsImpl still, so if you instantiate one of these elsewhere, |
95 // you will not be able to traverse pages back and forward. We need to determine | 97 // you will not be able to traverse pages back and forward. We need to determine |
96 // if we want to bring that and other functionality down into this object so it | 98 // if we want to bring that and other functionality down into this object so it |
97 // can be shared by others. | 99 // can be shared by others. |
98 class CONTENT_EXPORT RenderViewHostImpl | 100 class CONTENT_EXPORT RenderViewHostImpl |
99 : public RenderViewHost, | 101 : public RenderViewHost, |
100 public RenderWidgetHostImpl { | 102 public RenderWidgetHostImpl { |
101 public: | 103 public: |
104 // Keeps track of the state of the RenderViewHostImpl, more particularly | |
Charlie Reis
2014/01/31 19:11:55
nit: more particularly during -> particularly with
clamy
2014/02/05 14:21:42
Done.
| |
105 // during swap out. | |
106 enum RenderViewHostImplState { | |
107 // The standard state for a RVH handling the communication with a | |
108 // RenderView. | |
109 STATE_LIVE = 0, | |
Charlie Reis
2014/01/31 19:11:55
This name is a bit confusing, since we'll be in th
clamy
2014/02/05 14:21:42
Done.
| |
110 // The RVH has sent the SwapOut request to the renderer, but has not | |
111 // received the SwapOutACK yet. The new page has not been committed yet | |
112 // either. | |
113 STATE_WAITING_FOR_UNLOAD_ACK, | |
114 // The RVH received the SwapOutACK from the RenderView, but the new page has | |
115 // not been committed yet. | |
116 STATE_WAITING_FOR_COMMIT, | |
117 // The RVH is waiting for the CloseACK from the RenderView. | |
118 STATE_WAITING_FOR_CLOSE, | |
119 // The RVH has not received the SwapOutACK yet, but the new page has | |
120 // committed. The number of active views of the RVH SiteInstanceImpl is not | |
Charlie Reis
2014/01/31 19:11:55
new page has committed in a different RVH.
clamy
2014/02/05 14:21:42
Done.
| |
121 // zero. Upon reception of the SwapOutACK, the RVH will be swapped out. | |
122 STATE_PENDING_SWAP_OUT, | |
123 // The RVH has not received the SwapOutACK yet, but the new page has | |
124 // committed. The number of active views of the RVH SiteInstanceImpl is | |
Charlie Reis
2014/01/31 19:11:55
new page has committed in a different RVH.
clamy
2014/02/05 14:21:42
Done.
| |
125 // zero. Upon reception of the SwapOutACK, the RVH will be shutdown. | |
126 STATE_PENDING_SHUTDOWN, | |
127 // The RVH is swapped out, it is being used as a placeholder to allow for | |
Charlie Reis
2014/01/31 19:11:55
nit: swapped out, and it is
clamy
2014/02/05 14:21:42
Done.
| |
128 // cross-process communication. | |
129 STATE_SWAPPED_OUT, | |
130 }; | |
131 // Helper function to determine whether the RVH state should contribute to the | |
132 // number of active views of a SiteInstance or not. | |
133 static bool IsRVHStateActive(RenderViewHostImplState rvh_state); | |
134 | |
102 // Convenience function, just like RenderViewHost::FromID. | 135 // Convenience function, just like RenderViewHost::FromID. |
103 static RenderViewHostImpl* FromID(int render_process_id, int render_view_id); | 136 static RenderViewHostImpl* FromID(int render_process_id, int render_view_id); |
104 | 137 |
105 // |routing_id| could be a valid route id, or it could be MSG_ROUTING_NONE, in | 138 // |routing_id| could be a valid route id, or it could be MSG_ROUTING_NONE, in |
106 // which case RenderWidgetHost will create a new one. |swapped_out| indicates | 139 // which case RenderWidgetHost will create a new one. |swapped_out| indicates |
107 // whether the view should initially be swapped out (e.g., for an opener | 140 // whether the view should initially be swapped out (e.g., for an opener |
108 // frame being rendered by another process). |hidden| indicates whether the | 141 // frame being rendered by another process). |hidden| indicates whether the |
109 // view is initially hidden or visible. | 142 // view is initially hidden or visible. |
110 // | 143 // |
111 // The |session_storage_namespace| parameter allows multiple render views and | 144 // The |session_storage_namespace| parameter allows multiple render views and |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 | 310 |
278 // Whether the initial empty page of this view has been accessed by another | 311 // Whether the initial empty page of this view has been accessed by another |
279 // page, making it unsafe to show the pending URL. Always false after the | 312 // page, making it unsafe to show the pending URL. Always false after the |
280 // first commit. | 313 // first commit. |
281 bool has_accessed_initial_document() { | 314 bool has_accessed_initial_document() { |
282 return has_accessed_initial_document_; | 315 return has_accessed_initial_document_; |
283 } | 316 } |
284 | 317 |
285 // Whether this RenderViewHost has been swapped out to be displayed by a | 318 // Whether this RenderViewHost has been swapped out to be displayed by a |
286 // different process. | 319 // different process. |
287 bool is_swapped_out() const { return is_swapped_out_; } | 320 bool IsSwappedOut() const { return rvh_state_ == STATE_SWAPPED_OUT; } |
321 | |
322 // The current state of this RVH. | |
323 RenderViewHostImplState rvh_state() const { return rvh_state_; } | |
288 | 324 |
289 // Called on the pending RenderViewHost when the network response is ready to | 325 // Called on the pending RenderViewHost when the network response is ready to |
290 // commit. We should ensure that the old RenderViewHost runs its unload | 326 // commit. We should ensure that the old RenderViewHost runs its unload |
291 // handler and determine whether a transfer to a different RenderViewHost is | 327 // handler and determine whether a transfer to a different RenderViewHost is |
292 // needed. | 328 // needed. |
293 void OnCrossSiteResponse( | 329 void OnCrossSiteResponse( |
294 const GlobalRequestID& global_request_id, | 330 const GlobalRequestID& global_request_id, |
295 bool is_transfer, | 331 bool is_transfer, |
296 const std::vector<GURL>& transfer_url_chain, | 332 const std::vector<GURL>& transfer_url_chain, |
297 const Referrer& referrer, | 333 const Referrer& referrer, |
(...skipping 12 matching lines...) Expand all Loading... | |
310 // a blank document. The renderer should preserve the Frame object until it | 346 // a blank document. The renderer should preserve the Frame object until it |
311 // exits, in case we come back. The renderer can exit if it has no other | 347 // exits, in case we come back. The renderer can exit if it has no other |
312 // active RenderViews, but not until WasSwappedOut is called (when it is no | 348 // active RenderViews, but not until WasSwappedOut is called (when it is no |
313 // longer visible). | 349 // longer visible). |
314 void SwapOut(); | 350 void SwapOut(); |
315 | 351 |
316 // Called when either the SwapOut request has been acknowledged or has timed | 352 // Called when either the SwapOut request has been acknowledged or has timed |
317 // out. | 353 // out. |
318 void OnSwappedOut(bool timed_out); | 354 void OnSwappedOut(bool timed_out); |
319 | 355 |
320 // Called to notify the renderer that it has been visibly swapped out and | 356 // Called when the RenderFrameHostManager has swapped in a new |
321 // replaced by another RenderViewHost, after an earlier call to SwapOut. | 357 // RenderFrameHost. Should |this| RVH switch to the pending shutdown state, |
322 // It is now safe for the process to exit if there are no other active | 358 // |pending_delete_on_swap_out| will be executed upon reception of the |
323 // RenderViews. | 359 // SwapOutACK, or when the unload timer times out. |
324 void WasSwappedOut(); | 360 void WasSwappedOut(const base::Closure& pending_delete_on_swap_out); |
361 | |
362 // Set |this| as pending shutdown. |on_swap_out| will be called | |
363 // when the swap out ack is received, or when the unload timer times out. | |
Charlie Reis
2014/01/31 19:11:55
nit: SwapOutACK
clamy
2014/02/05 14:21:42
Done.
| |
364 void SetPendingShutdown(const base::Closure& on_swap_out); | |
325 | 365 |
326 // Close the page ignoring whether it has unload events registers. | 366 // Close the page ignoring whether it has unload events registers. |
327 // This is called after the beforeunload and unload events have fired | 367 // This is called after the beforeunload and unload events have fired |
328 // and the user has agreed to continue with closing the page. | 368 // and the user has agreed to continue with closing the page. |
329 void ClosePageIgnoringUnloadEvents(); | 369 void ClosePageIgnoringUnloadEvents(); |
330 | 370 |
331 // Returns whether this RenderViewHost has an outstanding cross-site request. | 371 // Returns whether this RenderViewHost has an outstanding cross-site request. |
332 // Cleared when we hear the response and start to swap out the old | 372 // Cleared when we hear the response and start to swap out the old |
333 // RenderViewHost, or if we hear a commit here without a network request. | 373 // RenderViewHost, or if we hear a commit here without a network request. |
334 bool HasPendingCrossSiteRequest(); | 374 bool HasPendingCrossSiteRequest(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
448 const base::Closure& callback); | 488 const base::Closure& callback); |
449 void SetAccessibilityLoadCompleteCallbackForTesting( | 489 void SetAccessibilityLoadCompleteCallbackForTesting( |
450 const base::Closure& callback); | 490 const base::Closure& callback); |
451 void SetAccessibilityOtherCallbackForTesting( | 491 void SetAccessibilityOtherCallbackForTesting( |
452 const base::Closure& callback); | 492 const base::Closure& callback); |
453 | 493 |
454 bool is_waiting_for_beforeunload_ack() { | 494 bool is_waiting_for_beforeunload_ack() { |
455 return is_waiting_for_beforeunload_ack_; | 495 return is_waiting_for_beforeunload_ack_; |
456 } | 496 } |
457 | 497 |
458 bool is_waiting_for_unload_ack() { | 498 // Whether the RVH is waiting for the unload ack from the renderer. |
459 return is_waiting_for_unload_ack_; | 499 bool IsWaitingForUnloadACK() const; |
460 } | |
461 | 500 |
462 // Returns whether the given URL is allowed to commit in the current process. | 501 // Returns whether the given URL is allowed to commit in the current process. |
463 // This is a more conservative check than RenderProcessHost::FilterURL, since | 502 // This is a more conservative check than RenderProcessHost::FilterURL, since |
464 // it will be used to kill processes that commit unauthorized URLs. | 503 // it will be used to kill processes that commit unauthorized URLs. |
465 bool CanCommitURL(const GURL& url); | 504 bool CanCommitURL(const GURL& url); |
466 | 505 |
467 // Update the FrameTree to use this RenderViewHost's main frame | 506 // Update the FrameTree to use this RenderViewHost's main frame |
468 // RenderFrameHost. Called when the RenderViewHost is committed. | 507 // RenderFrameHost. Called when the RenderViewHost is committed. |
469 // | 508 // |
470 // TODO(ajwong): Remove once RenderViewHost no longer owns the main frame | 509 // TODO(ajwong): Remove once RenderViewHost no longer owns the main frame |
471 // RenderFrameHost. | 510 // RenderFrameHost. |
472 void AttachToFrameTree(); | 511 void AttachToFrameTree(); |
473 | 512 |
474 // The following IPC handlers are public so RenderFrameHost can call them, | 513 // The following IPC handlers are public so RenderFrameHost can call them, |
475 // while we transition the code to not use RenderViewHost. | 514 // while we transition the code to not use RenderViewHost. |
476 // | 515 // |
477 // TODO(nasko): Remove those methods once we are done moving navigation | 516 // TODO(nasko): Remove those methods once we are done moving navigation |
478 // into RenderFrameHost. | 517 // into RenderFrameHost. |
479 void OnDidStartProvisionalLoadForFrame(int64 frame_id, | 518 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
480 int64 parent_frame_id, | 519 int64 parent_frame_id, |
481 bool main_frame, | 520 bool main_frame, |
482 const GURL& url); | 521 const GURL& url); |
483 | 522 |
523 // Increases the refcounting on this RVH. This is done by the FrameTree on | |
524 // creation of a RenderFrameHost. | |
525 void increment_ref_count() { ++frames_ref_count_; } | |
526 | |
527 // Decreases the refcounting on this RVH. This is done by the FrameTree on | |
528 // destruction of a RenderFrameHost. | |
529 void decrement_ref_count() { --frames_ref_count_; } | |
530 | |
531 // Returns the refcount on this RVH, that is the number of RenderFrameHosts | |
532 // currently using it. | |
533 int ref_count() { return frames_ref_count_; } | |
534 | |
484 // NOTE: Do not add functions that just send an IPC message that are called in | 535 // NOTE: Do not add functions that just send an IPC message that are called in |
485 // one or two places. Have the caller send the IPC message directly (unless | 536 // one or two places. Have the caller send the IPC message directly (unless |
486 // the caller places are in different platforms, in which case it's better | 537 // the caller places are in different platforms, in which case it's better |
487 // to keep them consistent). | 538 // to keep them consistent). |
488 | 539 |
489 protected: | 540 protected: |
490 // RenderWidgetHost protected overrides. | 541 // RenderWidgetHost protected overrides. |
491 virtual void OnUserGesture() OVERRIDE; | 542 virtual void OnUserGesture() OVERRIDE; |
492 virtual void NotifyRendererUnresponsive() OVERRIDE; | 543 virtual void NotifyRendererUnresponsive() OVERRIDE; |
493 virtual void NotifyRendererResponsive() OVERRIDE; | 544 virtual void NotifyRendererResponsive() OVERRIDE; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
590 | 641 |
591 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 642 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
592 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 643 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
593 #endif | 644 #endif |
594 | 645 |
595 private: | 646 private: |
596 friend class TestRenderViewHost; | 647 friend class TestRenderViewHost; |
597 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost); | 648 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost); |
598 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane); | 649 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane); |
599 | 650 |
600 // Sets whether this RenderViewHost is swapped out in favor of another, | 651 // Updates the state of this RenderViewHost and clears any waiting state |
601 // and clears any waiting state that is no longer relevant. | 652 // that is no longer relevant. |
602 void SetSwappedOut(bool is_swapped_out); | 653 void SetState(RenderViewHostImplState rvh_state); |
603 | 654 |
604 bool CanAccessFilesOfPageState(const PageState& state) const; | 655 bool CanAccessFilesOfPageState(const PageState& state) const; |
605 | 656 |
657 // The number of RenderFrameHost which have a reference to this RVH. | |
Charlie Reis
2014/01/31 19:11:55
nit: RenderFrameHosts
clamy
2014/02/05 14:21:42
Done.
| |
658 int frames_ref_count_; | |
659 | |
606 // Our delegate, which wants to know about changes in the RenderView. | 660 // Our delegate, which wants to know about changes in the RenderView. |
607 RenderViewHostDelegate* delegate_; | 661 RenderViewHostDelegate* delegate_; |
608 | 662 |
609 // The SiteInstance associated with this RenderViewHost. All pages drawn | 663 // The SiteInstance associated with this RenderViewHost. All pages drawn |
610 // in this RenderViewHost are part of this SiteInstance. Should not change | 664 // in this RenderViewHost are part of this SiteInstance. Should not change |
611 // over time. | 665 // over time. |
612 scoped_refptr<SiteInstanceImpl> instance_; | 666 scoped_refptr<SiteInstanceImpl> instance_; |
613 | 667 |
614 // true if we are currently waiting for a response for drag context | 668 // true if we are currently waiting for a response for drag context |
615 // information. | 669 // information. |
(...skipping 14 matching lines...) Expand all Loading... | |
630 // navigation, because WebContentsImpl will destroy the pending RVH and create | 684 // navigation, because WebContentsImpl will destroy the pending RVH and create |
631 // a new one if a second navigation occurs. | 685 // a new one if a second navigation occurs. |
632 scoped_ptr<ViewMsg_Navigate_Params> suspended_nav_params_; | 686 scoped_ptr<ViewMsg_Navigate_Params> suspended_nav_params_; |
633 | 687 |
634 // Whether the initial empty page of this view has been accessed by another | 688 // Whether the initial empty page of this view has been accessed by another |
635 // page, making it unsafe to show the pending URL. Usually false unless | 689 // page, making it unsafe to show the pending URL. Usually false unless |
636 // another window tries to modify the blank page. Always false after the | 690 // another window tries to modify the blank page. Always false after the |
637 // first commit. | 691 // first commit. |
638 bool has_accessed_initial_document_; | 692 bool has_accessed_initial_document_; |
639 | 693 |
640 // Whether this RenderViewHost is currently swapped out, such that the view is | 694 // The current state of this RVH. |
641 // being rendered by another process. | 695 RenderViewHostImplState rvh_state_; |
642 bool is_swapped_out_; | |
643 | 696 |
644 // The frame id of the main (top level) frame. This value is set on the | 697 // The frame id of the main (top level) frame. This value is set on the |
645 // initial navigation of a RenderView and reset when the RenderView's | 698 // initial navigation of a RenderView and reset when the RenderView's |
646 // process is terminated (in RenderProcessGone). | 699 // process is terminated (in RenderProcessGone). |
647 // TODO(creis): Remove this when we switch to routing IDs for frames. | 700 // TODO(creis): Remove this when we switch to routing IDs for frames. |
648 int64 main_frame_id_; | 701 int64 main_frame_id_; |
649 | 702 |
650 // Routing ID for the main frame's RenderFrameHost. | 703 // Routing ID for the main frame's RenderFrameHost. |
651 int main_frame_routing_id_; | 704 int main_frame_routing_id_; |
652 | 705 |
653 // If we were asked to RunModal, then this will hold the reply_msg that we | 706 // If we were asked to RunModal, then this will hold the reply_msg that we |
654 // must return to the renderer to unblock it. | 707 // must return to the renderer to unblock it. |
655 IPC::Message* run_modal_reply_msg_; | 708 IPC::Message* run_modal_reply_msg_; |
656 // This will hold the routing id of the RenderView that opened us. | 709 // This will hold the routing id of the RenderView that opened us. |
657 int run_modal_opener_id_; | 710 int run_modal_opener_id_; |
658 | 711 |
659 // Set to true when there is a pending ViewMsg_ShouldClose message. This | 712 // Set to true when there is a pending ViewMsg_ShouldClose message. This |
660 // ensures we don't spam the renderer with multiple beforeunload requests. | 713 // ensures we don't spam the renderer with multiple beforeunload requests. |
661 // When either this value or is_waiting_for_unload_ack_ is true, the value of | 714 // When either this value or IsWaitingForUnloadACK is true, the value of |
662 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a | 715 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a |
663 // cross-site transition or a tab close attempt. | 716 // cross-site transition or a tab close attempt. |
664 bool is_waiting_for_beforeunload_ack_; | 717 bool is_waiting_for_beforeunload_ack_; |
Charlie Reis
2014/01/31 19:11:55
Should we consider moving this into the state mach
clamy
2014/02/05 14:21:42
I think it would make the state of RenderViewHost
| |
665 | 718 |
666 // Set to true when there is a pending ViewMsg_Close message. Also see | |
667 // is_waiting_for_beforeunload_ack_, unload_ack_is_for_cross_site_transition_. | |
668 bool is_waiting_for_unload_ack_; | |
669 | |
670 // Set to true when waiting for ViewHostMsg_SwapOut_ACK has timed out. | |
671 bool has_timed_out_on_unload_; | |
672 | |
673 // Valid only when is_waiting_for_beforeunload_ack_ or | 719 // Valid only when is_waiting_for_beforeunload_ack_ or |
674 // is_waiting_for_unload_ack_ is true. This tells us if the unload request | 720 // IsWaitingForUnloadACK is true. This tells us if the unload request |
675 // is for closing the entire tab ( = false), or only this RenderViewHost in | 721 // is for closing the entire tab ( = false), or only this RenderViewHost in |
676 // the case of a cross-site transition ( = true). | 722 // the case of a cross-site transition ( = true). |
677 bool unload_ack_is_for_cross_site_transition_; | 723 bool unload_ack_is_for_cross_site_transition_; |
678 | 724 |
679 bool are_javascript_messages_suppressed_; | 725 bool are_javascript_messages_suppressed_; |
680 | 726 |
681 // The mapping of pending javascript calls created by | 727 // The mapping of pending javascript calls created by |
682 // ExecuteJavascriptInWebFrameCallbackResult and their corresponding | 728 // ExecuteJavascriptInWebFrameCallbackResult and their corresponding |
683 // callbacks. | 729 // callbacks. |
684 std::map<int, JavascriptResultCallback> javascript_callbacks_; | 730 std::map<int, JavascriptResultCallback> javascript_callbacks_; |
(...skipping 14 matching lines...) Expand all Loading... | |
699 base::TimeTicks send_should_close_start_time_; | 745 base::TimeTicks send_should_close_start_time_; |
700 | 746 |
701 // Set to true if we requested the on screen keyboard to be displayed. | 747 // Set to true if we requested the on screen keyboard to be displayed. |
702 bool virtual_keyboard_requested_; | 748 bool virtual_keyboard_requested_; |
703 | 749 |
704 #if defined(OS_ANDROID) | 750 #if defined(OS_ANDROID) |
705 // Manages all the android mediaplayer objects and handling IPCs for video. | 751 // Manages all the android mediaplayer objects and handling IPCs for video. |
706 scoped_ptr<BrowserMediaPlayerManager> media_player_manager_; | 752 scoped_ptr<BrowserMediaPlayerManager> media_player_manager_; |
707 #endif | 753 #endif |
708 | 754 |
755 // Used to shutdown this RVH when the unload event is taking too long to | |
756 // execute. | |
Charlie Reis
2014/01/31 19:11:55
Can you mention whether this is used in the case t
clamy
2014/02/05 14:21:42
Done.
| |
757 scoped_ptr<TimeoutMonitor> unload_event_monitor_timeout_; | |
758 | |
759 // Called after receiving the swap out ack when the RVH is in state pending | |
Charlie Reis
2014/01/31 19:11:55
nit: SwapOutACK
clamy
2014/02/05 14:21:42
Done.
| |
760 // shutdown. Also called if the unload timer times out. | |
761 base::Closure pending_shutdown_on_swap_out_; | |
762 | |
763 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; | |
764 | |
709 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 765 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
710 }; | 766 }; |
711 | 767 |
712 #if defined(COMPILER_MSVC) | 768 #if defined(COMPILER_MSVC) |
713 #pragma warning(pop) | 769 #pragma warning(pop) |
714 #endif | 770 #endif |
715 | 771 |
716 } // namespace content | 772 } // namespace content |
717 | 773 |
718 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 774 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |