| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/blink/new_session_cdm_result_promise.h" | 5 #include "media/blink/new_session_cdm_result_promise.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/blink/cdm_result_promise_helper.h" | 8 #include "media/blink/cdm_result_promise_helper.h" |
| 9 #include "third_party/WebKit/public/platform/WebString.h" | 9 #include "third_party/WebKit/public/platform/WebString.h" |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 "Cannot finish session initialization"); | 49 "Cannot finish session initialization"); |
| 50 return; | 50 return; |
| 51 } | 51 } |
| 52 | 52 |
| 53 MarkPromiseSettled(); | 53 MarkPromiseSettled(); |
| 54 ReportCdmResultUMA(uma_name_, SUCCESS); | 54 ReportCdmResultUMA(uma_name_, SUCCESS); |
| 55 web_cdm_result_.completeWithSession(ConvertStatus(status)); | 55 web_cdm_result_.completeWithSession(ConvertStatus(status)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void NewSessionCdmResultPromise::reject(MediaKeys::Exception exception_code, | 58 void NewSessionCdmResultPromise::reject(MediaKeys::Exception exception_code, |
| 59 uint32 system_code, | 59 uint32_t system_code, |
| 60 const std::string& error_message) { | 60 const std::string& error_message) { |
| 61 MarkPromiseSettled(); | 61 MarkPromiseSettled(); |
| 62 ReportCdmResultUMA(uma_name_, | 62 ReportCdmResultUMA(uma_name_, |
| 63 ConvertCdmExceptionToResultForUMA(exception_code)); | 63 ConvertCdmExceptionToResultForUMA(exception_code)); |
| 64 web_cdm_result_.completeWithError(ConvertCdmException(exception_code), | 64 web_cdm_result_.completeWithError(ConvertCdmException(exception_code), |
| 65 system_code, | 65 system_code, |
| 66 blink::WebString::fromUTF8(error_message)); | 66 blink::WebString::fromUTF8(error_message)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace media | 69 } // namespace media |
| OLD | NEW |