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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2585963002: Clarifying the parameters ownership of BrowserChildProcessHost::Launch() (Closed)
Patch Set: Fixed crasher on Windows. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index c4c30d20147dadb9ac8998c4ae13ff5c429f5ea4..415e9dfc63c26380331db5ef06b5bf55cc4def56 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -883,17 +883,19 @@ bool RenderProcessHostImpl::Init() {
} else {
// Build command line for renderer. We call AppendRendererCommandLine()
// first so the process type argument will appear first.
- base::CommandLine* cmd_line = new base::CommandLine(renderer_path);
+ std::unique_ptr<base::CommandLine> cmd_line =
+ base::MakeUnique<base::CommandLine>(renderer_path);
if (!renderer_prefix.empty())
cmd_line->PrependWrapper(renderer_prefix);
- AppendRendererCommandLine(cmd_line);
+ AppendRendererCommandLine(cmd_line.get());
// Spawn the child process asynchronously to avoid blocking the UI thread.
// As long as there's no renderer prefix, we can use the zygote process
// at this stage.
child_process_launcher_.reset(new ChildProcessLauncher(
- new RendererSandboxedProcessLauncherDelegate(), cmd_line, GetID(), this,
- child_token_, base::Bind(&RenderProcessHostImpl::OnMojoError, id_)));
+ base::MakeUnique<RendererSandboxedProcessLauncherDelegate>(),
+ std::move(cmd_line), GetID(), this, child_token_,
+ base::Bind(&RenderProcessHostImpl::OnMojoError, id_)));
channel_->Pause();
fast_shutdown_started_ = false;
« 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