Update V8 to version 4.7.56.
[chromium-blink-merge.git] / media / base / cdm_initialized_promise.h
blobbc4a56970ce0db4917c6d8abec770e55f836719d
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"
14 namespace media {
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
18 // |cdm_created_cb|.
19 class MEDIA_EXPORT CdmInitializedPromise : public SimpleCdmPromise {
20 public:
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,
28 uint32 system_code,
29 const std::string& error_message) override;
31 private:
32 CdmCreatedCB cdm_created_cb_;
33 scoped_ptr<MediaKeys> cdm_;
36 } // namespace media
38 #endif // MEDIA_BASE_CDM_INITIALIZED_PROMISE_H_