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_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 int surface_id() const { return surface_id_; } | 185 int surface_id() const { return surface_id_; } |
186 | 186 |
187 bool empty() const { return current_size_.IsEmpty(); } | 187 bool empty() const { return current_size_.IsEmpty(); } |
188 | 188 |
189 // Called when a renderer object already been created for this host, and we | 189 // Called when a renderer object already been created for this host, and we |
190 // just need to be attached to it. Used for window.open, <select> dropdown | 190 // just need to be attached to it. Used for window.open, <select> dropdown |
191 // menus, and other times when the renderer initiates creating an object. | 191 // menus, and other times when the renderer initiates creating an object. |
192 virtual void Init(); | 192 virtual void Init(); |
193 | 193 |
| 194 // Initializes a RenderWidgetHost that is attached to a RenderFrameHost. |
| 195 void InitForFrame(); |
| 196 |
| 197 // Signal whether this RenderWidgetHost is owned by a RenderFrameHost, in |
| 198 // which case it does not do self-deletion. |
| 199 void set_owned_by_render_frame_host(bool owned_by_rfh) { |
| 200 owned_by_render_frame_host_ = owned_by_rfh; |
| 201 } |
| 202 |
| 203 // Called by RenderFrameHost before destroying this object. |
| 204 void Cleanup(); |
| 205 |
194 // Tells the renderer to die and then calls Destroy(). | 206 // Tells the renderer to die and then calls Destroy(). |
195 virtual void Shutdown(); | 207 virtual void Shutdown(); |
196 | 208 |
197 // IPC::Listener | 209 // IPC::Listener |
198 bool OnMessageReceived(const IPC::Message& msg) override; | 210 bool OnMessageReceived(const IPC::Message& msg) override; |
199 | 211 |
200 // Sends a message to the corresponding object in the renderer. | 212 // Sends a message to the corresponding object in the renderer. |
201 bool Send(IPC::Message* msg) override; | 213 bool Send(IPC::Message* msg) override; |
202 | 214 |
203 // Indicates if the page has finished loading. | 215 // Indicates if the page has finished loading. |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 std::list<HWND> dummy_windows_for_activation_; | 833 std::list<HWND> dummy_windows_for_activation_; |
822 #endif | 834 #endif |
823 | 835 |
824 RenderWidgetHostLatencyTracker latency_tracker_; | 836 RenderWidgetHostLatencyTracker latency_tracker_; |
825 | 837 |
826 int next_browser_snapshot_id_; | 838 int next_browser_snapshot_id_; |
827 typedef std::map<int, | 839 typedef std::map<int, |
828 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; | 840 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; |
829 PendingSnapshotMap pending_browser_snapshots_; | 841 PendingSnapshotMap pending_browser_snapshots_; |
830 | 842 |
| 843 // Indicates whether a RenderFramehost has ownership, in which case this |
| 844 // object does not self destroy. |
| 845 bool owned_by_render_frame_host_; |
| 846 |
831 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 847 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
832 | 848 |
833 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 849 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
834 }; | 850 }; |
835 | 851 |
836 } // namespace content | 852 } // namespace content |
837 | 853 |
838 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 854 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |