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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1670753003: multibuffer field trial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698