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 OnStorageParitionShutdown(StoragePartition* partition); | |
341 | |
338 protected: | 342 protected: |
339 // A proxy for our IPC::Channel that lives on the IO thread. | 343 // A proxy for our IPC::Channel that lives on the IO thread. |
340 std::unique_ptr<IPC::ChannelProxy> channel_; | 344 std::unique_ptr<IPC::ChannelProxy> channel_; |
341 | 345 |
342 // True if fast shutdown has been performed on this RPH. | 346 // True if fast shutdown has been performed on this RPH. |
343 bool fast_shutdown_started_; | 347 bool fast_shutdown_started_; |
344 | 348 |
345 // True if we've posted a DeleteTask and will be deleted soon. | 349 // True if we've posted a DeleteTask and will be deleted soon. |
346 bool deleting_soon_; | 350 bool deleting_soon_; |
347 | 351 |
348 #ifndef NDEBUG | 352 #ifndef NDEBUG |
349 // True if this object has deleted itself. | 353 // True if this object has deleted itself. |
350 bool is_self_deleted_; | 354 bool is_self_deleted_; |
351 #endif | 355 #endif |
352 | 356 |
353 // The count of currently swapped out but pending RenderViews. We have | 357 // 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 | 358 // started to swap these in, so the renderer process should not exit if |
355 // this count is non-zero. | 359 // this count is non-zero. |
356 int32_t pending_views_; | 360 int32_t pending_views_; |
357 | 361 |
358 private: | 362 private: |
359 friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; | 363 friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; |
360 friend class VisitRelayingRenderProcessHost; | 364 friend class VisitRelayingRenderProcessHost; |
361 class ConnectionFilterController; | 365 class ConnectionFilterController; |
362 class ConnectionFilterImpl; | 366 class ConnectionFilterImpl; |
363 | 367 |
368 // Use CreateRenderProcessHostImpl() instead of calling this constructor | |
falken
2017/06/15 06:46:49
typo? CreateRenderProcessHost()
mattcary
2017/06/15 08:30:39
Done.
| |
369 // directly. | |
370 RenderProcessHostImpl(BrowserContext* browser_context, | |
371 StoragePartitionImpl* storage_partition_impl, | |
372 bool is_for_guests_only); | |
373 | |
364 // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected | 374 // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected |
365 // to the next child process launched for this host, if any. | 375 // to the next child process launched for this host, if any. |
366 void InitializeChannelProxy(); | 376 void InitializeChannelProxy(); |
367 | 377 |
368 // Resets |channel_|, removing it from the attachment broker if necessary. | 378 // Resets |channel_|, removing it from the attachment broker if necessary. |
369 // Always call this in lieu of directly resetting |channel_|. | 379 // Always call this in lieu of directly resetting |channel_|. |
370 void ResetChannelProxy(); | 380 void ResetChannelProxy(); |
371 | 381 |
372 // Creates and adds the IO thread message filters. | 382 // Creates and adds the IO thread message filters. |
373 void CreateMessageFilters(); | 383 void CreateMessageFilters(); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
706 FrameSinkProviderImpl frame_sink_provider_; | 716 FrameSinkProviderImpl frame_sink_provider_; |
707 | 717 |
708 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 718 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
709 | 719 |
710 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 720 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
711 }; | 721 }; |
712 | 722 |
713 } // namespace content | 723 } // namespace content |
714 | 724 |
715 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 725 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |