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" |
11 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
12 #include "base/process.h" | 12 #include "base/process.h" |
13 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
14 #include "base/lock.h" | 14 #include "base/lock.h" |
15 #include "base/waitable_event.h" | 15 #include "base/waitable_event.h" |
16 #include "chrome/common/transport_dib.h" | 16 #include "chrome/common/transport_dib.h" |
17 | 17 |
18 namespace IPC { | 18 namespace IPC { |
19 class Message; | 19 class Message; |
20 } | 20 } |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class TimeDelta; | 23 class TimeDelta; |
24 } | 24 } |
25 | 25 |
26 class MessageLoop; | |
27 class ResourceDispatcherHost; | 26 class ResourceDispatcherHost; |
28 struct ViewMsg_ClosePage_Params; | 27 struct ViewMsg_ClosePage_Params; |
29 | 28 |
30 // Instantiated per RenderProcessHost to provide various optimizations on | 29 // Instantiated per RenderProcessHost to provide various optimizations on |
31 // behalf of a RenderWidgetHost. This class bridges between the IO thread | 30 // behalf of a RenderWidgetHost. This class bridges between the IO thread |
32 // where the RenderProcessHost's MessageFilter lives and the UI thread where | 31 // where the RenderProcessHost's MessageFilter lives and the UI thread where |
33 // the RenderWidgetHost lives. | 32 // the RenderWidgetHost lives. |
34 // | 33 // |
35 // | 34 // |
36 // OPTIMIZED RESIZE | 35 // OPTIMIZED RESIZE |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Given the id of a transport DIB, return a mapping to it or NULL on error. | 112 // Given the id of a transport DIB, return a mapping to it or NULL on error. |
114 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); | 113 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); |
115 #endif | 114 #endif |
116 | 115 |
117 | 116 |
118 // IO THREAD ONLY ----------------------------------------------------------- | 117 // IO THREAD ONLY ----------------------------------------------------------- |
119 | 118 |
120 // Called on the IO thread when a PaintRect message is received. | 119 // Called on the IO thread when a PaintRect message is received. |
121 void DidReceivePaintMsg(const IPC::Message& msg); | 120 void DidReceivePaintMsg(const IPC::Message& msg); |
122 | 121 |
123 MessageLoop* ui_loop() { return ui_loop_; } | |
124 | |
125 void CreateNewWindow(int opener_id, | 122 void CreateNewWindow(int opener_id, |
126 bool user_gesture, | 123 bool user_gesture, |
127 base::ProcessHandle render_process, | 124 base::ProcessHandle render_process, |
128 int* route_id); | 125 int* route_id); |
129 void CreateNewWidget(int opener_id, bool activatable, int* route_id); | 126 void CreateNewWidget(int opener_id, bool activatable, int* route_id); |
130 | 127 |
131 #if defined(OS_MACOSX) | 128 #if defined(OS_MACOSX) |
132 // Called on the IO thread to handle the allocation of a transport DIB | 129 // Called on the IO thread to handle the allocation of a transport DIB |
133 void AllocTransportDIB(size_t size, TransportDIB::Handle* result); | 130 void AllocTransportDIB(size_t size, TransportDIB::Handle* result); |
134 | 131 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 std::map<TransportDIB::Id, int> allocated_dibs_; | 174 std::map<TransportDIB::Id, int> allocated_dibs_; |
178 #endif | 175 #endif |
179 | 176 |
180 // A map of live paint messages. Must hold pending_paints_lock_ to access. | 177 // A map of live paint messages. Must hold pending_paints_lock_ to access. |
181 // The PaintMsgProxy objects are not owned by this map. (See PaintMsgProxy | 178 // The PaintMsgProxy objects are not owned by this map. (See PaintMsgProxy |
182 // for details about how the lifetime of instances are managed.) | 179 // for details about how the lifetime of instances are managed.) |
183 PaintMsgProxyMap pending_paints_; | 180 PaintMsgProxyMap pending_paints_; |
184 Lock pending_paints_lock_; | 181 Lock pending_paints_lock_; |
185 | 182 |
186 int render_process_id_; | 183 int render_process_id_; |
187 MessageLoop* ui_loop_; | |
188 | 184 |
189 // Event used to implement WaitForPaintMsg. | 185 // Event used to implement WaitForPaintMsg. |
190 base::WaitableEvent event_; | 186 base::WaitableEvent event_; |
191 | 187 |
192 // The next routing id to use. | 188 // The next routing id to use. |
193 base::AtomicSequenceNumber next_routing_id_; | 189 base::AtomicSequenceNumber next_routing_id_; |
194 | 190 |
195 ResourceDispatcherHost* resource_dispatcher_host_; | 191 ResourceDispatcherHost* resource_dispatcher_host_; |
196 | 192 |
197 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 193 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
198 }; | 194 }; |
199 | 195 |
200 #endif // CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ | 196 #endif // CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ |
OLD | NEW |