Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1643533006: Use a single, generic, global zygote to temporarily resolve perf regressions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused ppapi header Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « content/browser/ppapi_plugin_process_host.cc ('k') | content/browser/utility_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698