OLD | NEW |
(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_ |
OLD | NEW |