Chromium Code Reviews| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 // StoragePartition. This allows us to implement strong storage isolation | 72 // StoragePartition. This allows us to implement strong storage isolation |
| 73 // because all the IPCs from the RenderViews (renderer) will only ever be able | 73 // because all the IPCs from the RenderViews (renderer) will only ever be able |
| 74 // to access the partition they are assigned to. | 74 // to access the partition they are assigned to. |
| 75 class CONTENT_EXPORT RenderProcessHostImpl | 75 class CONTENT_EXPORT RenderProcessHostImpl |
| 76 : public RenderProcessHost, | 76 : public RenderProcessHost, |
| 77 public ChildProcessLauncher::Client, | 77 public ChildProcessLauncher::Client, |
| 78 public GpuDataManagerObserver { | 78 public GpuDataManagerObserver { |
| 79 public: | 79 public: |
| 80 RenderProcessHostImpl(BrowserContext* browser_context, | 80 RenderProcessHostImpl(BrowserContext* browser_context, |
| 81 StoragePartitionImpl* storage_partition_impl, | 81 StoragePartitionImpl* storage_partition_impl, |
| 82 bool is_guest); | 82 bool is_isolated_guest); |
| 83 virtual ~RenderProcessHostImpl(); | 83 virtual ~RenderProcessHostImpl(); |
| 84 | 84 |
| 85 // RenderProcessHost implementation (public portion). | 85 // RenderProcessHost implementation (public portion). |
| 86 virtual void EnableSendQueue() OVERRIDE; | 86 virtual void EnableSendQueue() OVERRIDE; |
| 87 virtual bool Init() OVERRIDE; | 87 virtual bool Init() OVERRIDE; |
| 88 virtual int GetNextRoutingID() OVERRIDE; | 88 virtual int GetNextRoutingID() OVERRIDE; |
| 89 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; | 89 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; |
| 90 virtual void RemoveRoute(int32 routing_id) OVERRIDE; | 90 virtual void RemoveRoute(int32 routing_id) OVERRIDE; |
| 91 virtual void AddObserver(RenderProcessHostObserver* observer) OVERRIDE; | 91 virtual void AddObserver(RenderProcessHostObserver* observer) OVERRIDE; |
| 92 virtual void RemoveObserver(RenderProcessHostObserver* observer) OVERRIDE; | 92 virtual void RemoveObserver(RenderProcessHostObserver* observer) OVERRIDE; |
| 93 virtual bool WaitForBackingStoreMsg(int render_widget_id, | 93 virtual bool WaitForBackingStoreMsg(int render_widget_id, |
| 94 const base::TimeDelta& max_delay, | 94 const base::TimeDelta& max_delay, |
| 95 IPC::Message* msg) OVERRIDE; | 95 IPC::Message* msg) OVERRIDE; |
| 96 virtual void ReceivedBadMessage() OVERRIDE; | 96 virtual void ReceivedBadMessage() OVERRIDE; |
| 97 virtual void WidgetRestored() OVERRIDE; | 97 virtual void WidgetRestored() OVERRIDE; |
| 98 virtual void WidgetHidden() OVERRIDE; | 98 virtual void WidgetHidden() OVERRIDE; |
| 99 virtual int VisibleWidgetCount() const OVERRIDE; | 99 virtual int VisibleWidgetCount() const OVERRIDE; |
| 100 virtual bool IsGuest() const OVERRIDE; | 100 virtual bool IsIsolatedGuest() const OVERRIDE; |
| 101 virtual StoragePartition* GetStoragePartition() const OVERRIDE; | 101 virtual StoragePartition* GetStoragePartition() const OVERRIDE; |
| 102 virtual bool FastShutdownIfPossible() OVERRIDE; | 102 virtual bool FastShutdownIfPossible() OVERRIDE; |
| 103 virtual void DumpHandles() OVERRIDE; | 103 virtual void DumpHandles() OVERRIDE; |
| 104 virtual base::ProcessHandle GetHandle() const OVERRIDE; | 104 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
| 105 virtual BrowserContext* GetBrowserContext() const OVERRIDE; | 105 virtual BrowserContext* GetBrowserContext() const OVERRIDE; |
| 106 virtual bool InSameStoragePartition( | 106 virtual bool InSameStoragePartition( |
| 107 StoragePartition* partition) const OVERRIDE; | 107 StoragePartition* partition) const OVERRIDE; |
| 108 virtual int GetID() const OVERRIDE; | 108 virtual int GetID() const OVERRIDE; |
| 109 virtual bool HasConnection() const OVERRIDE; | 109 virtual bool HasConnection() const OVERRIDE; |
| 110 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; | 110 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 #if defined(OS_ANDROID) | 215 #if defined(OS_ANDROID) |
| 216 const scoped_refptr<BrowserDemuxerAndroid>& browser_demuxer_android() { | 216 const scoped_refptr<BrowserDemuxerAndroid>& browser_demuxer_android() { |
| 217 return browser_demuxer_android_; | 217 return browser_demuxer_android_; |
| 218 } | 218 } |
| 219 #endif | 219 #endif |
| 220 | 220 |
| 221 MessagePortMessageFilter* message_port_message_filter() const { | 221 MessagePortMessageFilter* message_port_message_filter() const { |
| 222 return message_port_message_filter_; | 222 return message_port_message_filter_; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void SetIsGuestForTesting(bool is_guest) { | 225 void SetIsGuestForTesting(bool is_isolated_guest) { |
|
lazyboy
2014/05/27 19:22:22
set_is_isolated_guest_for_testing()
Fady Samuel
2014/05/27 21:56:34
Done.
| |
| 226 is_guest_ = is_guest; | 226 is_isolated_guest_ = is_isolated_guest; |
| 227 } | 227 } |
| 228 | 228 |
| 229 // Called when the existence of the other renderer process which is connected | 229 // Called when the existence of the other renderer process which is connected |
| 230 // to the Worker in this renderer process has changed. | 230 // to the Worker in this renderer process has changed. |
| 231 // It is only called when "enable-embedded-shared-worker" flag is set. | 231 // It is only called when "enable-embedded-shared-worker" flag is set. |
| 232 void IncrementWorkerRefCount(); | 232 void IncrementWorkerRefCount(); |
| 233 void DecrementWorkerRefCount(); | 233 void DecrementWorkerRefCount(); |
| 234 | 234 |
| 235 // Establish a connection to a renderer-provided service. See | 235 // Establish a connection to a renderer-provided service. See |
| 236 // content/common/mojo/mojo_service_names.h for a list of services. | 236 // content/common/mojo/mojo_service_names.h for a list of services. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 | 377 |
| 378 // Set to true if we shouldn't send input events. We actually do the | 378 // Set to true if we shouldn't send input events. We actually do the |
| 379 // filtering for this at the render widget level. | 379 // filtering for this at the render widget level. |
| 380 bool ignore_input_events_; | 380 bool ignore_input_events_; |
| 381 | 381 |
| 382 // Records the last time we regarded the child process active. | 382 // Records the last time we regarded the child process active. |
| 383 base::TimeTicks child_process_activity_time_; | 383 base::TimeTicks child_process_activity_time_; |
| 384 | 384 |
| 385 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest | 385 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest |
| 386 // renderer. | 386 // renderer. |
| 387 bool is_guest_; | 387 bool is_isolated_guest_; |
| 388 | 388 |
| 389 // Forwards messages between WebRTCInternals in the browser process | 389 // Forwards messages between WebRTCInternals in the browser process |
| 390 // and PeerConnectionTracker in the renderer process. | 390 // and PeerConnectionTracker in the renderer process. |
| 391 scoped_refptr<PeerConnectionTrackerHost> peer_connection_tracker_host_; | 391 scoped_refptr<PeerConnectionTrackerHost> peer_connection_tracker_host_; |
| 392 | 392 |
| 393 // Prevents the class from being added as a GpuDataManagerImpl observer more | 393 // Prevents the class from being added as a GpuDataManagerImpl observer more |
| 394 // than once. | 394 // than once. |
| 395 bool gpu_observer_registered_; | 395 bool gpu_observer_registered_; |
| 396 | 396 |
| 397 // Set if a call to Cleanup is required once the RenderProcessHostImpl is no | 397 // Set if a call to Cleanup is required once the RenderProcessHostImpl is no |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 424 base::TimeTicks survive_for_worker_start_time_; | 424 base::TimeTicks survive_for_worker_start_time_; |
| 425 | 425 |
| 426 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 426 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 427 | 427 |
| 428 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 428 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 429 }; | 429 }; |
| 430 | 430 |
| 431 } // namespace content | 431 } // namespace content |
| 432 | 432 |
| 433 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 433 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |