| 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/modal_dialog_event.h" | 16 #include "chrome/common/modal_dialog_event.h" |
| 17 #include "chrome/common/transport_dib.h" | 17 #include "chrome/common/transport_dib.h" |
| 18 | 18 |
| 19 namespace IPC { | 19 namespace IPC { |
| 20 class Message; | 20 class Message; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class TimeDelta; | 24 class TimeDelta; |
| 25 } | 25 } |
| 26 | 26 |
| 27 class MessageLoop; | 27 class MessageLoop; |
| 28 class ResourceDispatcherHost; | 28 class ResourceDispatcherHost; |
| 29 struct ViewMsg_ClosePage_Params; |
| 29 | 30 |
| 30 // Instantiated per RenderProcessHost to provide various optimizations on | 31 // Instantiated per RenderProcessHost to provide various optimizations on |
| 31 // behalf of a RenderWidgetHost. This class bridges between the IO thread | 32 // behalf of a RenderWidgetHost. This class bridges between the IO thread |
| 32 // where the RenderProcessHost's MessageFilter lives and the UI thread where | 33 // where the RenderProcessHost's MessageFilter lives and the UI thread where |
| 33 // the RenderWidgetHost lives. | 34 // the RenderWidgetHost lives. |
| 34 // | 35 // |
| 35 // | 36 // |
| 36 // OPTIMIZED RESIZE | 37 // OPTIMIZED RESIZE |
| 37 // | 38 // |
| 38 // RenderWidgetHelper is used to implement optimized resize. When the | 39 // RenderWidgetHelper is used to implement optimized resize. When the |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Gets the next available routing id. This is thread safe. | 98 // Gets the next available routing id. This is thread safe. |
| 98 int GetNextRoutingID(); | 99 int GetNextRoutingID(); |
| 99 | 100 |
| 100 | 101 |
| 101 // UI THREAD ONLY ----------------------------------------------------------- | 102 // UI THREAD ONLY ----------------------------------------------------------- |
| 102 | 103 |
| 103 // These three functions provide the backend implementation of the | 104 // These three functions provide the backend implementation of the |
| 104 // corresponding functions in RenderProcessHost. See those declarations | 105 // corresponding functions in RenderProcessHost. See those declarations |
| 105 // for documentation. | 106 // for documentation. |
| 106 void CancelResourceRequests(int render_widget_id); | 107 void CancelResourceRequests(int render_widget_id); |
| 107 void CrossSiteClosePageACK(int new_render_process_host_id, | 108 void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); |
| 108 int new_request_id); | |
| 109 bool WaitForPaintMsg(int render_widget_id, | 109 bool WaitForPaintMsg(int render_widget_id, |
| 110 const base::TimeDelta& max_delay, | 110 const base::TimeDelta& max_delay, |
| 111 IPC::Message* msg); | 111 IPC::Message* msg); |
| 112 | 112 |
| 113 #if defined(OS_MACOSX) | 113 #if defined(OS_MACOSX) |
| 114 // Given the id of a transport DIB, return a mapping to it or NULL on error. | 114 // Given the id of a transport DIB, return a mapping to it or NULL on error. |
| 115 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); | 115 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); |
| 116 #endif | 116 #endif |
| 117 | 117 |
| 118 | 118 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Called on the IO thread after a window was created on the UI thread. | 167 // Called on the IO thread after a window was created on the UI thread. |
| 168 void OnCreateWindowOnIO(int route_id); | 168 void OnCreateWindowOnIO(int route_id); |
| 169 | 169 |
| 170 // Called on the UI thread to finish creating a widget. | 170 // Called on the UI thread to finish creating a widget. |
| 171 void OnCreateWidgetOnUI(int opener_id, int route_id, bool activatable); | 171 void OnCreateWidgetOnUI(int opener_id, int route_id, bool activatable); |
| 172 | 172 |
| 173 // Called on the IO thread to cancel resource requests for the render widget. | 173 // Called on the IO thread to cancel resource requests for the render widget. |
| 174 void OnCancelResourceRequests(int render_widget_id); | 174 void OnCancelResourceRequests(int render_widget_id); |
| 175 | 175 |
| 176 // Called on the IO thread to resume a cross-site response. | 176 // Called on the IO thread to resume a cross-site response. |
| 177 void OnCrossSiteClosePageACK(int new_render_process_host_id, | 177 void OnCrossSiteClosePageACK(ViewMsg_ClosePage_Params params); |
| 178 int new_request_id); | |
| 179 | 178 |
| 180 #if defined(OS_MACOSX) | 179 #if defined(OS_MACOSX) |
| 181 // Called on destruction to release all allocated transport DIBs | 180 // Called on destruction to release all allocated transport DIBs |
| 182 void ClearAllocatedDIBs(); | 181 void ClearAllocatedDIBs(); |
| 183 | 182 |
| 184 // On OSX we keep file descriptors to all the allocated DIBs around until | 183 // On OSX we keep file descriptors to all the allocated DIBs around until |
| 185 // the renderer frees them. | 184 // the renderer frees them. |
| 186 Lock allocated_dibs_lock_; | 185 Lock allocated_dibs_lock_; |
| 187 std::map<TransportDIB::Id, int> allocated_dibs_; | 186 std::map<TransportDIB::Id, int> allocated_dibs_; |
| 188 #endif | 187 #endif |
| (...skipping 15 matching lines...) Expand all Loading... |
| 204 | 203 |
| 205 // The next routing id to use. | 204 // The next routing id to use. |
| 206 base::AtomicSequenceNumber next_routing_id_; | 205 base::AtomicSequenceNumber next_routing_id_; |
| 207 | 206 |
| 208 ResourceDispatcherHost* resource_dispatcher_host_; | 207 ResourceDispatcherHost* resource_dispatcher_host_; |
| 209 | 208 |
| 210 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 209 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
| 211 }; | 210 }; |
| 212 | 211 |
| 213 #endif // CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ | 212 #endif // CHROME_BROWSER_RENDEDER_HOST_RENDER_WIDGET_HELPER_H_ |
| OLD | NEW |