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

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

Issue 833963003: Pass key_information on SessionKeysChange message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes Created 5 years, 11 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 | « media/cdm/ppapi/external_clear_key/clear_key_cdm.h ('k') | media/cdm/proxy_decryptor.h » ('j') | 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 <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "media/base/cdm_callback_promise.h" 17 #include "media/base/cdm_callback_promise.h"
18 #include "media/base/cdm_key_information.h"
18 #include "media/base/decoder_buffer.h" 19 #include "media/base/decoder_buffer.h"
19 #include "media/base/decrypt_config.h" 20 #include "media/base/decrypt_config.h"
20 #include "media/cdm/json_web_key.h" 21 #include "media/cdm/json_web_key.h"
21 #include "media/cdm/ppapi/cdm_file_io_test.h" 22 #include "media/cdm/ppapi/cdm_file_io_test.h"
22 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h" 23 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h"
23 24
24 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) 25 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER)
25 #include "base/basictypes.h" 26 #include "base/basictypes.h"
26 const int64 kNoTimestamp = kint64min; 27 const int64 kNoTimestamp = kint64min;
27 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER 28 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 // promise). 684 // promise).
684 host_->OnSessionMessage(web_session_id.data(), 685 host_->OnSessionMessage(web_session_id.data(),
685 web_session_id.length(), 686 web_session_id.length(),
686 reinterpret_cast<const char*>(message.data()), 687 reinterpret_cast<const char*>(message.data()),
687 message.size(), 688 message.size(),
688 destination_url.spec().data(), 689 destination_url.spec().data(),
689 destination_url.spec().size()); 690 destination_url.spec().size());
690 } 691 }
691 692
692 void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id, 693 void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id,
693 bool has_additional_usable_key) { 694 bool has_additional_usable_key,
695 CdmKeysInfo keys_info) {
694 // Ignore the message when we are waiting to update the loadable session. 696 // Ignore the message when we are waiting to update the loadable session.
695 if (web_session_id == session_id_for_emulated_loadsession_) 697 if (web_session_id == session_id_for_emulated_loadsession_)
696 return; 698 return;
697 699
700 // TODO(jrummell): Pass |keys_info| on.
698 host_->OnSessionUsableKeysChange(web_session_id.data(), 701 host_->OnSessionUsableKeysChange(web_session_id.data(),
699 web_session_id.length(), 702 web_session_id.length(),
700 has_additional_usable_key); 703 has_additional_usable_key);
701 } 704 }
702 705
703 void ClearKeyCdm::OnSessionClosed(const std::string& web_session_id) { 706 void ClearKeyCdm::OnSessionClosed(const std::string& web_session_id) {
704 host_->OnSessionClosed(web_session_id.data(), web_session_id.length()); 707 host_->OnSessionClosed(web_session_id.data(), web_session_id.length());
705 } 708 }
706 709
707 void ClearKeyCdm::OnSessionCreated(uint32 promise_id, 710 void ClearKeyCdm::OnSessionCreated(uint32 promise_id,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 host_->OnSessionMessage(last_session_id_.data(), 843 host_->OnSessionMessage(last_session_id_.data(),
841 last_session_id_.length(), 844 last_session_id_.length(),
842 message.data(), 845 message.data(),
843 message.length(), 846 message.length(),
844 NULL, 847 NULL,
845 0); 848 0);
846 file_io_test_runner_.reset(); 849 file_io_test_runner_.reset();
847 } 850 }
848 851
849 } // namespace media 852 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/ppapi/external_clear_key/clear_key_cdm.h ('k') | media/cdm/proxy_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698