Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: media/cdm/ppapi/external_clear_key/clear_key_cdm.cc

Issue 2057103004: Pass SetServerCertificate call on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/cdm/ppapi/external_clear_key/clear_key_cdm.h" 5 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <sstream> 9 #include <sstream>
10 #include <utility> 10 #include <utility>
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 base::Bind(&ClearKeyCdm::OnPromiseResolved, base::Unretained(this), 413 base::Bind(&ClearKeyCdm::OnPromiseResolved, base::Unretained(this),
414 promise_id), 414 promise_id),
415 base::Bind(&ClearKeyCdm::OnPromiseFailed, base::Unretained(this), 415 base::Bind(&ClearKeyCdm::OnPromiseFailed, base::Unretained(this),
416 promise_id))); 416 promise_id)));
417 decryptor_->RemoveSession(web_session_str, std::move(promise)); 417 decryptor_->RemoveSession(web_session_str, std::move(promise));
418 } 418 }
419 419
420 void ClearKeyCdm::SetServerCertificate(uint32_t promise_id, 420 void ClearKeyCdm::SetServerCertificate(uint32_t promise_id,
421 const uint8_t* server_certificate_data, 421 const uint8_t* server_certificate_data,
422 uint32_t server_certificate_data_size) { 422 uint32_t server_certificate_data_size) {
423 // ClearKey doesn't use a server certificate. 423 std::unique_ptr<media::SimpleCdmPromise> promise(
424 host_->OnResolvePromise(promise_id); 424 new media::CdmCallbackPromise<>(
425 base::Bind(&ClearKeyCdm::OnPromiseResolved, base::Unretained(this),
426 promise_id),
427 base::Bind(&ClearKeyCdm::OnPromiseFailed, base::Unretained(this),
428 promise_id)));
429 decryptor_->SetServerCertificate(
430 std::vector<uint8_t>(
431 server_certificate_data,
432 server_certificate_data + server_certificate_data_size),
433 std::move(promise));
425 } 434 }
426 435
427 void ClearKeyCdm::TimerExpired(void* context) { 436 void ClearKeyCdm::TimerExpired(void* context) {
428 if (context == &session_id_for_emulated_loadsession_) { 437 if (context == &session_id_for_emulated_loadsession_) {
429 LoadLoadableSession(); 438 LoadLoadableSession();
430 return; 439 return;
431 } 440 }
432 441
433 DCHECK(renewal_timer_set_); 442 DCHECK(renewal_timer_set_);
434 std::string renewal_message; 443 std::string renewal_message;
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 void ClearKeyCdm::OnFileIOTestComplete(bool success) { 913 void ClearKeyCdm::OnFileIOTestComplete(bool success) {
905 DVLOG(1) << __FUNCTION__ << ": " << success; 914 DVLOG(1) << __FUNCTION__ << ": " << success;
906 std::string message = GetFileIOTestResultMessage(success); 915 std::string message = GetFileIOTestResultMessage(success);
907 host_->OnSessionMessage(last_session_id_.data(), last_session_id_.length(), 916 host_->OnSessionMessage(last_session_id_.data(), last_session_id_.length(),
908 cdm::kLicenseRequest, message.data(), 917 cdm::kLicenseRequest, message.data(),
909 message.length(), NULL, 0); 918 message.length(), NULL, 0);
910 file_io_test_runner_.reset(); 919 file_io_test_runner_.reset();
911 } 920 }
912 921
913 } // namespace media 922 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698