Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: content/browser/renderer_host/render_process_host.h

Issue 6319001: Support window.opener after a process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Abstract out message filtering code. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host.h
diff --git a/content/browser/renderer_host/render_process_host.h b/content/browser/renderer_host/render_process_host.h
index b38402658e297a0061e09cfe23dec2f20da1c73a..66c3200defdb0d848404d4413147cd6b2a30d582 100644
--- a/content/browser/renderer_host/render_process_host.h
+++ b/content/browser/renderer_host/render_process_host.h
@@ -17,7 +17,7 @@
#include "ui/gfx/surface/transport_dib.h"
class Profile;
-struct ViewMsg_ClosePage_Params;
+struct ViewMsg_SwapOut_Params;
namespace base {
class SharedMemory;
@@ -101,6 +101,12 @@ class RenderProcessHost : public IPC::Channel::Sender,
// goes away we'll know that it was intentional rather than a crash.
void ReportExpectingClose(int32 listener_id);
+ // Track the count of pending views that are being swapped back in. Called
+ // by listeners to register and unregister pending views to prevent the
+ // process from exiting.
+ void AddPendingView();
+ void RemovePendingView();
+
// Allows iteration over this RenderProcessHost's RenderViewHost listeners.
// Use from UI thread only.
typedef IDMap<IPC::Channel::Listener>::const_iterator listeners_iterator;
@@ -167,12 +173,12 @@ class RenderProcessHost : public IPC::Channel::Sender,
// the specified render widget.
virtual void CancelResourceRequests(int render_widget_id) = 0;
- // Called on the UI thread to simulate a ClosePage_ACK message to the
+ // Called on the UI thread to simulate a SwapOut_ACK message to the
// ResourceDispatcherHost. Necessary for a cross-site request, in the case
// that the original RenderViewHost is not live and thus cannot run an
- // onunload handler.
- virtual void CrossSiteClosePageACK(
- const ViewMsg_ClosePage_Params& params) = 0;
+ // unload handler.
+ virtual void CrossSiteSwapOutACK(
+ const ViewMsg_SwapOut_Params& params) = 0;
// Called on the UI thread to wait for the next UpdateRect message for the
// specified render widget. Returns true if successful, and the msg out-
@@ -276,6 +282,11 @@ class RenderProcessHost : public IPC::Channel::Sender,
// True if we've posted a DeleteTask and will be deleted soon.
bool deleting_soon_;
+ // The count of currently swapped out but pending RenderViews. We have
+ // started to swap these in, so the renderer process should not exit if
+ // this count is non-zero.
+ int32 pending_views_;
+
private:
// The globally-unique identifier for this RPH.
int id_;

Powered by Google App Engine
This is Rietveld 408576698