OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_CDM_INITIALIZED_PROMISE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_CDM_INITIALIZED_PROMISE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "media/base/cdm_factory.h" |
| 12 #include "media/base/cdm_promise.h" |
| 13 #include "media/base/media_keys.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 // Promise to be resolved when the CDM is initialized. It owns the MediaKeys |
| 18 // object until the initialization completes, which it then passes to |
| 19 // |cdm_created_cb|. |
| 20 class CdmInitializedPromise : public media::SimpleCdmPromise { |
| 21 public: |
| 22 CdmInitializedPromise(const media::CdmCreatedCB& cdm_created_cb, |
| 23 scoped_ptr<media::MediaKeys> cdm); |
| 24 ~CdmInitializedPromise() override; |
| 25 |
| 26 // SimpleCdmPromise implementation. |
| 27 void resolve() override; |
| 28 void reject(media::MediaKeys::Exception exception_code, |
| 29 uint32 system_code, |
| 30 const std::string& error_message) override; |
| 31 |
| 32 private: |
| 33 media::CdmCreatedCB cdm_created_cb_; |
| 34 scoped_ptr<media::MediaKeys> cdm_; |
| 35 }; |
| 36 |
| 37 } // namespace content |
| 38 |
| 39 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_CDM_INITIALIZED_PROMISE_H_ |
OLD | NEW |