1 // Copyright 2015 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.
5 #ifndef MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_
6 #define MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "media/base/cdm_factory.h"
10 #include "media/base/cdm_promise.h"
11 #include "media/base/media_export.h"
12 #include "media/base/media_keys.h"
16 // Promise to be resolved when the CDM is initialized. It owns the MediaKeys
17 // object until the initialization completes, which it then passes to
19 class MEDIA_EXPORT CdmInitializedPromise
: public SimpleCdmPromise
{
21 CdmInitializedPromise(const CdmCreatedCB
& cdm_created_cb
,
22 scoped_ptr
<MediaKeys
> cdm
);
23 ~CdmInitializedPromise() override
;
25 // SimpleCdmPromise implementation.
26 void resolve() override
;
27 void reject(MediaKeys::Exception exception_code
,
29 const std::string
& error_message
) override
;
32 CdmCreatedCB cdm_created_cb_
;
33 scoped_ptr
<MediaKeys
> cdm_
;
38 #endif // MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_