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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
6 #define CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
7
8 #include <set>
9 #include <utility>
10
11 #include "base/basictypes.h"
12 #include "content/common/content_export.h"
13
14 template <typename T>
15 struct DefaultSingletonTraits;
16
17 namespace content {
18
19 // TransitionRequestManager is used to handle bookkeeping for transition
20 // requests and responses.
21 //
22 // TransitionRequestManager is a singleton and should only be accessed on the IO
23 // thread.
24 //
25 class TransitionRequestManager {
26 public:
27 // Returns the singleton instance.
28 CONTENT_EXPORT static TransitionRequestManager* GetInstance();
29
30 // Returns whether the RenderFrameHost specified by the given IDs currently
31 // has a pending transition request. If so, we will have to delay the
32 // response until the embedder resumes the request.
33 bool HasPendingTransitionRequest(int process_id, int render_frame_id);
34
35 // Sets whether the RenderFrameHost specified by the given IDs currently has a
36 // pending transition request.
37 CONTENT_EXPORT void SetHasPendingTransitionRequest(int process_id,
38 int render_frame_id,
39 bool has_pending);
40
41 private:
42 friend struct DefaultSingletonTraits<TransitionRequestManager>;
43 typedef std::set<std::pair<int, int> > RenderFrameSet;
44
45 TransitionRequestManager();
46 ~TransitionRequestManager();
47
48 // Set of (render_process_host_id, render_frame_id) pairs of all
49 // RenderFrameHosts that have pending transition requests. Used to pass
50 // information to the CrossSiteResourceHandler without doing a round-trip
51 // between IO->UI->IO threads.
52 RenderFrameSet pending_transition_frames_;
53
54 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager);
55 };
56
57 } // namespace content
58
59 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
OLDNEW
« 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