| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 class HttpResponseHeaders; | 23 class HttpResponseHeaders; |
| 24 } | 24 } |
| 25 class GURL; | 25 class GURL; |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 // This struct passes data about an imminent transition between threads. | 29 // This struct passes data about an imminent transition between threads. |
| 30 struct TransitionLayerData { | 30 struct TransitionLayerData { |
| 31 TransitionLayerData(); | 31 CONTENT_EXPORT TransitionLayerData(); |
| 32 ~TransitionLayerData(); | 32 CONTENT_EXPORT ~TransitionLayerData(); |
| 33 | 33 |
| 34 std::string markup; | 34 std::string markup; |
| 35 std::string css_selector; | 35 std::string css_selector; |
| 36 std::vector<std::string> names; | 36 std::vector<std::string> names; |
| 37 std::vector<gfx::Rect> rects; | 37 std::vector<gfx::Rect> rects; |
| 38 scoped_refptr<net::HttpResponseHeaders> response_headers; | 38 scoped_refptr<net::HttpResponseHeaders> response_headers; |
| 39 GURL request_url; | 39 GURL request_url; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // TransitionRequestManager is used to handle bookkeeping for transition | 42 // TransitionRequestManager is used to handle bookkeeping for transition |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 // Parses out any transition-entering-stylesheet link headers from the | 53 // Parses out any transition-entering-stylesheet link headers from the |
| 54 // response headers. | 54 // response headers. |
| 55 CONTENT_EXPORT static void ParseTransitionStylesheetsFromHeaders( | 55 CONTENT_EXPORT static void ParseTransitionStylesheetsFromHeaders( |
| 56 const scoped_refptr<net::HttpResponseHeaders>& headers, | 56 const scoped_refptr<net::HttpResponseHeaders>& headers, |
| 57 std::vector<GURL>& entering_stylesheets, | 57 std::vector<GURL>& entering_stylesheets, |
| 58 const GURL& resolve_address); | 58 const GURL& resolve_address); |
| 59 | 59 |
| 60 // Returns whether the RenderFrameHost specified by the given IDs currently | 60 // Returns whether the RenderFrameHost specified by the given IDs currently |
| 61 // has any pending transition request data. If so, we will have to delay the | 61 // has any pending transition request data. If so, we will have to delay the |
| 62 // response until the embedder resumes the request. | 62 // response until the embedder resumes the request. |
| 63 bool HasPendingTransitionRequest(int render_process_id, | 63 CONTENT_EXPORT bool HasPendingTransitionRequest( |
| 64 int render_frame_id, | 64 int render_process_id, |
| 65 const GURL& request_url, | 65 int render_frame_id, |
| 66 TransitionLayerData* transition_data); | 66 const GURL& request_url, |
| 67 TransitionLayerData* transition_data); |
| 67 | 68 |
| 68 // Adds pending request data for a transition navigation for the | 69 // Adds pending request data for a transition navigation for the |
| 69 // RenderFrameHost specified by the given IDs. | 70 // RenderFrameHost specified by the given IDs. |
| 70 CONTENT_EXPORT void AddPendingTransitionRequestData( | 71 CONTENT_EXPORT void AddPendingTransitionRequestData( |
| 71 int render_process_id, | 72 int render_process_id, |
| 72 int render_frame_id, | 73 int render_frame_id, |
| 73 const std::string& allowed_destination_host_pattern, | 74 const std::string& allowed_destination_host_pattern, |
| 74 const std::string& css_selector, | 75 const std::string& css_selector, |
| 75 const std::string& markup, | 76 const std::string& markup, |
| 76 const std::vector<std::string>& names, | 77 const std::vector<std::string>& names, |
| 77 const std::vector<gfx::Rect>& rects); | 78 const std::vector<gfx::Rect>& rects); |
| 78 CONTENT_EXPORT void AddPendingTransitionRequestDataForTesting( | 79 CONTENT_EXPORT void AddPendingTransitionRequestDataForTesting( |
| 79 int render_process_id, | 80 int render_process_id, |
| 80 int render_frame_id); | 81 int render_frame_id); |
| 81 | 82 |
| 82 void ClearPendingTransitionRequestData(int render_process_id, | 83 CONTENT_EXPORT void ClearPendingTransitionRequestData(int render_process_id, |
| 83 int render_frame_id); | 84 int render_frame_id); |
| 84 | 85 |
| 85 private: | 86 private: |
| 86 class TransitionRequestData { | 87 class TransitionRequestData { |
| 87 public: | 88 public: |
| 88 TransitionRequestData(); | 89 TransitionRequestData(); |
| 89 ~TransitionRequestData(); | 90 ~TransitionRequestData(); |
| 90 void AddEntry(const std::string& allowed_destination_host_pattern, | 91 void AddEntry(const std::string& allowed_destination_host_pattern, |
| 91 const std::string& selector, | 92 const std::string& selector, |
| 92 const std::string& markup, | 93 const std::string& markup, |
| 93 const std::vector<std::string>& names, | 94 const std::vector<std::string>& names, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Used to pass information to the CrossSiteResourceHandler without doing a | 129 // Used to pass information to the CrossSiteResourceHandler without doing a |
| 129 // round-trip between IO->UI->IO threads. | 130 // round-trip between IO->UI->IO threads. |
| 130 RenderFrameRequestDataMap pending_transition_frames_; | 131 RenderFrameRequestDataMap pending_transition_frames_; |
| 131 | 132 |
| 132 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); | 133 DISALLOW_COPY_AND_ASSIGN(TransitionRequestManager); |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 } // namespace content | 136 } // namespace content |
| 136 | 137 |
| 137 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ | 138 #endif // CONTENT_BROWSER_TRANSITION_REQUEST_MANAGER_H_ |
| OLD | NEW |