OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CDM_CONTENT_DECRYPTION_MODULE_BROKER_H_ |
| 6 #define CDM_CONTENT_DECRYPTION_MODULE_BROKER_H_ |
| 7 |
| 8 #if defined(_MSC_VER) |
| 9 typedef unsigned char uint8_t; |
| 10 typedef unsigned int uint32_t; |
| 11 #else |
| 12 #include <stdint.h> |
| 13 #endif |
| 14 |
| 15 #include "content_decryption_module_export.h" |
| 16 |
| 17 // Define FilePathCharType to be the type of characters passed when |
| 18 // specifying file paths to ProcessHostChallenge() |
| 19 #if defined(WIN32) |
| 20 // On Windows, for Unicode-aware applications, native pathnames are wchar_t |
| 21 // arrays. |
| 22 typedef wchar_t FilePathCharType; |
| 23 #else |
| 24 // On other platforms, native pathnames are char arrays. |
| 25 typedef char FilePathCharType; |
| 26 #endif // defined(WIN32) |
| 27 |
| 28 extern "C" { |
| 29 // Returns the |response| to ProcessHostChallenge(). If the challenge fails, |
| 30 // |response| = nullptr and |response_size| = 0. |context| must be the value |
| 31 // passed in to ProcessHostChallenge(). |
| 32 typedef void (*HostResponseFunc)(const uint8_t* response, |
| 33 uint32_t response_size, |
| 34 void* context); |
| 35 |
| 36 // This method receives the |challenge| from the CDM as well as a list of |
| 37 // additional binary file paths created by the host and a callback function. |
| 38 // |response_func| is called when the challenge has been processed, passing |
| 39 // |context| along with the desired response data. |
| 40 CDM_API void ProcessHostChallenge(const uint8_t* challenge, |
| 41 uint32_t challenge_size, |
| 42 const FilePathCharType** binary_file_paths, |
| 43 uint32_t num_binary_file_paths, |
| 44 HostResponseFunc response_func, |
| 45 void* context); |
| 46 } |
| 47 |
| 48 #endif // CDM_CONTENT_DECRYPTION_MODULE_BROKER_H_ |
OLD | NEW |