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