tor-browser

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

WidevineFileIO.h (1197B)


      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 WidevineFileIO_h_
      7 #define WidevineFileIO_h_
      8 
      9 #include <string>
     10 
     11 #include "content_decryption_module.h"
     12 #include "gmp-api/gmp-storage.h"
     13 
     14 namespace mozilla {
     15 
     16 class WidevineFileIO : public cdm::FileIO, public GMPRecordClient {
     17 public:
     18  explicit WidevineFileIO(cdm::FileIOClient* aClient)
     19      : mClient(aClient), mRecord(nullptr) {}
     20 
     21  // cdm::FileIO
     22  void Open(const char* aFilename, uint32_t aFilenameLength) override;
     23  void Read() override;
     24  void Write(const uint8_t* aData, uint32_t aDataSize) override;
     25  void Close() override;
     26 
     27  // GMPRecordClient
     28  void OpenComplete(GMPErr aStatus) override;
     29  void ReadComplete(GMPErr aStatus, const uint8_t* aData,
     30                    uint32_t aDataSize) override;
     31  void WriteComplete(GMPErr aStatus) override;
     32 
     33 private:
     34  cdm::FileIOClient* mClient;
     35  GMPRecord* mRecord;
     36  std::string mName;
     37 };
     38 
     39 }  // namespace mozilla
     40 
     41 #endif  // WidevineFileIO_h_