blob: bc4a56970ce0db4917c6d8abec770e55f836719d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_
#define MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_
#include "base/memory/scoped_ptr.h"
#include "media/base/cdm_factory.h"
#include "media/base/cdm_promise.h"
#include "media/base/media_export.h"
#include "media/base/media_keys.h"
namespace media {
// Promise to be resolved when the CDM is initialized. It owns the MediaKeys
// object until the initialization completes, which it then passes to
// |cdm_created_cb|.
class MEDIA_EXPORT CdmInitializedPromise : public SimpleCdmPromise {
public:
CdmInitializedPromise(const CdmCreatedCB& cdm_created_cb,
scoped_ptr<MediaKeys> cdm);
~CdmInitializedPromise() override;
// SimpleCdmPromise implementation.
void resolve() override;
void reject(MediaKeys::Exception exception_code,
uint32 system_code,
const std::string& error_message) override;
private:
CdmCreatedCB cdm_created_cb_;
scoped_ptr<MediaKeys> cdm_;
};
} // namespace media
#endif // MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_
|