| 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> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 class CONTENT_EXPORT RenderViewHostImpl | 89 class CONTENT_EXPORT RenderViewHostImpl |
| 90 : public RenderViewHost, | 90 : public RenderViewHost, |
| 91 public RenderWidgetHostImpl { | 91 public RenderWidgetHostImpl { |
| 92 public: | 92 public: |
| 93 // Keeps track of the state of the RenderViewHostImpl, particularly with | 93 // Keeps track of the state of the RenderViewHostImpl, particularly with |
| 94 // respect to swap out. | 94 // respect to swap out. |
| 95 enum RenderViewHostImplState { | 95 enum RenderViewHostImplState { |
| 96 // The standard state for a RVH handling the communication with a | 96 // The standard state for a RVH handling the communication with a |
| 97 // RenderView. | 97 // RenderView. |
| 98 STATE_DEFAULT = 0, | 98 STATE_DEFAULT = 0, |
| 99 // The RVH has sent the SwapOut request to the renderer, but has not | |
| 100 // received the SwapOutACK yet. The new page has not been committed yet | |
| 101 // either. | |
| 102 STATE_WAITING_FOR_UNLOAD_ACK, | |
| 103 // The RVH received the SwapOutACK from the RenderView, but the new page has | |
| 104 // not been committed yet. | |
| 105 STATE_WAITING_FOR_COMMIT, | |
| 106 // The RVH is waiting for the CloseACK from the RenderView. | 99 // The RVH is waiting for the CloseACK from the RenderView. |
| 107 STATE_WAITING_FOR_CLOSE, | 100 STATE_WAITING_FOR_CLOSE, |
| 108 // The RVH has not received the SwapOutACK yet, but the new page has | 101 // The RVH has not received the SwapOutACK yet, but the new page has |
| 109 // committed in a different RVH. The number of active views of the RVH | 102 // committed in a different RVH. The number of active views of the RVH |
| 110 // SiteInstanceImpl is not zero. Upon reception of the SwapOutACK, the RVH | 103 // SiteInstanceImpl is not zero. Upon reception of the SwapOutACK, the RVH |
| 111 // will be swapped out. | 104 // will be swapped out. |
| 112 STATE_PENDING_SWAP_OUT, | 105 STATE_PENDING_SWAP_OUT, |
| 113 // The RVH has not received the SwapOutACK yet, but the new page has | 106 // The RVH has not received the SwapOutACK yet, but the new page has |
| 114 // committed in a different RVH. The number of active views of the RVH | 107 // committed in a different RVH. The number of active views of the RVH |
| 115 // SiteInstanceImpl is zero. Upon reception of the SwapOutACK, the RVH will | 108 // SiteInstanceImpl is zero. Upon reception of the SwapOutACK, the RVH will |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 // Tells the renderer that this RenderView will soon be swapped out, and thus | 263 // Tells the renderer that this RenderView will soon be swapped out, and thus |
| 271 // not to create any new modal dialogs until it happens. This must be done | 264 // not to create any new modal dialogs until it happens. This must be done |
| 272 // separately so that the PageGroupLoadDeferrers of any current dialogs are no | 265 // separately so that the PageGroupLoadDeferrers of any current dialogs are no |
| 273 // longer on the stack when we attempt to swap it out. | 266 // longer on the stack when we attempt to swap it out. |
| 274 void SuppressDialogsUntilSwapOut(); | 267 void SuppressDialogsUntilSwapOut(); |
| 275 | 268 |
| 276 // Called when either the SwapOut request has been acknowledged or has timed | 269 // Called when either the SwapOut request has been acknowledged or has timed |
| 277 // out. | 270 // out. |
| 278 void OnSwappedOut(bool timed_out); | 271 void OnSwappedOut(bool timed_out); |
| 279 | 272 |
| 280 // Called when the RenderFrameHostManager has swapped in a new | |
| 281 // RenderFrameHost. Should |this| RVH switch to the pending shutdown state, | |
| 282 // |pending_delete_on_swap_out| will be executed upon reception of the | |
| 283 // SwapOutACK, or when the unload timer times out. | |
| 284 void WasSwappedOut(const base::Closure& pending_delete_on_swap_out); | |
| 285 | |
| 286 // Set |this| as pending shutdown. |on_swap_out| will be called | 273 // Set |this| as pending shutdown. |on_swap_out| will be called |
| 287 // when the SwapOutACK is received, or when the unload timer times out. | 274 // when the SwapOutACK is received, or when the unload timer times out. |
| 288 void SetPendingShutdown(const base::Closure& on_swap_out); | 275 void SetPendingShutdown(const base::Closure& on_swap_out); |
| 289 | 276 |
| 290 // Close the page ignoring whether it has unload events registers. | 277 // Close the page ignoring whether it has unload events registers. |
| 291 // This is called after the beforeunload and unload events have fired | 278 // This is called after the beforeunload and unload events have fired |
| 292 // and the user has agreed to continue with closing the page. | 279 // and the user has agreed to continue with closing the page. |
| 293 void ClosePageIgnoringUnloadEvents(); | 280 void ClosePageIgnoringUnloadEvents(); |
| 294 | 281 |
| 295 // Tells the renderer view to focus the first (last if reverse is true) node. | 282 // Tells the renderer view to focus the first (last if reverse is true) node. |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 556 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
| 570 }; | 557 }; |
| 571 | 558 |
| 572 #if defined(COMPILER_MSVC) | 559 #if defined(COMPILER_MSVC) |
| 573 #pragma warning(pop) | 560 #pragma warning(pop) |
| 574 #endif | 561 #endif |
| 575 | 562 |
| 576 } // namespace content | 563 } // namespace content |
| 577 | 564 |
| 578 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 565 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |