tor-browser

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

DecryptJob.h (926B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef DecryptJob_h_
      8 #define DecryptJob_h_
      9 
     10 #include "mozilla/CDMProxy.h"
     11 #include "mozilla/Span.h"
     12 
     13 namespace mozilla {
     14 
     15 class DecryptJob {
     16 public:
     17  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DecryptJob)
     18 
     19  explicit DecryptJob(MediaRawData* aSample);
     20 
     21  void PostResult(DecryptStatus aResult, Span<const uint8_t> aDecryptedData);
     22  void PostResult(DecryptStatus aResult);
     23 
     24  RefPtr<DecryptPromise> Ensure();
     25 
     26  const uint32_t mId;
     27  RefPtr<MediaRawData> mSample;
     28 
     29 private:
     30  ~DecryptJob() = default;
     31  MozPromiseHolder<DecryptPromise> mPromise;
     32 };
     33 
     34 }  // namespace mozilla
     35 
     36 #endif  // DecryptJob_h_