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

Unified Diff: media/blink/cdm_result_promise_helper.h

Issue 651113002: Move CdmResultPromise to media/blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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 | « media/blink/cdm_result_promise.h ('k') | media/blink/cdm_result_promise_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/cdm_result_promise_helper.h
diff --git a/media/blink/cdm_result_promise_helper.h b/media/blink/cdm_result_promise_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..2fe385d0f432636c03ec95607073ea248045787a
--- /dev/null
+++ b/media/blink/cdm_result_promise_helper.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BLINK_CDM_RESULT_PROMISE_HELPER_H_
+#define MEDIA_BLINK_CDM_RESULT_PROMISE_HELPER_H_
+
+#include <string>
+
+#include "media/base/media_export.h"
+#include "media/base/media_keys.h"
+#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
+
+namespace media {
+
+// A superset of media::MediaKeys::Exception for UMA reporting. These values
+// should never be changed as it will affect existing reporting, and must match
+// the values for CdmPromiseResult in tools/metrics/histograms/histograms.xml.
+enum CdmResultForUMA {
+ SUCCESS = 0,
+ NOT_SUPPORTED_ERROR = 1,
+ INVALID_STATE_ERROR = 2,
+ INVALID_ACCESS_ERROR = 3,
+ QUOTA_EXCEEDED_ERROR = 4,
+ UNKNOWN_ERROR = 5,
+ CLIENT_ERROR = 6,
+ OUTPUT_ERROR = 7,
+ NUM_RESULT_CODES
+};
+
+MEDIA_EXPORT CdmResultForUMA
+ ConvertCdmExceptionToResultForUMA(MediaKeys::Exception exception_code);
+
+MEDIA_EXPORT blink::WebContentDecryptionModuleException ConvertCdmException(
+ MediaKeys::Exception exception_code);
+
+MEDIA_EXPORT void ReportCdmResultUMA(const std::string& uma_name,
+ CdmResultForUMA result);
+
+} // namespace media
+
+#endif // MEDIA_BLINK_CDM_RESULT_PROMISE_HELPER_H_
« no previous file with comments | « media/blink/cdm_result_promise.h ('k') | media/blink/cdm_result_promise_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698