| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ | 5 #ifndef CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ |
| 6 #define CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ | 6 #define CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 void CreateNewWidget(int opener_id, bool activatable, int* route_id); | 131 void CreateNewWidget(int opener_id, bool activatable, int* route_id); |
| 132 | 132 |
| 133 #if defined(OS_MACOSX) | 133 #if defined(OS_MACOSX) |
| 134 // Called on the IO thread to handle the allocation of a transport DIB | 134 // Called on the IO thread to handle the allocation of a transport DIB |
| 135 void AllocTransportDIB(size_t size, TransportDIB::Handle* result); | 135 void AllocTransportDIB(size_t size, TransportDIB::Handle* result); |
| 136 | 136 |
| 137 // Called on the IO thread to handle the freeing of a transport DIB | 137 // Called on the IO thread to handle the freeing of a transport DIB |
| 138 void FreeTransportDIB(TransportDIB::Id dib_id); | 138 void FreeTransportDIB(TransportDIB::Id dib_id); |
| 139 #endif | 139 #endif |
| 140 | 140 |
| 141 // Helper functions to signal and reset the modal dialog event, used to |
| 142 // signal the renderer that it needs to pump messages while waiting for |
| 143 // sync calls to return. These functions proxy the request to the UI thread. |
| 144 void SignalModalDialogEvent(int routing_id); |
| 145 void ResetModalDialogEvent(int routing_id); |
| 146 |
| 141 private: | 147 private: |
| 142 // A class used to proxy a paint message. PaintMsgProxy objects are created | 148 // A class used to proxy a paint message. PaintMsgProxy objects are created |
| 143 // on the IO thread and destroyed on the UI thread. | 149 // on the IO thread and destroyed on the UI thread. |
| 144 class PaintMsgProxy; | 150 class PaintMsgProxy; |
| 145 friend class PaintMsgProxy; | 151 friend class PaintMsgProxy; |
| 146 | 152 |
| 147 // Map from render_widget_id to live PaintMsgProxy instance. | 153 // Map from render_widget_id to live PaintMsgProxy instance. |
| 148 typedef base::hash_map<int, PaintMsgProxy*> PaintMsgProxyMap; | 154 typedef base::hash_map<int, PaintMsgProxy*> PaintMsgProxyMap; |
| 149 | 155 |
| 150 // Called on the UI thread to discard a paint message. | 156 // Called on the UI thread to discard a paint message. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 174 #if defined(OS_MACOSX) | 180 #if defined(OS_MACOSX) |
| 175 // Called on destruction to release all allocated transport DIBs | 181 // Called on destruction to release all allocated transport DIBs |
| 176 void ClearAllocatedDIBs(); | 182 void ClearAllocatedDIBs(); |
| 177 | 183 |
| 178 // On OSX we keep file descriptors to all the allocated DIBs around until | 184 // On OSX we keep file descriptors to all the allocated DIBs around until |
| 179 // the renderer frees them. | 185 // the renderer frees them. |
| 180 Lock allocated_dibs_lock_; | 186 Lock allocated_dibs_lock_; |
| 181 std::map<TransportDIB::Id, int> allocated_dibs_; | 187 std::map<TransportDIB::Id, int> allocated_dibs_; |
| 182 #endif | 188 #endif |
| 183 | 189 |
| 190 void SignalModalDialogEventOnUI(int routing_id); |
| 191 void ResetModalDialogEventOnUI(int routing_id); |
| 192 |
| 184 // A map of live paint messages. Must hold pending_paints_lock_ to access. | 193 // A map of live paint messages. Must hold pending_paints_lock_ to access. |
| 185 // The PaintMsgProxy objects are not owned by this map. (See PaintMsgProxy | 194 // The PaintMsgProxy objects are not owned by this map. (See PaintMsgProxy |
| 186 // for details about how the lifetime of instances are managed.) | 195 // for details about how the lifetime of instances are managed.) |
| 187 PaintMsgProxyMap pending_paints_; | 196 PaintMsgProxyMap pending_paints_; |
| 188 Lock pending_paints_lock_; | 197 Lock pending_paints_lock_; |
| 189 | 198 |
| 190 int render_process_id_; | 199 int render_process_id_; |
| 191 MessageLoop* ui_loop_; | 200 MessageLoop* ui_loop_; |
| 192 | 201 |
| 193 // Event used to implement WaitForPaintMsg. | 202 // Event used to implement WaitForPaintMsg. |
| 194 base::WaitableEvent event_; | 203 base::WaitableEvent event_; |
| 195 | 204 |
| 196 // The next routing id to use. | 205 // The next routing id to use. |
| 197 base::AtomicSequenceNumber next_routing_id_; | 206 base::AtomicSequenceNumber next_routing_id_; |
| 198 | 207 |
| 199 ResourceDispatcherHost* resource_dispatcher_host_; | 208 ResourceDispatcherHost* resource_dispatcher_host_; |
| 200 | 209 |
| 201 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 210 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
| 202 }; | 211 }; |
| 203 | 212 |
| 204 #endif // CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ | 213 #endif // CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ |
| OLD | NEW |