OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
6 #define CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ | 6 #define CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> |
10 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/ref_counted.h" |
12 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "url/gurl.h" |
13 | 16 |
14 template <typename T> | 17 template <typename T> |
15 struct DefaultSingletonTraits; | 18 struct DefaultSingletonTraits; |
16 | 19 |
| 20 namespace net { |
| 21 class HttpResponseHeaders; |
| 22 } |
| 23 |
17 namespace content { | 24 namespace content { |
18 | 25 |
19 // TransitionRequestManager is used to handle bookkeeping for transition | 26 // TransitionRequestManager is used to handle bookkeeping for transition |
20 // requests and responses. | 27 // requests and responses. |
21 // | 28 // |
22 // TransitionRequestManager is a singleton and should only be accessed on the IO | 29 // TransitionRequestManager is a singleton and should only be accessed on the IO |
23 // thread. | 30 // thread. |
24 // | 31 // |
25 class TransitionRequestManager { | 32 class TransitionRequestManager { |
26 public: | 33 public: |
27 // Returns the singleton instance. | 34 // Returns the singleton instance. |
28 CONTENT_EXPORT static TransitionRequestManager* GetInstance(); | 35 CONTENT_EXPORT static TransitionRequestManager* GetInstance(); |
29 | 36 |
| 37 // Parses out any transition-entering-stylesheet link headers from the |
| 38 // response headers. |
| 39 CONTENT_EXPORT static void ParseTransitionStylesheetsFromHeaders( |
| 40 const scoped_refptr<net::HttpResponseHeaders>& headers, |
| 41 std::vector<GURL>& entering_stylesheets, |
| 42 const GURL& resolve_address); |
| 43 |
30 // Returns whether the RenderFrameHost specified by the given IDs currently | 44 // Returns whether the RenderFrameHost specified by the given IDs currently |
31 // has a pending transition request. If so, we will have to delay the | 45 // has a pending transition request. If so, we will have to delay the |
32 // response until the embedder resumes the request. | 46 // response until the embedder resumes the request. |
33 bool HasPendingTransitionRequest(int process_id, int render_frame_id); | 47 bool HasPendingTransitionRequest(int process_id, int render_frame_id); |
34 | 48 |
35 // Sets whether the RenderFrameHost specified by the given IDs currently has a | 49 // Sets whether the RenderFrameHost specified by the given IDs currently has a |
36 // pending transition request. | 50 // pending transition request. |
37 CONTENT_EXPORT void SetHasPendingTransitionRequest(int process_id, | 51 CONTENT_EXPORT void SetHasPendingTransitionRequest(int process_id, |
38 int render_frame_id, | 52 int render_frame_id, |
39 bool has_pending); | 53 bool has_pending); |
(...skipping 10 matching lines...) Expand all Loading... |
50 // information to the CrossSiteResourceHandler without doing a round-trip | 64 // information to the CrossSiteResourceHandler without doing a round-trip |
51 // between IO->UI->IO threads. | 65 // between IO->UI->IO threads. |
52 RenderFrameSet pending_transition_frames_; | 66 RenderFrameSet pending_transition_frames_; |
53 | 67 |
54 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); | 68 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); |
55 }; | 69 }; |
56 | 70 |
57 } // namespace content | 71 } // namespace content |
58 | 72 |
59 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ | 73 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
OLD | NEW |