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

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: Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 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 "base/synchronization/lock.h"
13
14 template <typename T> struct DefaultSingletonTraits;
15
16 namespace content {
17
18 // TransitionRequestManager is used to handle bookkeeping for transition
19 // requests and responses between the UI and IO threads.
20 //
21 // TransitionRequestManager is a singleton that may be used on any thread.
22 //
23 class TransitionRequestManager {
24 public:
25 // Returns the singleton instance.
26 static TransitionRequestManager* GetInstance();
27
28 // Returns whether the RenderViewHost specified by the given IDs currently
29 // has a pending transition request. If so, we will have to delay the
30 // response until the embedder resumes the request.
31 bool HasPendingTransitionRequest(int renderer_id, int render_view_id);
nasko 2014/05/28 22:59:00 What is renderer_id? Is it the process id or somet
shatch 2014/05/29 21:41:22 Done.
32
33 // Sets whether the RenderViewHost specified by the given IDs currently has a
nasko 2014/05/28 22:59:00 Navigations happen through RenderFrameHost these d
shatch 2014/05/29 21:41:22 Changed the comment to reflect being called by the
nasko 2014/06/02 21:59:33 I can see this called only from RenderFrameHostImp
shatch 2014/06/02 23:40:40 Moved everything to RFH per offline discussion.
34 // pending transition request. Called by RenderViewHost on the UI thread.
35 void SetHasPendingTransitionRequest(int renderer_id,
36 int render_view_id,
37 bool has_pending);
38
39 private:
40 friend struct DefaultSingletonTraits<TransitionRequestManager>;
41 typedef std::set<std::pair<int, int> > RenderViewSet;
42
43 TransitionRequestManager();
44 ~TransitionRequestManager();
45
46 // You must acquire this lock before reading or writing any members of this
47 // class. You must not block while holding this lock.
48 base::Lock lock_;
49
50 // Set of (render_process_host_id, render_view_id) pairs of all
51 // RenderViewHosts that have pending transition requests. Used to pass
52 // information to the CrossSiteResourceHandler without doing a round-trip
53 // between IO->UI->IO threads.
54 RenderViewSet pending_transition_views_;
55
56 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager);
57 };
58
59 } // namespace content
60
61 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698