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