OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 402 |
403 #elif defined(OS_POSIX) | 403 #elif defined(OS_POSIX) |
404 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 404 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
405 ZygoteHandle* GetZygote() override { | 405 ZygoteHandle* GetZygote() override { |
406 const base::CommandLine& browser_command_line = | 406 const base::CommandLine& browser_command_line = |
407 *base::CommandLine::ForCurrentProcess(); | 407 *base::CommandLine::ForCurrentProcess(); |
408 base::CommandLine::StringType renderer_prefix = | 408 base::CommandLine::StringType renderer_prefix = |
409 browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); | 409 browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); |
410 if (!renderer_prefix.empty()) | 410 if (!renderer_prefix.empty()) |
411 return nullptr; | 411 return nullptr; |
412 return &g_render_zygote; | 412 return GetGenericZygote(); |
413 } | 413 } |
414 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) | 414 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
415 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } | 415 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } |
416 #endif // OS_WIN | 416 #endif // OS_WIN |
417 | 417 |
418 SandboxType GetSandboxType() override { return SANDBOX_TYPE_RENDERER; } | 418 SandboxType GetSandboxType() override { return SANDBOX_TYPE_RENDERER; } |
419 | 419 |
420 private: | 420 private: |
421 #if defined(OS_POSIX) | 421 #if defined(OS_POSIX) |
422 base::ScopedFD ipc_fd_; | 422 base::ScopedFD ipc_fd_; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 538 |
539 // static | 539 // static |
540 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { | 540 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { |
541 g_max_renderer_count_override = count; | 541 g_max_renderer_count_override = count; |
542 } | 542 } |
543 | 543 |
544 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 544 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
545 // static | 545 // static |
546 void RenderProcessHostImpl::EarlyZygoteLaunch() { | 546 void RenderProcessHostImpl::EarlyZygoteLaunch() { |
547 DCHECK(!g_render_zygote); | 547 DCHECK(!g_render_zygote); |
548 g_render_zygote = CreateZygote(); | |
549 // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a | 548 // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a |
550 // proxy. It is currently done this way due to concerns about race | 549 // proxy. It is currently done this way due to concerns about race |
551 // conditions. | 550 // conditions. |
552 ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus( | 551 ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus( |
553 g_render_zygote->GetSandboxStatus()); | 552 (*GetGenericZygote())->GetSandboxStatus()); |
554 } | 553 } |
555 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 554 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
556 | 555 |
557 RenderProcessHostImpl::RenderProcessHostImpl( | 556 RenderProcessHostImpl::RenderProcessHostImpl( |
558 BrowserContext* browser_context, | 557 BrowserContext* browser_context, |
559 StoragePartitionImpl* storage_partition_impl, | 558 StoragePartitionImpl* storage_partition_impl, |
560 bool is_for_guests_only) | 559 bool is_for_guests_only) |
561 : fast_shutdown_started_(false), | 560 : fast_shutdown_started_(false), |
562 deleting_soon_(false), | 561 deleting_soon_(false), |
563 #ifndef NDEBUG | 562 #ifndef NDEBUG |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2788 void RenderProcessHostImpl::GetAudioOutputControllers( | 2787 void RenderProcessHostImpl::GetAudioOutputControllers( |
2789 const GetAudioOutputControllersCallback& callback) const { | 2788 const GetAudioOutputControllersCallback& callback) const { |
2790 audio_renderer_host()->GetOutputControllers(callback); | 2789 audio_renderer_host()->GetOutputControllers(callback); |
2791 } | 2790 } |
2792 | 2791 |
2793 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2792 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2794 return bluetooth_dispatcher_host_.get(); | 2793 return bluetooth_dispatcher_host_.get(); |
2795 } | 2794 } |
2796 | 2795 |
2797 } // namespace content | 2796 } // namespace content |
OLD | NEW |