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

Unified Diff: content/browser/transition_request_manager.h

Issue 378743002: Navigation transitions: Place transition page in same process as destination page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/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);
};

Powered by Google App Engine
This is Rietveld 408576698