26 const std::string& key_system,
28 : key_system(key_system), helper_(key_system, this), factory_(factory) {
29 std::vector<std::string> audio_robustness, video_robustness;
31 for (
auto& item : config.audioCapabilities) {
32 audio_robustness.push_back(item.robustness);
34 for (
auto& item : config.videoCapabilities) {
35 video_robustness.push_back(item.robustness);
38 implementation_ = factory_->CreateImplementation(
39 &helper_, config.distinctiveIdentifier, config.persistentState,
40 audio_robustness, video_robustness);
44 MediaKeys::~MediaKeys() {}
48 std::unique_lock<std::mutex> lock(mutex_);
51 tracer->
Trace(&sessions_);
55 return implementation_ !=
nullptr;
61 session_type.
value_or(MediaKeySessionType::Temporary);
62 if (!factory_->SupportsSessionType(type)) {
64 "The given session type is not supported.");
67 std::unique_lock<std::mutex> lock(mutex_);
70 sessions_.emplace_back(session);
76 implementation_->SetServerCertificate(
EmePromise(ret,
true),
82 std::unique_lock<std::mutex> lock(mutex_);
83 for (
auto& session : sessions_) {
84 if (session->SessionId() == session_id)
void Trace(memory::HeapTracer *tracer) const override
void Trace(const Traceable *ptr)
T value_or(U &&default_value) const &
static Promise PendingPromise()
static JsError DOMException(ExceptionCode code)