Index: media/blink/webmediaplayer_impl.cc |
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
index 6b2a26050adc6edf35dc7e7b10104d36ec540430..ca1e5ffc04cc59354f92d27db456157385384586 100644 |
--- a/media/blink/webmediaplayer_impl.cc |
+++ b/media/blink/webmediaplayer_impl.cc |
@@ -16,6 +16,7 @@ |
#include "base/command_line.h" |
#include "base/debug/alias.h" |
#include "base/debug/crash_logging.h" |
+#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram.h" |
#include "base/single_thread_task_runner.h" |
#include "base/synchronization/waitable_event.h" |
@@ -290,9 +291,23 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
return; |
} |
+ // TODO(hubbe): This experiment is temporary and should be removed once |
DaleCurtis
2016/02/05 01:05:18
I suspect the experiment folk are going to want yo
hubbe
2016/02/09 22:01:59
Better now?
|
+ // we have enough data to support the primacy of the new media cache. |
+ // See http://crbug.com/514719 for details. |
+ // |
+ // Note: It's important to query the field trial state first, to ensure that |
+ // UMA reports the correct group. |
+ const std::string group_name = |
+ base::FieldTrialList::FindFullName("UseNewMediaCacheTrial"); |
+ const bool enabled_via_cli = |
+ base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kUseNewMediaCache); |
+ const bool use_multibuffer = |
+ enabled_via_cli || |
+ base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE); |
+ |
// Otherwise it's a regular request which requires resolving the URL first. |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kUseNewMediaCache)) { |
+ if (use_multibuffer) { |
// Remove this when MultiBufferDataSource becomes default. |
LOG(WARNING) << "Using MultibufferDataSource"; |
data_source_.reset(new MultibufferDataSource( |