OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webcontentdecryptionmodule_impl.h" | 5 #include "webcontentdecryptionmodule_impl.h" |
6 | 6 |
7 #include "base/basictypes.h" | |
8 #include "base/bind.h" | 7 #include "base/bind.h" |
9 #include "base/logging.h" | 8 #include "base/logging.h" |
10 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
11 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
13 #include "media/base/cdm_promise.h" | 12 #include "media/base/cdm_promise.h" |
14 #include "media/base/key_systems.h" | 13 #include "media/base/key_systems.h" |
15 #include "media/base/media_keys.h" | 14 #include "media/base/media_keys.h" |
16 #include "media/blink/cdm_result_promise.h" | 15 #include "media/blink/cdm_result_promise.h" |
17 #include "media/blink/cdm_session_adapter.h" | 16 #include "media/blink/cdm_session_adapter.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { | 79 WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { |
81 } | 80 } |
82 | 81 |
83 // The caller owns the created session. | 82 // The caller owns the created session. |
84 blink::WebContentDecryptionModuleSession* | 83 blink::WebContentDecryptionModuleSession* |
85 WebContentDecryptionModuleImpl::createSession() { | 84 WebContentDecryptionModuleImpl::createSession() { |
86 return adapter_->CreateSession(); | 85 return adapter_->CreateSession(); |
87 } | 86 } |
88 | 87 |
89 void WebContentDecryptionModuleImpl::setServerCertificate( | 88 void WebContentDecryptionModuleImpl::setServerCertificate( |
90 const uint8* server_certificate, | 89 const uint8_t* server_certificate, |
91 size_t server_certificate_length, | 90 size_t server_certificate_length, |
92 blink::WebContentDecryptionModuleResult result) { | 91 blink::WebContentDecryptionModuleResult result) { |
93 DCHECK(server_certificate); | 92 DCHECK(server_certificate); |
94 adapter_->SetServerCertificate( | 93 adapter_->SetServerCertificate( |
95 std::vector<uint8>(server_certificate, | 94 std::vector<uint8_t>(server_certificate, |
96 server_certificate + server_certificate_length), | 95 server_certificate + server_certificate_length), |
97 scoped_ptr<SimpleCdmPromise>( | 96 scoped_ptr<SimpleCdmPromise>( |
98 new CdmResultPromise<>(result, std::string()))); | 97 new CdmResultPromise<>(result, std::string()))); |
99 } | 98 } |
100 | 99 |
101 CdmContext* WebContentDecryptionModuleImpl::GetCdmContext() { | 100 CdmContext* WebContentDecryptionModuleImpl::GetCdmContext() { |
102 return adapter_->GetCdmContext(); | 101 return adapter_->GetCdmContext(); |
103 } | 102 } |
104 | 103 |
105 } // namespace media | 104 } // namespace media |
OLD | NEW |