| 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 #ifndef MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ | 5 #ifndef MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ |
| 6 #define MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ | 6 #define MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | |
| 11 #include "media/base/cdm_promise.h" | 10 #include "media/base/cdm_promise.h" |
| 12 #include "media/base/media_keys.h" | 11 #include "media/base/media_keys.h" |
| 13 #include "media/blink/media_blink_export.h" | 12 #include "media/blink/media_blink_export.h" |
| 14 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | 13 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
| 15 | 14 |
| 16 namespace media { | 15 namespace media { |
| 17 | 16 |
| 18 enum class SessionInitStatus { | 17 enum class SessionInitStatus { |
| 19 // Error creating the session. | 18 // Error creating the session. |
| 20 UNKNOWN_STATUS, | 19 UNKNOWN_STATUS, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 public: | 41 public: |
| 43 NewSessionCdmResultPromise( | 42 NewSessionCdmResultPromise( |
| 44 const blink::WebContentDecryptionModuleResult& result, | 43 const blink::WebContentDecryptionModuleResult& result, |
| 45 const std::string& uma_name, | 44 const std::string& uma_name, |
| 46 const SessionInitializedCB& new_session_created_cb); | 45 const SessionInitializedCB& new_session_created_cb); |
| 47 ~NewSessionCdmResultPromise() override; | 46 ~NewSessionCdmResultPromise() override; |
| 48 | 47 |
| 49 // CdmPromiseTemplate<T> implementation. | 48 // CdmPromiseTemplate<T> implementation. |
| 50 void resolve(const std::string& session_id) override; | 49 void resolve(const std::string& session_id) override; |
| 51 void reject(MediaKeys::Exception exception_code, | 50 void reject(MediaKeys::Exception exception_code, |
| 52 uint32 system_code, | 51 uint32_t system_code, |
| 53 const std::string& error_message) override; | 52 const std::string& error_message) override; |
| 54 | 53 |
| 55 private: | 54 private: |
| 56 blink::WebContentDecryptionModuleResult web_cdm_result_; | 55 blink::WebContentDecryptionModuleResult web_cdm_result_; |
| 57 | 56 |
| 58 // UMA name to report result to. | 57 // UMA name to report result to. |
| 59 std::string uma_name_; | 58 std::string uma_name_; |
| 60 | 59 |
| 61 // Called on resolve() to convert the session ID into a SessionInitStatus to | 60 // Called on resolve() to convert the session ID into a SessionInitStatus to |
| 62 // be reported to blink. | 61 // be reported to blink. |
| 63 SessionInitializedCB new_session_created_cb_; | 62 SessionInitializedCB new_session_created_cb_; |
| 64 | 63 |
| 65 DISALLOW_COPY_AND_ASSIGN(NewSessionCdmResultPromise); | 64 DISALLOW_COPY_AND_ASSIGN(NewSessionCdmResultPromise); |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace media | 67 } // namespace media |
| 69 | 68 |
| 70 #endif // MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ | 69 #endif // MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ |
| OLD | NEW |