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

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

Issue 2848603003: Remove unused copies of EarlyZygoteLaunch() (Closed)
Patch Set: Created 3 years, 7 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 #include "sandbox/win/src/sandbox_policy.h" 217 #include "sandbox/win/src/sandbox_policy.h"
218 #include "ui/display/win/dpi.h" 218 #include "ui/display/win/dpi.h"
219 #endif 219 #endif
220 220
221 #if defined(OS_MACOSX) 221 #if defined(OS_MACOSX)
222 #include "content/browser/bootstrap_sandbox_manager_mac.h" 222 #include "content/browser/bootstrap_sandbox_manager_mac.h"
223 #include "content/browser/mach_broker_mac.h" 223 #include "content/browser/mach_broker_mac.h"
224 #endif 224 #endif
225 225
226 #if defined(OS_POSIX) 226 #if defined(OS_POSIX)
227 #include "content/browser/zygote_host/zygote_communication_linux.h"
228 #include "content/browser/zygote_host/zygote_host_impl_linux.h"
229 #include "content/public/browser/zygote_handle_linux.h" 227 #include "content/public/browser/zygote_handle_linux.h"
230 #endif // defined(OS_POSIX) 228 #endif // defined(OS_POSIX)
231 229
232 #if defined(USE_OZONE) 230 #if defined(USE_OZONE)
233 #include "ui/ozone/public/ozone_switches.h" 231 #include "ui/ozone/public/ozone_switches.h"
234 #endif 232 #endif
235 233
236 #if BUILDFLAG(ENABLE_PLUGINS) 234 #if BUILDFLAG(ENABLE_PLUGINS)
237 #include "content/browser/plugin_service_impl.h" 235 #include "content/browser/plugin_service_impl.h"
238 #include "ppapi/shared_impl/ppapi_switches.h" // nogncheck 236 #include "ppapi/shared_impl/ppapi_switches.h" // nogncheck
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 DCHECK(context); 374 DCHECK(context);
377 SiteProcessMap* map = static_cast<SiteProcessMap*>( 375 SiteProcessMap* map = static_cast<SiteProcessMap*>(
378 context->GetUserData(kSiteProcessMapKeyName)); 376 context->GetUserData(kSiteProcessMapKeyName));
379 if (!map) { 377 if (!map) {
380 map = new SiteProcessMap(); 378 map = new SiteProcessMap();
381 context->SetUserData(kSiteProcessMapKeyName, map); 379 context->SetUserData(kSiteProcessMapKeyName, map);
382 } 380 }
383 return map; 381 return map;
384 } 382 }
385 383
386 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
387 // This static member variable holds the zygote communication information for
388 // the renderer.
389 ZygoteHandle g_render_zygote;
390 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
391
392 // NOTE: changes to this class need to be reviewed by the security team. 384 // NOTE: changes to this class need to be reviewed by the security team.
393 class RendererSandboxedProcessLauncherDelegate 385 class RendererSandboxedProcessLauncherDelegate
394 : public SandboxedProcessLauncherDelegate { 386 : public SandboxedProcessLauncherDelegate {
395 public: 387 public:
396 RendererSandboxedProcessLauncherDelegate() {} 388 RendererSandboxedProcessLauncherDelegate() {}
397 389
398 ~RendererSandboxedProcessLauncherDelegate() override {} 390 ~RendererSandboxedProcessLauncherDelegate() override {}
399 391
400 #if defined(OS_WIN) 392 #if defined(OS_WIN)
401 bool PreSpawnTarget(sandbox::TargetPolicy* policy) override { 393 bool PreSpawnTarget(sandbox::TargetPolicy* policy) override {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 max_count = std::min(max_count, kMaxRendererProcessCount); 680 max_count = std::min(max_count, kMaxRendererProcessCount);
689 } 681 }
690 return max_count; 682 return max_count;
691 } 683 }
692 684
693 // static 685 // static
694 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { 686 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
695 g_max_renderer_count_override = count; 687 g_max_renderer_count_override = count;
696 } 688 }
697 689
698 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
699 // static
700 void RenderProcessHostImpl::EarlyZygoteLaunch() {
701 DCHECK(!g_render_zygote);
James Cook 2017/04/27 21:43:49 Never written! :-)
702 // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a
703 // proxy. It is currently done this way due to concerns about race
704 // conditions.
705 ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus(
706 (*GetGenericZygote())->GetSandboxStatus());
707 }
708 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
709
710 RenderProcessHostImpl::RenderProcessHostImpl( 690 RenderProcessHostImpl::RenderProcessHostImpl(
711 BrowserContext* browser_context, 691 BrowserContext* browser_context,
712 StoragePartitionImpl* storage_partition_impl, 692 StoragePartitionImpl* storage_partition_impl,
713 bool is_for_guests_only) 693 bool is_for_guests_only)
714 : fast_shutdown_started_(false), 694 : fast_shutdown_started_(false),
715 deleting_soon_(false), 695 deleting_soon_(false),
716 #ifndef NDEBUG 696 #ifndef NDEBUG
717 is_self_deleted_(false), 697 is_self_deleted_(false),
718 #endif 698 #endif
719 pending_views_(0), 699 pending_views_(0),
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3119 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3140 3120
3141 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3121 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3142 // Capture the error message in a crash key value. 3122 // Capture the error message in a crash key value.
3143 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3123 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3144 bad_message::ReceivedBadMessage(render_process_id, 3124 bad_message::ReceivedBadMessage(render_process_id,
3145 bad_message::RPH_MOJO_PROCESS_ERROR); 3125 bad_message::RPH_MOJO_PROCESS_ERROR);
3146 } 3126 }
3147 3127
3148 } // namespace content 3128 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698