| 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 b8d98cdeaedd7aa30b3df3262d83f7a1b8589e09..e230b1eb7db10341b2748b2edb8a72a9621734f5 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -320,8 +320,9 @@ class RendererSandboxedProcessLauncherDelegate
|
|
|
| #elif defined(OS_POSIX)
|
| virtual bool ShouldUseZygote() OVERRIDE {
|
| - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
|
| - CommandLine::StringType renderer_prefix =
|
| + const base::CommandLine& browser_command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| + base::CommandLine::StringType renderer_prefix =
|
| browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix);
|
| return renderer_prefix.empty();
|
| }
|
| @@ -481,7 +482,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
|
| mark_child_process_activity_time();
|
|
|
| if (!GetBrowserContext()->IsOffTheRecord() &&
|
| - !CommandLine::ForCurrentProcess()->HasSwitch(
|
| + !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kDisableGpuShaderDiskCache)) {
|
| BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
|
| base::Bind(&CacheShaderInfo, GetID(),
|
| @@ -550,7 +551,7 @@ RenderProcessHostImpl::~RenderProcessHostImpl() {
|
|
|
| UnregisterHost(GetID());
|
|
|
| - if (!CommandLine::ForCurrentProcess()->HasSwitch(
|
| + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kDisableGpuShaderDiskCache)) {
|
| BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
|
| base::Bind(&RemoveShaderInfo, GetID()));
|
| @@ -571,11 +572,12 @@ bool RenderProcessHostImpl::Init() {
|
| if (channel_)
|
| return true;
|
|
|
| - CommandLine::StringType renderer_prefix;
|
| + base::CommandLine::StringType renderer_prefix;
|
| #if defined(OS_POSIX)
|
| // A command prefix is something prepended to the command line of the spawned
|
| // process. It is supported only on POSIX systems.
|
| - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
|
| + const base::CommandLine& browser_command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| renderer_prefix =
|
| browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix);
|
| #endif // defined(OS_POSIX)
|
| @@ -633,7 +635,7 @@ bool RenderProcessHostImpl::Init() {
|
| } else {
|
| // Build command line for renderer. We call AppendRendererCommandLine()
|
| // first so the process type argument will appear first.
|
| - CommandLine* cmd_line = new CommandLine(renderer_path);
|
| + base::CommandLine* cmd_line = new base::CommandLine(renderer_path);
|
| if (!renderer_prefix.empty())
|
| cmd_line->PrependWrapper(renderer_prefix);
|
| AppendRendererCommandLine(cmd_line);
|
| @@ -677,7 +679,8 @@ void RenderProcessHostImpl::MaybeActivateMojo() {
|
| }
|
|
|
| bool RenderProcessHostImpl::ShouldUseMojoChannel() const {
|
| - const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| + const base::CommandLine& command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| return command_line.HasSwitch(switches::kEnableRendererMojoChannel);
|
| }
|
|
|
| @@ -886,7 +889,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
| AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER));
|
| AddFilter(new HistogramMessageFilter());
|
| #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID))
|
| - if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kEnableMemoryBenchmarking))
|
| AddFilter(new MemoryBenchmarkMessageFilter());
|
| #endif
|
| @@ -936,8 +939,8 @@ void RenderProcessHostImpl::RemoveRoute(int32 routing_id) {
|
|
|
| #if defined(OS_WIN)
|
| // Dump the handle table if handle auditing is enabled.
|
| - const CommandLine& browser_command_line =
|
| - *CommandLine::ForCurrentProcess();
|
| + const base::CommandLine& browser_command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| if (browser_command_line.HasSwitch(switches::kAuditHandles) ||
|
| browser_command_line.HasSwitch(switches::kAuditAllHandles)) {
|
| DumpHandles();
|
| @@ -962,7 +965,7 @@ void RenderProcessHostImpl::RemoveObserver(
|
| }
|
|
|
| void RenderProcessHostImpl::ReceivedBadMessage() {
|
| - CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC))
|
| return;
|
|
|
| @@ -1010,7 +1013,7 @@ StoragePartition* RenderProcessHostImpl::GetStoragePartition() const {
|
| return storage_partition_impl_;
|
| }
|
|
|
| -static void AppendCompositorCommandLineFlags(CommandLine* command_line) {
|
| +static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) {
|
| if (IsPinchVirtualViewportEnabled())
|
| command_line->AppendSwitch(cc::switches::kEnablePinchVirtualViewport);
|
|
|
| @@ -1033,13 +1036,14 @@ static void AppendCompositorCommandLineFlags(CommandLine* command_line) {
|
| }
|
|
|
| void RenderProcessHostImpl::AppendRendererCommandLine(
|
| - CommandLine* command_line) const {
|
| + base::CommandLine* command_line) const {
|
| // Pass the process type first, so it shows first in process listings.
|
| command_line->AppendSwitchASCII(switches::kProcessType,
|
| switches::kRendererProcess);
|
|
|
| // Now send any options from our own command line we want to propagate.
|
| - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
|
| + const base::CommandLine& browser_command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| PropagateBrowserCommandLineToRenderer(browser_command_line, command_line);
|
|
|
| // Pass on the browser locale.
|
| @@ -1072,8 +1076,8 @@ void RenderProcessHostImpl::AppendRendererCommandLine(
|
| }
|
|
|
| void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
| - const CommandLine& browser_cmd,
|
| - CommandLine* renderer_cmd) const {
|
| + const base::CommandLine& browser_cmd,
|
| + base::CommandLine* renderer_cmd) const {
|
| // Propagate the following switches to the renderer command line (along
|
| // with any associated values) if present in the browser command line.
|
| static const char* const kSwitchNames[] = {
|
| @@ -1727,7 +1731,7 @@ bool RenderProcessHost::run_renderer_in_process() {
|
| void RenderProcessHost::SetRunRendererInProcess(bool value) {
|
| g_run_renderer_in_process_ = value;
|
|
|
| - CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| if (value) {
|
| if (!command_line->HasSwitch(switches::kLang)) {
|
| // Modify the current process' command line to include the browser locale,
|
| @@ -1764,7 +1768,8 @@ bool RenderProcessHost::ShouldTryToUseExistingProcessHost(
|
| // from the same site to share, if we knew what the given process was
|
| // dedicated to. Allowing no sharing is simpler for now.) This may cause
|
| // resource exhaustion issues if too many sites are open at once.
|
| - const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| + const base::CommandLine& command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) ||
|
| command_line.HasSwitch(switches::kSitePerProcess))
|
| return false;
|
| @@ -1821,7 +1826,8 @@ bool RenderProcessHost::ShouldUseProcessPerSite(
|
| // the case if the --process-per-site switch is specified, or in
|
| // process-per-site-instance for particular sites (e.g., WebUI).
|
| // Note that --single-process is handled in ShouldTryToUseExistingProcessHost.
|
| - const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| + const base::CommandLine& command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| if (command_line.HasSwitch(switches::kProcessPerSite))
|
| return true;
|
|
|
|
|