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

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 1121653002: Experiment for disabling accelerated video decoding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug ID added in comment Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index 3d50a3b85bffcf9b066532b836f3346ae71d0252..d5e1dd9c13da2ddd33d6eda4832c31c27b02f8ee 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -602,8 +602,7 @@ void GpuDataManagerImplPrivate::AppendRendererCommandLine(
base::CommandLine* command_line) const {
DCHECK(command_line);
- if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) &&
- !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
+ if (ShouldDisableAcceleratedVideoDecode(command_line))
command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
#if defined(ENABLE_WEBRTC)
if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) &&
@@ -658,8 +657,7 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine(
IntSetToString(gpu_driver_bugs_));
}
- if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) &&
- !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
+ if (ShouldDisableAcceleratedVideoDecode(command_line)) {
command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
}
#if defined(ENABLE_WEBRTC)
@@ -739,9 +737,10 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs(
}
#endif
- if (!IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableAcceleratedVideoDecode)) {
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ if (!ShouldDisableAcceleratedVideoDecode(command_line) &&
+ !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
prefs->pepper_accelerated_video_decode_enabled = true;
}
}
@@ -879,6 +878,26 @@ bool GpuDataManagerImplPrivate::CanUseGpuBrowserCompositor() const {
return true;
}
+
+bool GpuDataManagerImplPrivate::ShouldDisableAcceleratedVideoDecode(
+ const base::CommandLine* command_line) const {
+ // Make sure that we initialize the experiment first to make sure that
+ // statistics are bucket correctly in all cases.
+ // This experiment is temporary and will be removed once enough data
+ // to resolve crbug/442039 has been collected.
+ const std::string group_name = base::FieldTrialList::FindFullName(
+ "DisableAcceleratedVideoDecode");
+ if (command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
+ // It was already disabled on the command line.
+ return false;
+ }
+ if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE))
+ return true;
+ if (group_name == "Disabled")
+ return true;
+ return false;
+}
+
void GpuDataManagerImplPrivate::GetDisabledExtensions(
std::string* disabled_extensions) const {
DCHECK(disabled_extensions);
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698