1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "media/base/pipeline_status.h" 6 7 #include "base/bind.h" 8 #include "base/metrics/histogram.h" 9 10 namespace media { 11 12 static void ReportAndRun(const std::string& name, 13 const PipelineStatusCB& cb, 14 PipelineStatus status) { 15 UMA_HISTOGRAM_ENUMERATION(name, status, PIPELINE_STATUS_MAX); 16 cb.Run(status); 17 } 18 19 PipelineStatusCB CreateUMAReportingPipelineCB(const std::string& name, 20 const PipelineStatusCB& cb) { 21 return base::Bind(&ReportAndRun, name, cb); 22 } 23 24 } // namespace media 25