tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DecryptorProxyCallback.h (2021B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef DecryptorProxyCallback_h_
      7 #define DecryptorProxyCallback_h_
      8 
      9 #include "mozilla/CDMProxy.h"
     10 #include "mozilla/dom/MediaKeyMessageEventBinding.h"  // For MediaKeyMessageType
     11 #include "mozilla/dom/MediaKeyStatusMapBinding.h"     // For MediaKeyStatus
     12 
     13 namespace mozilla {
     14 class ErrorResult;
     15 }
     16 
     17 class DecryptorProxyCallback {
     18 public:
     19  virtual ~DecryptorProxyCallback() {}
     20 
     21  virtual void SetSessionId(uint32_t aCreateSessionId,
     22                            const nsCString& aSessionId) = 0;
     23 
     24  virtual void ResolveLoadSessionPromise(uint32_t aPromiseId,
     25                                         bool aSuccess) = 0;
     26 
     27  virtual void ResolvePromise(uint32_t aPromiseId) = 0;
     28 
     29  virtual void RejectPromise(uint32_t aPromiseId,
     30                             mozilla::ErrorResult&& aException,
     31                             const nsCString& aSessionId) = 0;
     32 
     33  virtual void SessionMessage(const nsCString& aSessionId,
     34                              mozilla::dom::MediaKeyMessageType aMessageType,
     35                              const nsTArray<uint8_t>& aMessage) = 0;
     36 
     37  virtual void ExpirationChange(const nsCString& aSessionId,
     38                                mozilla::UnixTime aExpiryTime) = 0;
     39 
     40  virtual void SessionClosed(const nsCString& aSessionId) = 0;
     41 
     42  virtual void SessionError(const nsCString& aSessionId, nsresult aException,
     43                            uint32_t aSystemCode,
     44                            const nsCString& aMessage) = 0;
     45 
     46  virtual void Decrypted(uint32_t aId, mozilla::DecryptStatus aResult,
     47                         const nsTArray<uint8_t>& aDecryptedData) = 0;
     48 
     49  virtual void BatchedKeyStatusChanged(
     50      const nsCString& aSessionId,
     51      const nsTArray<mozilla::CDMKeyInfo>& aKeyInfos) = 0;
     52 };
     53 
     54 #endif