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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // different renderer process. It should run its unload handler and move to | 276 // different renderer process. It should run its unload handler and move to |
277 // a blank document. The renderer should preserve the Frame object until it | 277 // a blank document. The renderer should preserve the Frame object until it |
278 // exits, in case we come back. The renderer can exit if it has no other | 278 // exits, in case we come back. The renderer can exit if it has no other |
279 // active RenderViews, but not until WasSwappedOut is called (when it is no | 279 // active RenderViews, but not until WasSwappedOut is called (when it is no |
280 // longer visible). | 280 // longer visible). |
281 // | 281 // |
282 // Please see ViewMsg_SwapOut_Params in view_messages.h for a description | 282 // Please see ViewMsg_SwapOut_Params in view_messages.h for a description |
283 // of the parameters. | 283 // of the parameters. |
284 void SwapOut(int new_render_process_host_id, int new_request_id); | 284 void SwapOut(int new_render_process_host_id, int new_request_id); |
285 | 285 |
286 // Called by ResourceDispatcherHost after the SwapOutACK is received. | 286 // Called by ResourceDispatcherHost after the SwapOutACK is received or the |
287 void OnSwapOutACK(); | 287 // response times out. |
| 288 void OnSwapOutACK(bool timed_out); |
288 | 289 |
289 // Called to notify the renderer that it has been visibly swapped out and | 290 // Called to notify the renderer that it has been visibly swapped out and |
290 // replaced by another RenderViewHost, after an earlier call to SwapOut. | 291 // replaced by another RenderViewHost, after an earlier call to SwapOut. |
291 // It is now safe for the process to exit if there are no other active | 292 // It is now safe for the process to exit if there are no other active |
292 // RenderViews. | 293 // RenderViews. |
293 void WasSwappedOut(); | 294 void WasSwappedOut(); |
294 | 295 |
295 // Close the page ignoring whether it has unload events registers. | 296 // Close the page ignoring whether it has unload events registers. |
296 // This is called after the beforeunload and unload events have fired | 297 // This is called after the beforeunload and unload events have fired |
297 // and the user has agreed to continue with closing the page. | 298 // and the user has agreed to continue with closing the page. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // ensures we don't spam the renderer with multiple beforeunload requests. | 576 // ensures we don't spam the renderer with multiple beforeunload requests. |
576 // When either this value or is_waiting_for_unload_ack_ is true, the value of | 577 // When either this value or is_waiting_for_unload_ack_ is true, the value of |
577 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a | 578 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a |
578 // cross-site transition or a tab close attempt. | 579 // cross-site transition or a tab close attempt. |
579 bool is_waiting_for_beforeunload_ack_; | 580 bool is_waiting_for_beforeunload_ack_; |
580 | 581 |
581 // Set to true when there is a pending ViewMsg_Close message. Also see | 582 // Set to true when there is a pending ViewMsg_Close message. Also see |
582 // is_waiting_for_beforeunload_ack_, unload_ack_is_for_cross_site_transition_. | 583 // is_waiting_for_beforeunload_ack_, unload_ack_is_for_cross_site_transition_. |
583 bool is_waiting_for_unload_ack_; | 584 bool is_waiting_for_unload_ack_; |
584 | 585 |
| 586 // Set to true when waiting for ViewHostMsg_SwapOut_ACK has timed out. |
| 587 bool has_timed_out_on_unload_; |
| 588 |
585 // Valid only when is_waiting_for_beforeunload_ack_ or | 589 // Valid only when is_waiting_for_beforeunload_ack_ or |
586 // is_waiting_for_unload_ack_ is true. This tells us if the unload request | 590 // is_waiting_for_unload_ack_ is true. This tells us if the unload request |
587 // is for closing the entire tab ( = false), or only this RenderViewHost in | 591 // is for closing the entire tab ( = false), or only this RenderViewHost in |
588 // the case of a cross-site transition ( = true). | 592 // the case of a cross-site transition ( = true). |
589 bool unload_ack_is_for_cross_site_transition_; | 593 bool unload_ack_is_for_cross_site_transition_; |
590 | 594 |
591 bool are_javascript_messages_suppressed_; | 595 bool are_javascript_messages_suppressed_; |
592 | 596 |
593 // True if the render view can be shut down suddenly. | 597 // True if the render view can be shut down suddenly. |
594 bool sudden_termination_allowed_; | 598 bool sudden_termination_allowed_; |
(...skipping 28 matching lines...) Expand all Loading... |
623 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 627 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
624 }; | 628 }; |
625 | 629 |
626 #if defined(COMPILER_MSVC) | 630 #if defined(COMPILER_MSVC) |
627 #pragma warning(pop) | 631 #pragma warning(pop) |
628 #endif | 632 #endif |
629 | 633 |
630 } // namespace content | 634 } // namespace content |
631 | 635 |
632 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 636 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |