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" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 WebContentDecryptionModuleImpl::createSession() { | 86 WebContentDecryptionModuleImpl::createSession() { |
87 return adapter_->CreateSession(); | 87 return adapter_->CreateSession(); |
88 } | 88 } |
89 | 89 |
90 void WebContentDecryptionModuleImpl::setServerCertificate( | 90 void WebContentDecryptionModuleImpl::setServerCertificate( |
91 const uint8* server_certificate, | 91 const uint8* server_certificate, |
92 size_t server_certificate_length, | 92 size_t server_certificate_length, |
93 blink::WebContentDecryptionModuleResult result) { | 93 blink::WebContentDecryptionModuleResult result) { |
94 DCHECK(server_certificate); | 94 DCHECK(server_certificate); |
95 adapter_->SetServerCertificate( | 95 adapter_->SetServerCertificate( |
96 server_certificate, | 96 std::vector<uint8>(server_certificate, |
97 base::saturated_cast<int>(server_certificate_length), | 97 server_certificate + server_certificate_length), |
98 scoped_ptr<SimpleCdmPromise>( | 98 scoped_ptr<SimpleCdmPromise>( |
99 new CdmResultPromise<>(result, std::string()))); | 99 new CdmResultPromise<>(result, std::string()))); |
100 } | 100 } |
101 | 101 |
102 CdmContext* WebContentDecryptionModuleImpl::GetCdmContext() { | 102 CdmContext* WebContentDecryptionModuleImpl::GetCdmContext() { |
103 return adapter_->GetCdmContext(); | 103 return adapter_->GetCdmContext(); |
104 } | 104 } |
105 | 105 |
106 } // namespace media | 106 } // namespace media |
OLD | NEW |