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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 void OnAudioStreamRemoved() override; | 304 void OnAudioStreamRemoved() override; |
305 int get_audio_stream_count_for_testing() const { return audio_stream_count_; } | 305 int get_audio_stream_count_for_testing() const { return audio_stream_count_; } |
306 | 306 |
307 // Sets the global factory used to create new RenderProcessHosts. It may be | 307 // Sets the global factory used to create new RenderProcessHosts. It may be |
308 // nullptr, in which case the default RenderProcessHost will be created (this | 308 // nullptr, in which case the default RenderProcessHost will be created (this |
309 // is the behavior if you don't call this function). The factory must be set | 309 // is the behavior if you don't call this function). The factory must be set |
310 // back to nullptr before it's destroyed; ownership is not transferred. | 310 // back to nullptr before it's destroyed; ownership is not transferred. |
311 static void set_render_process_host_factory( | 311 static void set_render_process_host_factory( |
312 const RenderProcessHostFactory* rph_factory); | 312 const RenderProcessHostFactory* rph_factory); |
313 | 313 |
314 // Tracks which sites frames are hosted in which RenderProcessHosts. | |
315 static void AddFrameWithSite(BrowserContext* browser_context, | |
clamy
2017/05/04 16:01:01
Due to the split RenderProcessHostImpl/MockRenderP
| |
316 RenderProcessHost* render_process_host, | |
317 const GURL& site_url); | |
Charlie Reis
2017/05/15 03:41:52
Note: If we call these parameters |site_url|, then
clamy
2017/05/16 14:50:46
Done.
| |
318 static void RemoveFrameWithSite(BrowserContext* browser_context, | |
319 RenderProcessHost* render_process_host, | |
320 const GURL& site_url); | |
321 | |
322 // Tracks which sites navigations are expected to commit in which | |
323 // RenderProcessHosts. | |
324 static void AddExpectedNavigationToSite( | |
325 BrowserContext* browser_context, | |
326 RenderProcessHost* render_process_host, | |
327 const GURL& site_url); | |
328 static void RemoveExpectedNavigationToSite( | |
329 BrowserContext* browser_context, | |
330 RenderProcessHost* render_process_host, | |
331 const GURL& site_url); | |
332 | |
314 protected: | 333 protected: |
315 // A proxy for our IPC::Channel that lives on the IO thread. | 334 // A proxy for our IPC::Channel that lives on the IO thread. |
316 std::unique_ptr<IPC::ChannelProxy> channel_; | 335 std::unique_ptr<IPC::ChannelProxy> channel_; |
317 | 336 |
318 // True if fast shutdown has been performed on this RPH. | 337 // True if fast shutdown has been performed on this RPH. |
319 bool fast_shutdown_started_; | 338 bool fast_shutdown_started_; |
320 | 339 |
321 // True if we've posted a DeleteTask and will be deleted soon. | 340 // True if we've posted a DeleteTask and will be deleted soon. |
322 bool deleting_soon_; | 341 bool deleting_soon_; |
323 | 342 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); | 421 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); |
403 | 422 |
404 // GpuSwitchingObserver implementation. | 423 // GpuSwitchingObserver implementation. |
405 void OnGpuSwitched() override; | 424 void OnGpuSwitched() override; |
406 | 425 |
407 // Returns the default subframe RenderProcessHost to use for |site_instance|. | 426 // Returns the default subframe RenderProcessHost to use for |site_instance|. |
408 static RenderProcessHost* GetDefaultSubframeProcessHost( | 427 static RenderProcessHost* GetDefaultSubframeProcessHost( |
409 BrowserContext* browser_context, | 428 BrowserContext* browser_context, |
410 SiteInstanceImpl* site_instance); | 429 SiteInstanceImpl* site_instance); |
411 | 430 |
431 // Returns a RenderProcessHost* that is rendering |site_url| in one of its | |
432 // frames, or that is expecting a navigation to |site_url|. | |
433 static RenderProcessHost* FindReusableProcessHostForSite( | |
434 BrowserContext* browser_context, | |
435 const GURL& site_url); | |
436 | |
412 #if BUILDFLAG(ENABLE_WEBRTC) | 437 #if BUILDFLAG(ENABLE_WEBRTC) |
413 void OnRegisterAecDumpConsumer(int id); | 438 void OnRegisterAecDumpConsumer(int id); |
414 void OnUnregisterAecDumpConsumer(int id); | 439 void OnUnregisterAecDumpConsumer(int id); |
415 void RegisterAecDumpConsumerOnUIThread(int id); | 440 void RegisterAecDumpConsumerOnUIThread(int id); |
416 void UnregisterAecDumpConsumerOnUIThread(int id); | 441 void UnregisterAecDumpConsumerOnUIThread(int id); |
417 void EnableAecDumpForId(const base::FilePath& file, int id); | 442 void EnableAecDumpForId(const base::FilePath& file, int id); |
418 // Sends |file_for_transit| to the render process. | 443 // Sends |file_for_transit| to the render process. |
419 void SendAecDumpFileToRenderer(int id, | 444 void SendAecDumpFileToRenderer(int id, |
420 IPC::PlatformFileForTransit file_for_transit); | 445 IPC::PlatformFileForTransit file_for_transit); |
421 void SendDisableAecDumpToRenderer(); | 446 void SendDisableAecDumpToRenderer(); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 FrameSinkProviderImpl frame_sink_provider_; | 675 FrameSinkProviderImpl frame_sink_provider_; |
651 | 676 |
652 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 677 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
653 | 678 |
654 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 679 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
655 }; | 680 }; |
656 | 681 |
657 } // namespace content | 682 } // namespace content |
658 | 683 |
659 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 684 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |