Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / media / blink / cdm_result_promise_helper.h
blob2fe385d0f432636c03ec95607073ea248045787a
1 // Copyright 2014 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.
5 #ifndef MEDIA_BLINK_CDM_RESULT_PROMISE_HELPER_H_
6 #define MEDIA_BLINK_CDM_RESULT_PROMISE_HELPER_H_
8 #include <string>
10 #include "media/base/media_export.h"
11 #include "media/base/media_keys.h"
12 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
14 namespace media {
16 // A superset of media::MediaKeys::Exception for UMA reporting. These values
17 // should never be changed as it will affect existing reporting, and must match
18 // the values for CdmPromiseResult in tools/metrics/histograms/histograms.xml.
19 enum CdmResultForUMA {
20 SUCCESS = 0,
21 NOT_SUPPORTED_ERROR = 1,
22 INVALID_STATE_ERROR = 2,
23 INVALID_ACCESS_ERROR = 3,
24 QUOTA_EXCEEDED_ERROR = 4,
25 UNKNOWN_ERROR = 5,
26 CLIENT_ERROR = 6,
27 OUTPUT_ERROR = 7,
28 NUM_RESULT_CODES
31 MEDIA_EXPORT CdmResultForUMA
32 ConvertCdmExceptionToResultForUMA(MediaKeys::Exception exception_code);
34 MEDIA_EXPORT blink::WebContentDecryptionModuleException ConvertCdmException(
35 MediaKeys::Exception exception_code);
37 MEDIA_EXPORT void ReportCdmResultUMA(const std::string& uma_name,
38 CdmResultForUMA result);
40 } // namespace media
42 #endif // MEDIA_BLINK_CDM_RESULT_PROMISE_HELPER_H_