WMFCDMProxyCallback.h (1225B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef DOM_MEDIA_EME_MEDIAFOUNDATION_WMFCDMPROXYCALLBACK_H_ 6 #define DOM_MEDIA_EME_MEDIAFOUNDATION_WMFCDMPROXYCALLBACK_H_ 7 8 #include "mozilla/PMFCDM.h" 9 #include "nsThreadUtils.h" 10 11 namespace mozilla { 12 13 class WMFCDMProxy; 14 15 // This class is used to notify CDM related events called from MFCDMChild, and 16 // it will forward the relative calls to WMFCDMProxy on the main thread. 17 class WMFCDMProxyCallback final { 18 public: 19 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WMFCDMProxyCallback); 20 21 explicit WMFCDMProxyCallback(WMFCDMProxy* aProxy); 22 23 void OnSessionMessage(const MFCDMKeyMessage& aMessage); 24 25 void OnSessionKeyStatusesChange(const MFCDMKeyStatusChange& aKeyStatuses); 26 27 void OnSessionKeyExpiration(const MFCDMKeyExpiration& aExpiration); 28 29 void OnSessionClosed(const MFCDMSessionClosedResult& aResult); 30 31 void OnRemoteProcessCrashed(); 32 33 void Shutdown(); 34 35 private: 36 ~WMFCDMProxyCallback(); 37 RefPtr<WMFCDMProxy> mProxy; 38 }; 39 40 } // namespace mozilla 41 42 #endif // DOM_MEDIA_EME_MEDIAFOUNDATION_WMFCDMPROXYCALLBACK_H_