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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 void OnAudioStreamRemoved() override; | 302 void OnAudioStreamRemoved() override; |
303 int get_audio_stream_count_for_testing() const { return audio_stream_count_; } | 303 int get_audio_stream_count_for_testing() const { return audio_stream_count_; } |
304 | 304 |
305 // Sets the global factory used to create new RenderProcessHosts. It may be | 305 // Sets the global factory used to create new RenderProcessHosts. It may be |
306 // nullptr, in which case the default RenderProcessHost will be created (this | 306 // nullptr, in which case the default RenderProcessHost will be created (this |
307 // is the behavior if you don't call this function). The factory must be set | 307 // is the behavior if you don't call this function). The factory must be set |
308 // back to nullptr before it's destroyed; ownership is not transferred. | 308 // back to nullptr before it's destroyed; ownership is not transferred. |
309 static void set_render_process_host_factory( | 309 static void set_render_process_host_factory( |
310 const RenderProcessHostFactory* rph_factory); | 310 const RenderProcessHostFactory* rph_factory); |
311 | 311 |
312 // Tracks which sites frames are hosted in which RenderProcessHosts. | |
313 static void AddFrameWithSite(BrowserContext* browser_context, | |
314 RenderProcessHost* render_process_host, | |
315 const GURL& site_url); | |
316 static void RemoveFrameWithSite(BrowserContext* browser_context, | |
317 RenderProcessHost* render_process_host, | |
318 const GURL& site_url); | |
319 | |
320 // Tracks which sites navigations are expected to commit in which | |
321 // RenderProcessHosts. | |
322 static void AddExpectedNavigationToSite( | |
323 BrowserContext* browser_context, | |
324 RenderProcessHost* render_process_host, | |
325 const GURL& site_url); | |
326 static void RemoveExpectedNavigationToSite( | |
327 BrowserContext* browser_context, | |
328 RenderProcessHost* render_process_host, | |
329 const GURL& site_url); | |
330 | |
312 protected: | 331 protected: |
313 // A proxy for our IPC::Channel that lives on the IO thread. | 332 // A proxy for our IPC::Channel that lives on the IO thread. |
314 std::unique_ptr<IPC::ChannelProxy> channel_; | 333 std::unique_ptr<IPC::ChannelProxy> channel_; |
315 | 334 |
316 // True if fast shutdown has been performed on this RPH. | 335 // True if fast shutdown has been performed on this RPH. |
317 bool fast_shutdown_started_; | 336 bool fast_shutdown_started_; |
318 | 337 |
319 // True if we've posted a DeleteTask and will be deleted soon. | 338 // True if we've posted a DeleteTask and will be deleted soon. |
320 bool deleting_soon_; | 339 bool deleting_soon_; |
321 | 340 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 | 427 |
409 // GpuSwitchingObserver implementation. | 428 // GpuSwitchingObserver implementation. |
410 void OnGpuSwitched() override; | 429 void OnGpuSwitched() override; |
411 | 430 |
412 // Returns the default subframe RenderProcessHost to use for |site_instance|. | 431 // Returns the default subframe RenderProcessHost to use for |site_instance|. |
413 static RenderProcessHost* GetDefaultSubframeProcessHost( | 432 static RenderProcessHost* GetDefaultSubframeProcessHost( |
414 BrowserContext* browser_context, | 433 BrowserContext* browser_context, |
415 SiteInstanceImpl* site_instance, | 434 SiteInstanceImpl* site_instance, |
416 bool is_for_guests_only); | 435 bool is_for_guests_only); |
417 | 436 |
437 // Returns a RenderProcessHost* that is rendering |site_url| in one of its | |
Charlie Reis
2017/05/18 00:58:34
nit: No need for the * here.
clamy
2017/05/22 16:59:52
Done.
| |
438 // frames, or that is expecting a navigation to |site_url|. | |
439 static RenderProcessHost* FindReusableProcessHostForSite( | |
440 BrowserContext* browser_context, | |
441 const GURL& site_url); | |
442 | |
418 #if BUILDFLAG(ENABLE_WEBRTC) | 443 #if BUILDFLAG(ENABLE_WEBRTC) |
419 void OnRegisterAecDumpConsumer(int id); | 444 void OnRegisterAecDumpConsumer(int id); |
420 void OnUnregisterAecDumpConsumer(int id); | 445 void OnUnregisterAecDumpConsumer(int id); |
421 void RegisterAecDumpConsumerOnUIThread(int id); | 446 void RegisterAecDumpConsumerOnUIThread(int id); |
422 void UnregisterAecDumpConsumerOnUIThread(int id); | 447 void UnregisterAecDumpConsumerOnUIThread(int id); |
423 void EnableAecDumpForId(const base::FilePath& file, int id); | 448 void EnableAecDumpForId(const base::FilePath& file, int id); |
424 // Sends |file_for_transit| to the render process. | 449 // Sends |file_for_transit| to the render process. |
425 void SendAecDumpFileToRenderer(int id, | 450 void SendAecDumpFileToRenderer(int id, |
426 IPC::PlatformFileForTransit file_for_transit); | 451 IPC::PlatformFileForTransit file_for_transit); |
427 void SendDisableAecDumpToRenderer(); | 452 void SendDisableAecDumpToRenderer(); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
663 FrameSinkProviderImpl frame_sink_provider_; | 688 FrameSinkProviderImpl frame_sink_provider_; |
664 | 689 |
665 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 690 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
666 | 691 |
667 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 692 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
668 }; | 693 }; |
669 | 694 |
670 } // namespace content | 695 } // namespace content |
671 | 696 |
672 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 697 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |