OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "ui/surface/transport_dib.h" | 23 #include "ui/surface/transport_dib.h" |
24 | 24 |
25 namespace IPC { | 25 namespace IPC { |
26 class Message; | 26 class Message; |
27 } | 27 } |
28 | 28 |
29 namespace base { | 29 namespace base { |
30 class TimeDelta; | 30 class TimeDelta; |
31 } | 31 } |
32 | 32 |
33 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 33 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
34 struct ViewHostMsg_CreateWindow_Params; | 34 struct ViewHostMsg_CreateWindow_Params; |
35 struct ViewMsg_SwapOut_Params; | 35 struct ViewMsg_SwapOut_Params; |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 class GpuProcessHost; | 38 class GpuProcessHost; |
39 class ResourceDispatcherHostImpl; | 39 class ResourceDispatcherHostImpl; |
40 class SessionStorageNamespace; | 40 class SessionStorageNamespace; |
41 | 41 |
42 // Instantiated per RenderProcessHost to provide various optimizations on | 42 // Instantiated per RenderProcessHost to provide various optimizations on |
43 // behalf of a RenderWidgetHost. This class bridges between the IO thread | 43 // behalf of a RenderWidgetHost. This class bridges between the IO thread |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // for documentation. | 130 // for documentation. |
131 void ResumeDeferredNavigation(const GlobalRequestID& request_id); | 131 void ResumeDeferredNavigation(const GlobalRequestID& request_id); |
132 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); | 132 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); |
133 bool WaitForBackingStoreMsg(int render_widget_id, | 133 bool WaitForBackingStoreMsg(int render_widget_id, |
134 const base::TimeDelta& max_delay, | 134 const base::TimeDelta& max_delay, |
135 IPC::Message* msg); | 135 IPC::Message* msg); |
136 // Called to resume the requests for a view after it's ready. The view was | 136 // Called to resume the requests for a view after it's ready. The view was |
137 // created by CreateNewWindow which initially blocked the requests. | 137 // created by CreateNewWindow which initially blocked the requests. |
138 void ResumeRequestsForView(int route_id); | 138 void ResumeRequestsForView(int route_id); |
139 | 139 |
140 #if defined(OS_MACOSX) | |
141 // Associate an NSView with a render process and widget, so that browser | |
142 // compositor swaps can come through during resize. | |
143 static void SetRenderWidgetIDForWidget(gfx::AcceleratedWidget native_widget, | |
144 int render_process_id, | |
145 int render_widget_id); | |
146 static void ResetRenderWidgetIDForWidget( | |
147 gfx::AcceleratedWidget native_widget); | |
148 | |
149 // Display a new frame to an NSView. | |
150 static void OnNativeSurfaceBuffersSwappedOnUIThread( | |
151 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params); | |
152 #endif | |
153 | |
154 // IO THREAD ONLY ----------------------------------------------------------- | 140 // IO THREAD ONLY ----------------------------------------------------------- |
155 | 141 |
156 // Called on the IO thread when a BackingStore message is received. | 142 // Called on the IO thread when a BackingStore message is received. |
157 void DidReceiveBackingStoreMsg(const IPC::Message& msg); | 143 void DidReceiveBackingStoreMsg(const IPC::Message& msg); |
158 | 144 |
159 void CreateNewWindow( | 145 void CreateNewWindow( |
160 const ViewHostMsg_CreateWindow_Params& params, | 146 const ViewHostMsg_CreateWindow_Params& params, |
161 bool no_javascript_access, | 147 bool no_javascript_access, |
162 base::ProcessHandle render_process, | 148 base::ProcessHandle render_process, |
163 int* route_id, | 149 int* route_id, |
(...skipping 14 matching lines...) Expand all Loading... |
178 // the resulting TransportDIB. | 164 // the resulting TransportDIB. |
179 void AllocTransportDIB(uint32 size, | 165 void AllocTransportDIB(uint32 size, |
180 bool cache_in_browser, | 166 bool cache_in_browser, |
181 TransportDIB::Handle* result); | 167 TransportDIB::Handle* result); |
182 | 168 |
183 // Called on the IO thread to handle the freeing of a transport DIB | 169 // Called on the IO thread to handle the freeing of a transport DIB |
184 void FreeTransportDIB(TransportDIB::Id dib_id); | 170 void FreeTransportDIB(TransportDIB::Id dib_id); |
185 #endif | 171 #endif |
186 | 172 |
187 #if defined(OS_MACOSX) | 173 #if defined(OS_MACOSX) |
188 // Retrieve the render process and widget that was associated with an NSView. | 174 static void OnNativeSurfaceBuffersSwappedOnIOThread( |
189 static bool GetRenderWidgetIDForWidget(gfx::AcceleratedWidget native_widget, | 175 GpuProcessHost* gpu_process_host, |
190 int* render_process_id, | 176 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
191 int* render_widget_id); | |
192 #endif | 177 #endif |
193 | 178 |
194 private: | 179 private: |
195 // A class used to proxy a paint message. PaintMsgProxy objects are created | 180 // A class used to proxy a paint message. PaintMsgProxy objects are created |
196 // on the IO thread and destroyed on the UI thread. | 181 // on the IO thread and destroyed on the UI thread. |
197 class BackingStoreMsgProxy; | 182 class BackingStoreMsgProxy; |
198 friend class BackingStoreMsgProxy; | 183 friend class BackingStoreMsgProxy; |
199 friend class base::RefCountedThreadSafe<RenderWidgetHelper>; | 184 friend class base::RefCountedThreadSafe<RenderWidgetHelper>; |
200 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 185 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
201 friend class base::DeleteHelper<RenderWidgetHelper>; | 186 friend class base::DeleteHelper<RenderWidgetHelper>; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 base::AtomicSequenceNumber next_routing_id_; | 250 base::AtomicSequenceNumber next_routing_id_; |
266 | 251 |
267 ResourceDispatcherHostImpl* resource_dispatcher_host_; | 252 ResourceDispatcherHostImpl* resource_dispatcher_host_; |
268 | 253 |
269 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 254 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
270 }; | 255 }; |
271 | 256 |
272 } // namespace content | 257 } // namespace content |
273 | 258 |
274 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 259 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
OLD | NEW |