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

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: 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
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 68d497434ece97cac7f60b6124f0d1cbf8150b80..8845fd8c9cc3eed77d08b3fc825ea36145329896 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -599,8 +599,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) &&
@@ -655,8 +654,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)
@@ -736,7 +734,8 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs(
}
#endif
- if (!IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) &&
+ if (!ShouldDisableAcceleratedVideoDecode(
+ base::CommandLine::ForCurrentProcess()) &&
DaleCurtis 2015/05/02 17:37:09 Extract command_line into a local variable?
hubbe 2015/05/04 19:16:21 Done.
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableAcceleratedVideoDecode)) {
prefs->pepper_accelerated_video_decode_enabled = true;
@@ -876,6 +875,23 @@ bool GpuDataManagerImplPrivate::CanUseGpuBrowserCompositor() const {
return true;
}
+bool GpuDataManagerImplPrivate::ShouldDisableAcceleratedVideoDecode(
+ base::CommandLine* command_line) const {
+ const std::string group_name = base::FieldTrialList::FindFullName(
DaleCurtis 2015/05/02 17:37:09 Pair with if statement below.
hubbe 2015/05/04 19:16:21 No, it needs to be called here as it affects how s
DaleCurtis 2015/05/04 19:38:17 Can you add a comment for that, that's not obvious
hubbe 2015/05/04 20:46:16 Done.
+ "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;
+ }
DaleCurtis 2015/05/02 17:37:09 Style for this file seems to be no {} for one line
hubbe 2015/05/04 19:16:21 Done.
+ return false;
+}
+
void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs(
const GURL& url, GpuDataManagerImpl::DomainGuilt guilt) {
BlockDomainFrom3DAPIsAtTime(url, guilt, base::Time::Now());

Powered by Google App Engine
This is Rietveld 408576698