| 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> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/process.h" | 13 #include "base/process.h" |
| 14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
| 15 #include "base/timer.h" | 15 #include "base/timer.h" |
| 16 #include "content/browser/child_process_launcher.h" | 16 #include "content/browser/child_process_launcher.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/public/browser/gpu_data_manager_observer.h" |
| 18 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
| 19 #include "ipc/ipc_channel_proxy.h" | 20 #include "ipc/ipc_channel_proxy.h" |
| 20 #include "ui/surface/transport_dib.h" | 21 #include "ui/surface/transport_dib.h" |
| 21 | 22 |
| 22 class CommandLine; | 23 class CommandLine; |
| 23 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 24 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class MessageLoop; | 27 class MessageLoop; |
| 27 } | 28 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 55 // keeps a list of RenderView (renderer) and WebContentsImpl (browser) which | 56 // keeps a list of RenderView (renderer) and WebContentsImpl (browser) which |
| 56 // are correlated with IDs. This way, the Views and the corresponding ViewHosts | 57 // are correlated with IDs. This way, the Views and the corresponding ViewHosts |
| 57 // communicate through the two process objects. | 58 // communicate through the two process objects. |
| 58 // | 59 // |
| 59 // A RenderProcessHost is also associated with one and only one | 60 // A RenderProcessHost is also associated with one and only one |
| 60 // StoragePartition. This allows us to implement strong storage isolation | 61 // StoragePartition. This allows us to implement strong storage isolation |
| 61 // because all the IPCs from the RenderViews (renderer) will only ever be able | 62 // because all the IPCs from the RenderViews (renderer) will only ever be able |
| 62 // to access the partition they are assigned to. | 63 // to access the partition they are assigned to. |
| 63 class CONTENT_EXPORT RenderProcessHostImpl | 64 class CONTENT_EXPORT RenderProcessHostImpl |
| 64 : public RenderProcessHost, | 65 : public RenderProcessHost, |
| 65 public ChildProcessLauncher::Client { | 66 public ChildProcessLauncher::Client, |
| 67 public GpuDataManagerObserver { |
| 66 public: | 68 public: |
| 67 RenderProcessHostImpl(BrowserContext* browser_context, | 69 RenderProcessHostImpl(BrowserContext* browser_context, |
| 68 StoragePartitionImpl* storage_partition_impl, | 70 StoragePartitionImpl* storage_partition_impl, |
| 69 bool supports_browser_plugin, | 71 bool supports_browser_plugin, |
| 70 bool is_guest); | 72 bool is_guest); |
| 71 virtual ~RenderProcessHostImpl(); | 73 virtual ~RenderProcessHostImpl(); |
| 72 | 74 |
| 73 // RenderProcessHost implementation (public portion). | 75 // RenderProcessHost implementation (public portion). |
| 74 virtual void EnableSendQueue() OVERRIDE; | 76 virtual void EnableSendQueue() OVERRIDE; |
| 75 virtual bool Init() OVERRIDE; | 77 virtual bool Init() OVERRIDE; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // copied over. | 230 // copied over. |
| 229 void PropagateBrowserCommandLineToRenderer(const CommandLine& browser_cmd, | 231 void PropagateBrowserCommandLineToRenderer(const CommandLine& browser_cmd, |
| 230 CommandLine* renderer_cmd) const; | 232 CommandLine* renderer_cmd) const; |
| 231 | 233 |
| 232 // Callers can reduce the RenderProcess' priority. | 234 // Callers can reduce the RenderProcess' priority. |
| 233 void SetBackgrounded(bool backgrounded); | 235 void SetBackgrounded(bool backgrounded); |
| 234 | 236 |
| 235 // Handle termination of our process. | 237 // Handle termination of our process. |
| 236 void ProcessDied(bool already_dead); | 238 void ProcessDied(bool already_dead); |
| 237 | 239 |
| 240 virtual void OnGpuSwitching() OVERRIDE; |
| 241 |
| 238 // The count of currently visible widgets. Since the host can be a container | 242 // The count of currently visible widgets. Since the host can be a container |
| 239 // for multiple widgets, it uses this count to determine when it should be | 243 // for multiple widgets, it uses this count to determine when it should be |
| 240 // backgrounded. | 244 // backgrounded. |
| 241 int32 visible_widgets_; | 245 int32 visible_widgets_; |
| 242 | 246 |
| 243 // Does this process have backgrounded priority. | 247 // Does this process have backgrounded priority. |
| 244 bool backgrounded_; | 248 bool backgrounded_; |
| 245 | 249 |
| 246 // Used to allow a RenderWidgetHost to intercept various messages on the | 250 // Used to allow a RenderWidgetHost to intercept various messages on the |
| 247 // IO thread. | 251 // IO thread. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 bool supports_browser_plugin_; | 324 bool supports_browser_plugin_; |
| 321 | 325 |
| 322 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest | 326 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest |
| 323 // renderer. | 327 // renderer. |
| 324 bool is_guest_; | 328 bool is_guest_; |
| 325 | 329 |
| 326 // Forwards messages between WebRTCInternals in the browser process | 330 // Forwards messages between WebRTCInternals in the browser process |
| 327 // and PeerConnectionTracker in the renderer process. | 331 // and PeerConnectionTracker in the renderer process. |
| 328 scoped_refptr<PeerConnectionTrackerHost> peer_connection_tracker_host_; | 332 scoped_refptr<PeerConnectionTrackerHost> peer_connection_tracker_host_; |
| 329 | 333 |
| 334 // Prevents the class from being added as a GpuDataManagerImpl observer more |
| 335 // than once. |
| 336 bool gpu_observer_registered_; |
| 337 |
| 330 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 338 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 331 }; | 339 }; |
| 332 | 340 |
| 333 } // namespace content | 341 } // namespace content |
| 334 | 342 |
| 335 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 343 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |