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

Unified Diff: content/browser/ppapi_plugin_process_host.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/gpu/gpu_process_host.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ppapi_plugin_process_host.cc
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 04595bb600d8ce3380492d3836ca18f41c93c877..5a1c878862ce63587fbcec7dbd7d474854cd4d7a 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -373,11 +373,12 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
return false;
}
- base::CommandLine* cmd_line = new base::CommandLine(exe_path);
+ std::unique_ptr<base::CommandLine> cmd_line =
+ base::MakeUnique<base::CommandLine>(exe_path);
cmd_line->AppendSwitchASCII(switches::kProcessType,
is_broker_ ? switches::kPpapiBrokerProcess
: switches::kPpapiPluginProcess);
- BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line);
+ BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line.get());
#if defined(OS_WIN)
cmd_line->AppendArg(is_broker_ ? switches::kPrefetchArgumentPpapiBroker
@@ -436,8 +437,9 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
// On posix, never use the zygote for the broker. Also, only use the zygote if
// we are not using a plugin launcher - having a plugin launcher means we need
// to use another process instead of just forking the zygote.
- process_->Launch(new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_),
- cmd_line, true);
+ process_->Launch(
+ base::MakeUnique<PpapiPluginSandboxedProcessLauncherDelegate>(is_broker_),
+ std::move(cmd_line), true);
return true;
}
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698