| 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_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 RenderProcessHostImpl(BrowserContext* browser_context, | 69 RenderProcessHostImpl(BrowserContext* browser_context, |
| 70 StoragePartitionImpl* storage_partition_impl, | 70 StoragePartitionImpl* storage_partition_impl, |
| 71 bool supports_browser_plugin, | 71 bool supports_browser_plugin, |
| 72 bool is_guest); | 72 bool is_guest); |
| 73 virtual ~RenderProcessHostImpl(); | 73 virtual ~RenderProcessHostImpl(); |
| 74 | 74 |
| 75 // RenderProcessHost implementation (public portion). | 75 // RenderProcessHost implementation (public portion). |
| 76 virtual void EnableSendQueue() OVERRIDE; | 76 virtual void EnableSendQueue() OVERRIDE; |
| 77 virtual bool Init() OVERRIDE; | 77 virtual bool Init() OVERRIDE; |
| 78 virtual int GetNextRoutingID() OVERRIDE; | 78 virtual int GetNextRoutingID() OVERRIDE; |
| 79 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; |
| 80 virtual void RemoveRoute(int32 routing_id) OVERRIDE; |
| 79 virtual void SimulateSwapOutACK(const ViewMsg_SwapOut_Params& params) | 81 virtual void SimulateSwapOutACK(const ViewMsg_SwapOut_Params& params) |
| 80 OVERRIDE; | 82 OVERRIDE; |
| 81 virtual bool WaitForBackingStoreMsg(int render_widget_id, | 83 virtual bool WaitForBackingStoreMsg(int render_widget_id, |
| 82 const base::TimeDelta& max_delay, | 84 const base::TimeDelta& max_delay, |
| 83 IPC::Message* msg) OVERRIDE; | 85 IPC::Message* msg) OVERRIDE; |
| 84 virtual void ReceivedBadMessage() OVERRIDE; | 86 virtual void ReceivedBadMessage() OVERRIDE; |
| 85 virtual void WidgetRestored() OVERRIDE; | 87 virtual void WidgetRestored() OVERRIDE; |
| 86 virtual void WidgetHidden() OVERRIDE; | 88 virtual void WidgetHidden() OVERRIDE; |
| 87 virtual int VisibleWidgetCount() const OVERRIDE; | 89 virtual int VisibleWidgetCount() const OVERRIDE; |
| 88 virtual bool IsGuest() const OVERRIDE; | 90 virtual bool IsGuest() const OVERRIDE; |
| 89 virtual StoragePartition* GetStoragePartition() const OVERRIDE; | 91 virtual StoragePartition* GetStoragePartition() const OVERRIDE; |
| 90 virtual bool FastShutdownIfPossible() OVERRIDE; | 92 virtual bool FastShutdownIfPossible() OVERRIDE; |
| 91 virtual void DumpHandles() OVERRIDE; | 93 virtual void DumpHandles() OVERRIDE; |
| 92 virtual base::ProcessHandle GetHandle() const OVERRIDE; | 94 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
| 93 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id) OVERRIDE; | 95 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id) OVERRIDE; |
| 94 virtual TransportDIB* MapTransportDIB(TransportDIB::Id dib_id) OVERRIDE; | 96 virtual TransportDIB* MapTransportDIB(TransportDIB::Id dib_id) OVERRIDE; |
| 95 virtual BrowserContext* GetBrowserContext() const OVERRIDE; | 97 virtual BrowserContext* GetBrowserContext() const OVERRIDE; |
| 96 virtual bool InSameStoragePartition( | 98 virtual bool InSameStoragePartition( |
| 97 StoragePartition* partition) const OVERRIDE; | 99 StoragePartition* partition) const OVERRIDE; |
| 98 virtual int GetID() const OVERRIDE; | 100 virtual int GetID() const OVERRIDE; |
| 99 virtual bool HasConnection() const OVERRIDE; | 101 virtual bool HasConnection() const OVERRIDE; |
| 100 virtual RenderWidgetHost* GetRenderWidgetHostByID(int routing_id) | |
| 101 OVERRIDE; | |
| 102 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; | 102 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; |
| 103 virtual bool IgnoreInputEvents() const OVERRIDE; | 103 virtual bool IgnoreInputEvents() const OVERRIDE; |
| 104 virtual void Attach(RenderWidgetHost* host, int routing_id) | 104 //virtual void Attach(RenderWidgetHost* host, int routing_id) |
| 105 OVERRIDE; | 105 // OVERRIDE; |
| 106 virtual void Release(int routing_id) OVERRIDE; | 106 //virtual void Release(int routing_id) OVERRIDE; |
| 107 virtual void Cleanup() OVERRIDE; | 107 virtual void Cleanup() OVERRIDE; |
| 108 virtual void AddPendingView() OVERRIDE; | 108 virtual void AddPendingView() OVERRIDE; |
| 109 virtual void RemovePendingView() OVERRIDE; | 109 virtual void RemovePendingView() OVERRIDE; |
| 110 virtual void SetSuddenTerminationAllowed(bool enabled) OVERRIDE; | 110 virtual void SetSuddenTerminationAllowed(bool enabled) OVERRIDE; |
| 111 virtual bool SuddenTerminationAllowed() const OVERRIDE; | 111 virtual bool SuddenTerminationAllowed() const OVERRIDE; |
| 112 virtual IPC::ChannelProxy* GetChannel() OVERRIDE; | 112 virtual IPC::ChannelProxy* GetChannel() OVERRIDE; |
| 113 virtual RenderWidgetHostsIterator GetRenderWidgetHostsIterator() OVERRIDE; | |
| 114 virtual bool FastShutdownForPageCount(size_t count) OVERRIDE; | 113 virtual bool FastShutdownForPageCount(size_t count) OVERRIDE; |
| 115 virtual bool FastShutdownStarted() const OVERRIDE; | 114 virtual bool FastShutdownStarted() const OVERRIDE; |
| 116 virtual base::TimeDelta GetChildProcessIdleTime() const OVERRIDE; | 115 virtual base::TimeDelta GetChildProcessIdleTime() const OVERRIDE; |
| 117 virtual void SurfaceUpdated(int32 surface_id) OVERRIDE; | 116 virtual void SurfaceUpdated(int32 surface_id) OVERRIDE; |
| 118 virtual void ResumeRequestsForView(int route_id) OVERRIDE; | 117 virtual void ResumeRequestsForView(int route_id) OVERRIDE; |
| 119 | 118 |
| 120 // IPC::Sender via RenderProcessHost. | 119 // IPC::Sender via RenderProcessHost. |
| 121 virtual bool Send(IPC::Message* msg) OVERRIDE; | 120 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 122 | 121 |
| 123 // IPC::Listener via RenderProcessHost. | 122 // IPC::Listener via RenderProcessHost. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 RenderProcessHost* process, | 181 RenderProcessHost* process, |
| 183 const GURL& url); | 182 const GURL& url); |
| 184 | 183 |
| 185 static base::MessageLoop* GetInProcessRendererThreadForTesting(); | 184 static base::MessageLoop* GetInProcessRendererThreadForTesting(); |
| 186 | 185 |
| 187 protected: | 186 protected: |
| 188 // A proxy for our IPC::Channel that lives on the IO thread (see | 187 // A proxy for our IPC::Channel that lives on the IO thread (see |
| 189 // browser_process.h) | 188 // browser_process.h) |
| 190 scoped_ptr<IPC::ChannelProxy> channel_; | 189 scoped_ptr<IPC::ChannelProxy> channel_; |
| 191 | 190 |
| 192 // The registered render widget hosts. When this list is empty or all NULL, | |
| 193 // we should delete ourselves | |
| 194 IDMap<RenderWidgetHost> render_widget_hosts_; | |
| 195 | |
| 196 // True if fast shutdown has been performed on this RPH. | 191 // True if fast shutdown has been performed on this RPH. |
| 197 bool fast_shutdown_started_; | 192 bool fast_shutdown_started_; |
| 198 | 193 |
| 199 // True if we've posted a DeleteTask and will be deleted soon. | 194 // True if we've posted a DeleteTask and will be deleted soon. |
| 200 bool deleting_soon_; | 195 bool deleting_soon_; |
| 201 | 196 |
| 202 // The count of currently swapped out but pending RenderViews. We have | 197 // The count of currently swapped out but pending RenderViews. We have |
| 203 // started to swap these in, so the renderer process should not exit if | 198 // started to swap these in, so the renderer process should not exit if |
| 204 // this count is non-zero. | 199 // this count is non-zero. |
| 205 int32 pending_views_; | 200 int32 pending_views_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 232 CommandLine* renderer_cmd) const; | 227 CommandLine* renderer_cmd) const; |
| 233 | 228 |
| 234 // Callers can reduce the RenderProcess' priority. | 229 // Callers can reduce the RenderProcess' priority. |
| 235 void SetBackgrounded(bool backgrounded); | 230 void SetBackgrounded(bool backgrounded); |
| 236 | 231 |
| 237 // Handle termination of our process. | 232 // Handle termination of our process. |
| 238 void ProcessDied(bool already_dead); | 233 void ProcessDied(bool already_dead); |
| 239 | 234 |
| 240 virtual void OnGpuSwitching() OVERRIDE; | 235 virtual void OnGpuSwitching() OVERRIDE; |
| 241 | 236 |
| 237 |
| 238 IDMap<IPC::Listener> listeners_; |
| 239 |
| 242 // The count of currently visible widgets. Since the host can be a container | 240 // The count of currently visible widgets. Since the host can be a container |
| 243 // for multiple widgets, it uses this count to determine when it should be | 241 // for multiple widgets, it uses this count to determine when it should be |
| 244 // backgrounded. | 242 // backgrounded. |
| 245 int32 visible_widgets_; | 243 int32 visible_widgets_; |
| 246 | 244 |
| 247 // Does this process have backgrounded priority. | 245 // Does this process have backgrounded priority. |
| 248 bool backgrounded_; | 246 bool backgrounded_; |
| 249 | 247 |
| 250 // Used to allow a RenderWidgetHost to intercept various messages on the | 248 // Used to allow a RenderWidgetHost to intercept various messages on the |
| 251 // IO thread. | 249 // IO thread. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 // Prevents the class from being added as a GpuDataManagerImpl observer more | 332 // Prevents the class from being added as a GpuDataManagerImpl observer more |
| 335 // than once. | 333 // than once. |
| 336 bool gpu_observer_registered_; | 334 bool gpu_observer_registered_; |
| 337 | 335 |
| 338 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 336 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 339 }; | 337 }; |
| 340 | 338 |
| 341 } // namespace content | 339 } // namespace content |
| 342 | 340 |
| 343 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 341 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |