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; | |
jochen (gone - plz use gerrit)
2014/07/16 13:25:59
don't indent
Zhen Wang
2014/07/18 00:56:35
Done.
| |
22 } | |
23 | |
17 namespace content { | 24 namespace content { |
18 | 25 |
26 struct TransitionLayerData { | |
27 TransitionLayerData(); | |
jochen (gone - plz use gerrit)
2014/07/16 13:25:59
please inline ctor/dtor here.
Zhen Wang
2014/07/18 00:56:35
If I inline them, the compiler will complain with
| |
28 ~TransitionLayerData(); | |
29 | |
30 std::vector<GURL> transition_stylesheets; | |
31 }; | |
32 | |
19 // TransitionRequestManager is used to handle bookkeeping for transition | 33 // TransitionRequestManager is used to handle bookkeeping for transition |
20 // requests and responses. | 34 // requests and responses. |
21 // | 35 // |
22 // TransitionRequestManager is a singleton and should only be accessed on the IO | 36 // TransitionRequestManager is a singleton and should only be accessed on the IO |
23 // thread. | 37 // thread. |
24 // | 38 // |
25 class TransitionRequestManager { | 39 class TransitionRequestManager { |
26 public: | 40 public: |
27 // Returns the singleton instance. | 41 // Returns the singleton instance. |
28 CONTENT_EXPORT static TransitionRequestManager* GetInstance(); | 42 CONTENT_EXPORT static TransitionRequestManager* GetInstance(); |
29 | 43 |
44 // Parses out any transition-entering-stylesheet link headers from the | |
45 // response headers. | |
46 static void ParseTransitionStylesheetsFromHeaders( | |
47 scoped_refptr<net::HttpResponseHeaders> headers, | |
48 TransitionLayerData& transition_layer_data, | |
49 const GURL& resolve_address); | |
50 | |
30 // Returns whether the RenderFrameHost specified by the given IDs currently | 51 // Returns whether the RenderFrameHost specified by the given IDs currently |
31 // has a pending transition request. If so, we will have to delay the | 52 // has a pending transition request. If so, we will have to delay the |
32 // response until the embedder resumes the request. | 53 // response until the embedder resumes the request. |
33 bool HasPendingTransitionRequest(int process_id, int render_frame_id); | 54 bool HasPendingTransitionRequest(int process_id, int render_frame_id); |
34 | 55 |
35 // Sets whether the RenderFrameHost specified by the given IDs currently has a | 56 // Sets whether the RenderFrameHost specified by the given IDs currently has a |
36 // pending transition request. | 57 // pending transition request. |
37 CONTENT_EXPORT void SetHasPendingTransitionRequest(int process_id, | 58 CONTENT_EXPORT void SetHasPendingTransitionRequest(int process_id, |
38 int render_frame_id, | 59 int render_frame_id, |
39 bool has_pending); | 60 bool has_pending); |
(...skipping 10 matching lines...) Expand all Loading... | |
50 // information to the CrossSiteResourceHandler without doing a round-trip | 71 // information to the CrossSiteResourceHandler without doing a round-trip |
51 // between IO->UI->IO threads. | 72 // between IO->UI->IO threads. |
52 RenderFrameSet pending_transition_frames_; | 73 RenderFrameSet pending_transition_frames_; |
53 | 74 |
54 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); | 75 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); |
55 }; | 76 }; |
56 | 77 |
57 } // namespace content | 78 } // namespace content |
58 | 79 |
59 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ | 80 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
OLD | NEW |