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

Side by Side Diff: content/public/browser/gpu_utils.cc

Issue 2814843002: gpu: GPU service scheduler. (Closed)
Patch Set: Do not allow HIGH priority contexts by unprivileged clients. Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/public/browser/gpu_utils.h" 5 #include "content/public/browser/gpu_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "content/browser/gpu/gpu_process_host.h" 10 #include "content/browser/gpu/gpu_process_host.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 DCHECK(base::CommandLine::InitializedForCurrentProcess()); 48 DCHECK(base::CommandLine::InitializedForCurrentProcess());
49 const base::CommandLine* command_line = 49 const base::CommandLine* command_line =
50 base::CommandLine::ForCurrentProcess(); 50 base::CommandLine::ForCurrentProcess();
51 gpu::GpuPreferences gpu_preferences; 51 gpu::GpuPreferences gpu_preferences;
52 gpu_preferences.single_process = 52 gpu_preferences.single_process =
53 command_line->HasSwitch(switches::kSingleProcess); 53 command_line->HasSwitch(switches::kSingleProcess);
54 gpu_preferences.in_process_gpu = 54 gpu_preferences.in_process_gpu =
55 command_line->HasSwitch(switches::kInProcessGPU); 55 command_line->HasSwitch(switches::kInProcessGPU);
56 gpu_preferences.ui_prioritize_in_gpu_process = 56 gpu_preferences.ui_prioritize_in_gpu_process =
57 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); 57 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess);
58 gpu_preferences.enable_gpu_scheduler =
59 command_line->HasSwitch(switches::kEnableGpuScheduler) &&
60 !command_line->HasSwitch(switches::kDisableGpuScheduler);
58 gpu_preferences.disable_accelerated_video_decode = 61 gpu_preferences.disable_accelerated_video_decode =
59 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); 62 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
60 #if defined(OS_CHROMEOS) 63 #if defined(OS_CHROMEOS)
61 gpu_preferences.disable_vaapi_accelerated_video_encode = 64 gpu_preferences.disable_vaapi_accelerated_video_encode =
62 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); 65 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
63 #endif 66 #endif
64 #if BUILDFLAG(ENABLE_WEBRTC) 67 #if BUILDFLAG(ENABLE_WEBRTC)
65 gpu_preferences.disable_web_rtc_hw_encoding = 68 gpu_preferences.disable_web_rtc_hw_encoding =
66 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) || 69 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) ||
67 (command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding) && 70 (command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding) &&
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void StopGpuProcess(const base::Closure& callback) { 138 void StopGpuProcess(const base::Closure& callback) {
136 content::GpuProcessHost::CallOnIO( 139 content::GpuProcessHost::CallOnIO(
137 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, 140 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
138 false /* force_create */, 141 false /* force_create */,
139 base::Bind(&StopGpuProcessImpl, 142 base::Bind(&StopGpuProcessImpl,
140 base::Bind(RunTaskOnTaskRunner, 143 base::Bind(RunTaskOnTaskRunner,
141 base::ThreadTaskRunnerHandle::Get(), callback))); 144 base::ThreadTaskRunnerHandle::Get(), callback)));
142 } 145 }
143 146
144 } // namespace content 147 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698