| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 CommandLine::StringType gpu_launcher = | 952 CommandLine::StringType gpu_launcher = |
| 953 browser_command_line.GetSwitchValueNative(switches::kGpuLauncher); | 953 browser_command_line.GetSwitchValueNative(switches::kGpuLauncher); |
| 954 | 954 |
| 955 #if defined(OS_LINUX) | 955 #if defined(OS_LINUX) |
| 956 int child_flags = gpu_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : | 956 int child_flags = gpu_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : |
| 957 ChildProcessHost::CHILD_NORMAL; | 957 ChildProcessHost::CHILD_NORMAL; |
| 958 #else | 958 #else |
| 959 int child_flags = ChildProcessHost::CHILD_NORMAL; | 959 int child_flags = ChildProcessHost::CHILD_NORMAL; |
| 960 #endif | 960 #endif |
| 961 | 961 |
| 962 FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); | 962 base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); |
| 963 if (exe_path.empty()) | 963 if (exe_path.empty()) |
| 964 return false; | 964 return false; |
| 965 | 965 |
| 966 CommandLine* cmd_line = new CommandLine(exe_path); | 966 CommandLine* cmd_line = new CommandLine(exe_path); |
| 967 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); | 967 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); |
| 968 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 968 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
| 969 | 969 |
| 970 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) | 970 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) |
| 971 cmd_line->AppendSwitch(switches::kDisableGpuSandbox); | 971 cmd_line->AppendSwitch(switches::kDisableGpuSandbox); |
| 972 | 972 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 // process so the DLL unloads itself. http://crbug/129884 | 1026 // process so the DLL unloads itself. http://crbug/129884 |
| 1027 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); | 1027 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); |
| 1028 #endif | 1028 #endif |
| 1029 | 1029 |
| 1030 // If specified, prepend a launcher program to the command line. | 1030 // If specified, prepend a launcher program to the command line. |
| 1031 if (!gpu_launcher.empty()) | 1031 if (!gpu_launcher.empty()) |
| 1032 cmd_line->PrependWrapper(gpu_launcher); | 1032 cmd_line->PrependWrapper(gpu_launcher); |
| 1033 | 1033 |
| 1034 process_->Launch( | 1034 process_->Launch( |
| 1035 #if defined(OS_WIN) | 1035 #if defined(OS_WIN) |
| 1036 FilePath(), | 1036 base::FilePath(), |
| 1037 #elif defined(OS_POSIX) | 1037 #elif defined(OS_POSIX) |
| 1038 false, | 1038 false, |
| 1039 base::EnvironmentVector(), | 1039 base::EnvironmentVector(), |
| 1040 #endif | 1040 #endif |
| 1041 cmd_line); | 1041 cmd_line); |
| 1042 process_launched_ = true; | 1042 process_launched_ = true; |
| 1043 | 1043 |
| 1044 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", | 1044 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", |
| 1045 LAUNCHED, GPU_PROCESS_LIFETIME_EVENT_MAX); | 1045 LAUNCHED, GPU_PROCESS_LIFETIME_EVENT_MAX); |
| 1046 return true; | 1046 return true; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1059 void GpuProcessHost::BlockLiveOffscreenContexts() { | 1059 void GpuProcessHost::BlockLiveOffscreenContexts() { |
| 1060 for (std::multiset<GURL>::iterator iter = | 1060 for (std::multiset<GURL>::iterator iter = |
| 1061 urls_with_live_offscreen_contexts_.begin(); | 1061 urls_with_live_offscreen_contexts_.begin(); |
| 1062 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { | 1062 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { |
| 1063 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( | 1063 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( |
| 1064 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); | 1064 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); |
| 1065 } | 1065 } |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 } // namespace content | 1068 } // namespace content |
| OLD | NEW |