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_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 // because all the IPCs from the RenderViews (renderer) will only ever be able | 107 // because all the IPCs from the RenderViews (renderer) will only ever be able |
108 // to access the partition they are assigned to. | 108 // to access the partition they are assigned to. |
109 class CONTENT_EXPORT RenderProcessHostImpl | 109 class CONTENT_EXPORT RenderProcessHostImpl |
110 : public RenderProcessHost, | 110 : public RenderProcessHost, |
111 public ChildProcessLauncher::Client, | 111 public ChildProcessLauncher::Client, |
112 public ui::GpuSwitchingObserver, | 112 public ui::GpuSwitchingObserver, |
113 public NON_EXPORTED_BASE(mojom::RouteProvider), | 113 public NON_EXPORTED_BASE(mojom::RouteProvider), |
114 public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider), | 114 public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider), |
115 public NON_EXPORTED_BASE(mojom::RendererHost) { | 115 public NON_EXPORTED_BASE(mojom::RendererHost) { |
116 public: | 116 public: |
117 RenderProcessHostImpl(BrowserContext* browser_context, | 117 static RenderProcessHost* CreateRenderProcessHost( |
118 StoragePartitionImpl* storage_partition_impl, | 118 BrowserContext* browser_context, |
119 bool is_for_guests_only); | 119 StoragePartitionImpl* storage_partition_impl, |
120 bool is_for_guests_only); | |
121 | |
120 ~RenderProcessHostImpl() override; | 122 ~RenderProcessHostImpl() override; |
121 | 123 |
122 // RenderProcessHost implementation (public portion). | 124 // RenderProcessHost implementation (public portion). |
123 bool Init() override; | 125 bool Init() override; |
124 void EnableSendQueue() override; | 126 void EnableSendQueue() override; |
125 int GetNextRoutingID() override; | 127 int GetNextRoutingID() override; |
126 void AddRoute(int32_t routing_id, IPC::Listener* listener) override; | 128 void AddRoute(int32_t routing_id, IPC::Listener* listener) override; |
127 void RemoveRoute(int32_t routing_id) override; | 129 void RemoveRoute(int32_t routing_id) override; |
128 void AddObserver(RenderProcessHostObserver* observer) override; | 130 void AddObserver(RenderProcessHostObserver* observer) override; |
129 void RemoveObserver(RenderProcessHostObserver* observer) override; | 131 void RemoveObserver(RenderProcessHostObserver* observer) override; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 // RenderProcessHosts. | 330 // RenderProcessHosts. |
329 static void AddExpectedNavigationToSite( | 331 static void AddExpectedNavigationToSite( |
330 BrowserContext* browser_context, | 332 BrowserContext* browser_context, |
331 RenderProcessHost* render_process_host, | 333 RenderProcessHost* render_process_host, |
332 const GURL& site_url); | 334 const GURL& site_url); |
333 static void RemoveExpectedNavigationToSite( | 335 static void RemoveExpectedNavigationToSite( |
334 BrowserContext* browser_context, | 336 BrowserContext* browser_context, |
335 RenderProcessHost* render_process_host, | 337 RenderProcessHost* render_process_host, |
336 const GURL& site_url); | 338 const GURL& site_url); |
337 | 339 |
340 static void OnStoragePartitionShutdown(StoragePartition* partition); | |
Charlie Reis
2017/06/25 23:48:28
Please add comments to these.
| |
341 | |
342 static RenderProcessHost* GetSpareRenderProcessHostForTesting(); | |
343 | |
338 protected: | 344 protected: |
339 // A proxy for our IPC::Channel that lives on the IO thread. | 345 // A proxy for our IPC::Channel that lives on the IO thread. |
340 std::unique_ptr<IPC::ChannelProxy> channel_; | 346 std::unique_ptr<IPC::ChannelProxy> channel_; |
341 | 347 |
342 // True if fast shutdown has been performed on this RPH. | 348 // True if fast shutdown has been performed on this RPH. |
343 bool fast_shutdown_started_; | 349 bool fast_shutdown_started_; |
344 | 350 |
345 // True if we've posted a DeleteTask and will be deleted soon. | 351 // True if we've posted a DeleteTask and will be deleted soon. |
346 bool deleting_soon_; | 352 bool deleting_soon_; |
347 | 353 |
348 #ifndef NDEBUG | 354 #ifndef NDEBUG |
349 // True if this object has deleted itself. | 355 // True if this object has deleted itself. |
350 bool is_self_deleted_; | 356 bool is_self_deleted_; |
351 #endif | 357 #endif |
352 | 358 |
353 // The count of currently swapped out but pending RenderViews. We have | 359 // The count of currently swapped out but pending RenderViews. We have |
354 // started to swap these in, so the renderer process should not exit if | 360 // started to swap these in, so the renderer process should not exit if |
355 // this count is non-zero. | 361 // this count is non-zero. |
356 int32_t pending_views_; | 362 int32_t pending_views_; |
357 | 363 |
358 private: | 364 private: |
359 friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; | 365 friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; |
360 friend class VisitRelayingRenderProcessHost; | 366 friend class VisitRelayingRenderProcessHost; |
361 class ConnectionFilterController; | 367 class ConnectionFilterController; |
362 class ConnectionFilterImpl; | 368 class ConnectionFilterImpl; |
363 | 369 |
370 // Use CreateRenderProcessHost() instead of calling this constructor | |
371 // directly. | |
372 RenderProcessHostImpl(BrowserContext* browser_context, | |
373 StoragePartitionImpl* storage_partition_impl, | |
374 bool is_for_guests_only); | |
375 | |
364 // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected | 376 // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected |
365 // to the next child process launched for this host, if any. | 377 // to the next child process launched for this host, if any. |
366 void InitializeChannelProxy(); | 378 void InitializeChannelProxy(); |
367 | 379 |
368 // Resets |channel_|, removing it from the attachment broker if necessary. | 380 // Resets |channel_|, removing it from the attachment broker if necessary. |
369 // Always call this in lieu of directly resetting |channel_|. | 381 // Always call this in lieu of directly resetting |channel_|. |
370 void ResetChannelProxy(); | 382 void ResetChannelProxy(); |
371 | 383 |
372 // Creates and adds the IO thread message filters. | 384 // Creates and adds the IO thread message filters. |
373 void CreateMessageFilters(); | 385 void CreateMessageFilters(); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
706 FrameSinkProviderImpl frame_sink_provider_; | 718 FrameSinkProviderImpl frame_sink_provider_; |
707 | 719 |
708 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 720 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
709 | 721 |
710 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 722 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
711 }; | 723 }; |
712 | 724 |
713 } // namespace content | 725 } // namespace content |
714 | 726 |
715 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 727 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |