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

Unified Diff: content/browser/transition_request_manager.h

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 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
« no previous file with comments | « content/browser/transition_browsertest.cc ('k') | content/browser/transition_request_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/transition_request_manager.h
diff --git a/content/browser/transition_request_manager.h b/content/browser/transition_request_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ef969b49dba26cbdaad5a97f9df2c9161a3133a
--- /dev/null
+++ b/content/browser/transition_request_manager.h
@@ -0,0 +1,59 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
+#define CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
+
+#include <set>
+#include <utility>
+
+#include "base/basictypes.h"
+#include "content/common/content_export.h"
+
+template <typename T>
+struct DefaultSingletonTraits;
+
+namespace content {
+
+// TransitionRequestManager is used to handle bookkeeping for transition
+// requests and responses.
+//
+// TransitionRequestManager is a singleton and should only be accessed on the IO
+// thread.
+//
+class TransitionRequestManager {
+ public:
+ // Returns the singleton instance.
+ CONTENT_EXPORT static TransitionRequestManager* GetInstance();
+
+ // 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.
+ bool HasPendingTransitionRequest(int process_id, int render_frame_id);
+
+ // Sets whether the RenderFrameHost specified by the given IDs currently has a
+ // pending transition request.
+ CONTENT_EXPORT void SetHasPendingTransitionRequest(int process_id,
+ int render_frame_id,
+ bool has_pending);
+
+ private:
+ friend struct DefaultSingletonTraits<TransitionRequestManager>;
+ typedef std::set<std::pair<int, int> > RenderFrameSet;
+
+ TransitionRequestManager();
+ ~TransitionRequestManager();
+
+ // Set of (render_process_host_id, render_frame_id) pairs of all
+ // RenderFrameHosts that have pending transition requests. Used to pass
+ // information to the CrossSiteResourceHandler without doing a round-trip
+ // between IO->UI->IO threads.
+ RenderFrameSet pending_transition_frames_;
+
+ DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
« no previous file with comments | « content/browser/transition_browsertest.cc ('k') | content/browser/transition_request_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698