Chromium Code Reviews| Index: media/remoting/remoting_cdm.h |
| diff --git a/media/remoting/remoting_cdm.h b/media/remoting/remoting_cdm.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2d562714ff529904cf734f8c4ca8bd935fed817a |
| --- /dev/null |
| +++ b/media/remoting/remoting_cdm.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright 2016 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_REMOTING_REMOTING_CDM_H_ |
| +#define MEDIA_REMOTING_REMOTING_CDM_H_ |
| + |
| +#include "media/base/cdm_context.h" |
| +#include "media/base/cdm_factory.h" |
| +#include "media/base/media_keys.h" |
| +#include "media/remoting/remoting_cdm_controller.h" |
| + |
| +namespace media { |
| + |
| +// TODO(xjz): Merge this with Eric's implementation. |
|
xhwang
2016/11/01 08:21:28
nit: use ldap instead of first name for easier tra
xjz
2016/11/01 21:55:52
Done.
|
| +class RemotingCdm : public MediaKeys, public CdmContext { |
| + public: |
| + RemotingCdm(const std::string& key_system, |
| + const GURL& security_origin, |
| + const CdmConfig& cdm_config, |
| + const SessionMessageCB& session_message_cb, |
| + const SessionClosedCB& session_closed_cb, |
| + const SessionKeysChangeCB& session_keys_change_cb, |
| + const SessionExpirationUpdateCB& session_expiration_update_cb, |
| + const CdmCreatedCB& cdm_created_cb, |
| + std::unique_ptr<RemotingCdmController> remoting_controller); |
| + |
| + // If |cdm| is an instance of RemotingCdm, return a type-casted pointer to it. |
| + // Otherwise, return nullptr. |
| + static RemotingCdm* From(CdmContext* cdm); |
|
xhwang
2016/11/01 08:21:28
We don't want to get the CDM from the CdmContext :
xjz
2016/11/01 21:55:52
Done.
|
| + |
| + RemotingSourceImpl* GetRemotingSource(); |
|
xhwang
2016/11/01 08:21:28
By looking at code below, it seems RSI is ref-coun
xhwang
2016/11/01 08:21:28
Who owns the returned value? If it's owned by this
xjz
2016/11/01 21:55:52
The returned value is stored to a scoped_refptr.
xjz
2016/11/01 21:55:52
The below was commented by miu:
General scoped_ref
xhwang
2016/11/02 06:47:05
hmm, this seems a pattern that is not recommended
xjz
2016/11/02 17:38:11
+miu
Here is the coding style: https://chromium.g
miu
2016/11/03 00:03:08
This is the text guiding this decision: "Conventio
xhwang
2016/11/03 06:41:01
Agreed. But in the comment above, xjz@ said "the r
|
| + |
| + // MediaKeys implementations. |
| + void SetServerCertificate(const std::vector<uint8_t>& certificate, |
| + std::unique_ptr<SimpleCdmPromise> promise) override; |
| + void CreateSessionAndGenerateRequest( |
| + SessionType session_type, |
| + EmeInitDataType init_data_type, |
| + const std::vector<uint8_t>& init_data, |
| + std::unique_ptr<NewSessionCdmPromise> promise) override; |
| + void LoadSession(SessionType session_type, |
| + const std::string& session_id, |
| + std::unique_ptr<NewSessionCdmPromise> promise) override; |
| + void UpdateSession(const std::string& session_id, |
| + const std::vector<uint8_t>& response, |
| + std::unique_ptr<SimpleCdmPromise> promise) override; |
| + void CloseSession(const std::string& session_id, |
| + std::unique_ptr<SimpleCdmPromise> promise) override; |
| + void RemoveSession(const std::string& session_id, |
| + std::unique_ptr<SimpleCdmPromise> promise) override; |
| + CdmContext* GetCdmContext() override; |
| + |
| + // CdmContext implementations. |
| + Decryptor* GetDecryptor() override; |
| + int GetCdmId() const override; |
| + void* GetClassIdentifier() const override; |
| + |
| + private: |
| + ~RemotingCdm() override; |
| + |
| + const std::unique_ptr<RemotingCdmController> remoting_controller_; |
|
xhwang
2016/11/01 08:21:28
nit: will |remoting_cdm_controller_| be more expli
xjz
2016/11/01 21:55:52
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(RemotingCdm); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_REMOTING_REMOTING_CDM_H_ |