Index: content/browser/transition_request_manager.h |
diff --git a/content/browser/transition_request_manager.h b/content/browser/transition_request_manager.h |
index 9ef969b49dba26cbdaad5a97f9df2c9161a3133a..6fdf10f3db3219dcf80100d45e448af6e4eb94ae 100644 |
--- a/content/browser/transition_request_manager.h |
+++ b/content/browser/transition_request_manager.h |
@@ -5,7 +5,9 @@ |
#ifndef CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
#define CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
+#include <map> |
#include <set> |
+#include <string> |
#include <utility> |
#include "base/basictypes.h" |
@@ -14,6 +16,8 @@ |
template <typename T> |
struct DefaultSingletonTraits; |
+class GURL; |
+ |
namespace content { |
// TransitionRequestManager is used to handle bookkeeping for transition |
@@ -27,6 +31,8 @@ class TransitionRequestManager { |
// Returns the singleton instance. |
CONTENT_EXPORT static TransitionRequestManager* GetInstance(); |
+ // Accessed from IO thread only ---------------------------------------------- |
+ |
// Returns whether the RenderFrameHost specified by the given IDs currently |
// has a pending transition request. If so, we will have to delay the |
// response until the embedder resumes the request. |
@@ -38,9 +44,22 @@ class TransitionRequestManager { |
int render_frame_id, |
bool has_pending); |
+ // Accessed from UI thread only ---------------------------------------------- |
+ |
+ // These functions are used to store the process ID for an outgoing |
+ // navigation, so that the same renderer can be reused by the transition. |
+ void AddPendingTransitionProcessID(const GURL& token, int process_id); |
+ void ClearPendingTransitionProcessID(const GURL& token); |
+ int GetPendingTransitionProcessIDByToken(const GURL& token); |
+ |
+ // Creates a unique transition url that is used to identify which process |
+ // to use during a transition. |
+ GURL CreateTransitionURL(); |
+ |
private: |
friend struct DefaultSingletonTraits<TransitionRequestManager>; |
typedef std::set<std::pair<int, int> > RenderFrameSet; |
+ typedef std::map<std::string, int> ProcessIDMap; |
TransitionRequestManager(); |
~TransitionRequestManager(); |
@@ -51,6 +70,11 @@ class TransitionRequestManager { |
// between IO->UI->IO threads. |
RenderFrameSet pending_transition_frames_; |
+ // Map of transition urls to process ids for process sharing. |
+ ProcessIDMap transition_process_ids_; |
+ |
+ int transition_unique_ids_; |
+ |
DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); |
}; |