OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace IPC { | 21 namespace IPC { |
22 class Message; | 22 class Message; |
23 } | 23 } |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class TimeDelta; | 26 class TimeDelta; |
27 } | 27 } |
28 | 28 |
29 class ResourceDispatcherHost; | 29 class ResourceDispatcherHost; |
30 struct ViewHostMsg_CreateWindow_Params; | 30 struct ViewHostMsg_CreateWindow_Params; |
31 struct ViewMsg_ClosePage_Params; | 31 struct ViewMsg_SwapOut_Params; |
32 | 32 |
33 | 33 |
34 // Instantiated per RenderProcessHost to provide various optimizations on | 34 // Instantiated per RenderProcessHost to provide various optimizations on |
35 // behalf of a RenderWidgetHost. This class bridges between the IO thread | 35 // behalf of a RenderWidgetHost. This class bridges between the IO thread |
36 // where the RenderProcessHost's MessageFilter lives and the UI thread where | 36 // where the RenderProcessHost's MessageFilter lives and the UI thread where |
37 // the RenderWidgetHost lives. | 37 // the RenderWidgetHost lives. |
38 // | 38 // |
39 // | 39 // |
40 // OPTIMIZED RESIZE | 40 // OPTIMIZED RESIZE |
41 // | 41 // |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Gets the next available routing id. This is thread safe. | 100 // Gets the next available routing id. This is thread safe. |
101 int GetNextRoutingID(); | 101 int GetNextRoutingID(); |
102 | 102 |
103 | 103 |
104 // UI THREAD ONLY ----------------------------------------------------------- | 104 // UI THREAD ONLY ----------------------------------------------------------- |
105 | 105 |
106 // These three functions provide the backend implementation of the | 106 // These three functions provide the backend implementation of the |
107 // corresponding functions in RenderProcessHost. See those declarations | 107 // corresponding functions in RenderProcessHost. See those declarations |
108 // for documentation. | 108 // for documentation. |
109 void CancelResourceRequests(int render_widget_id); | 109 void CancelResourceRequests(int render_widget_id); |
110 void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); | 110 void CrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params); |
111 bool WaitForUpdateMsg(int render_widget_id, | 111 bool WaitForUpdateMsg(int render_widget_id, |
112 const base::TimeDelta& max_delay, | 112 const base::TimeDelta& max_delay, |
113 IPC::Message* msg); | 113 IPC::Message* msg); |
114 | 114 |
115 #if defined(OS_MACOSX) | 115 #if defined(OS_MACOSX) |
116 // Given the id of a transport DIB, return a mapping to it or NULL on error. | 116 // Given the id of a transport DIB, return a mapping to it or NULL on error. |
117 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); | 117 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); |
118 #endif | 118 #endif |
119 | 119 |
120 | 120 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 int route_id, | 175 int route_id, |
176 WebKit::WebPopupType popup_type); | 176 WebKit::WebPopupType popup_type); |
177 | 177 |
178 // Called on the UI thread to create a fullscreen widget. | 178 // Called on the UI thread to create a fullscreen widget. |
179 void OnCreateFullscreenWidgetOnUI(int opener_id, int route_id); | 179 void OnCreateFullscreenWidgetOnUI(int opener_id, int route_id); |
180 | 180 |
181 // Called on the IO thread to cancel resource requests for the render widget. | 181 // Called on the IO thread to cancel resource requests for the render widget. |
182 void OnCancelResourceRequests(int render_widget_id); | 182 void OnCancelResourceRequests(int render_widget_id); |
183 | 183 |
184 // Called on the IO thread to resume a cross-site response. | 184 // Called on the IO thread to resume a cross-site response. |
185 void OnCrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); | 185 void OnCrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params); |
186 | 186 |
187 #if defined(OS_MACOSX) | 187 #if defined(OS_MACOSX) |
188 // Called on destruction to release all allocated transport DIBs | 188 // Called on destruction to release all allocated transport DIBs |
189 void ClearAllocatedDIBs(); | 189 void ClearAllocatedDIBs(); |
190 | 190 |
191 // On OSX we keep file descriptors to all the allocated DIBs around until | 191 // On OSX we keep file descriptors to all the allocated DIBs around until |
192 // the renderer frees them. | 192 // the renderer frees them. |
193 base::Lock allocated_dibs_lock_; | 193 base::Lock allocated_dibs_lock_; |
194 std::map<TransportDIB::Id, int> allocated_dibs_; | 194 std::map<TransportDIB::Id, int> allocated_dibs_; |
195 #endif | 195 #endif |
(...skipping 11 matching lines...) Expand all Loading... |
207 | 207 |
208 // The next routing id to use. | 208 // The next routing id to use. |
209 base::AtomicSequenceNumber next_routing_id_; | 209 base::AtomicSequenceNumber next_routing_id_; |
210 | 210 |
211 ResourceDispatcherHost* resource_dispatcher_host_; | 211 ResourceDispatcherHost* resource_dispatcher_host_; |
212 | 212 |
213 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 213 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
214 }; | 214 }; |
215 | 215 |
216 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 216 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
OLD | NEW |